# Generated by Django 2.2.1 on 2019-10-01 21:48

import account.helpers
import django.core.validators
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('email', models.EmailField(max_length=255, unique=True, verbose_name='email address')),
                ('name', models.CharField(blank=True, max_length=40)),
                ('father_name', models.CharField(blank=True, max_length=40)),
                ('mother_name', models.CharField(blank=True, max_length=40)),
                ('gender', models.CharField(choices=[('m', 'Male'), ('f', 'Female'), ('o', 'Others')], default='m', max_length=1)),
                ('mailing_address', models.CharField(blank=True, max_length=255, null=True)),
                ('permanent_address', models.CharField(blank=True, max_length=255, null=True)),
                ('contact_mobile', models.CharField(max_length=32, validators=[django.core.validators.RegexValidator(code='invalid_contact_mobile', message='Mobile number must be numeric', regex='^(?:\\+?88|0088)?01[15-9]\\d{8}$')])),
                ('contact_phone', models.CharField(blank=True, max_length=32, null=True, validators=[django.core.validators.RegexValidator(code='invalid_contact_phone', message='Phone number must be numeric', regex='^(?:\\+?88|0088)?0\\d{10}$')])),
                ('image', models.ImageField(blank=True, default='account/user/image/default.png', height_field='height_field', null=True, upload_to=account.helpers.UploadTo('image'), width_field='width_field')),
                ('height_field', models.IntegerField(default=0, null=True)),
                ('width_field', models.IntegerField(default=0, null=True)),
                ('account_type', models.CharField(choices=[('sn', 'Student'), ('tc', 'Teacher'), ('of', 'Officer'), ('sf', 'Staff'), ('om', 'Others'), ('lb', 'Librarian')], default='sn', max_length=2)),
                ('registration_copy', models.FileField(blank=True, null=True, upload_to=account.helpers.UploadTo('registration'))),
                ('library_id', models.CharField(max_length=15, unique=True, validators=[django.core.validators.RegexValidator(code='invalid_library_id', message='Library ID must be alphanumeric or contain numbers', regex='^[a-zA-Z0-9.+-]+$')])),
                ('no_borrowed_books', models.PositiveSmallIntegerField(blank=True, default=0, null=True)),
                ('no_borrowed_resources', models.PositiveSmallIntegerField(blank=True, default=0, null=True)),
                ('validity', models.DateTimeField()),
                ('active', models.BooleanField(default=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('staff', models.BooleanField(default=False)),
                ('admin', models.BooleanField(default=False)),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
