-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from healthy-food-and-dietary-products/create_…
…user_model Restore back the correct settings, make migration file
- Loading branch information
Showing
4 changed files
with
251 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,213 @@ | ||
# Generated by Django 4.2.6 on 2023-10-19 04:01 | ||
|
||
import django.contrib.auth.models | ||
import django.core.validators | ||
from django.db import migrations, models | ||
import django.utils.timezone | ||
import phonenumber_field.modelfields | ||
import users.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
initial = True | ||
|
||
dependencies = [ | ||
("auth", "0012_alter_user_first_name_max_length"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="User", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
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" | ||
), | ||
), | ||
( | ||
"is_superuser", | ||
models.BooleanField( | ||
default=False, | ||
help_text="Designates that this user has all permissions without explicitly assigning them.", | ||
verbose_name="superuser status", | ||
), | ||
), | ||
( | ||
"first_name", | ||
models.CharField( | ||
blank=True, max_length=150, verbose_name="first name" | ||
), | ||
), | ||
( | ||
"last_name", | ||
models.CharField( | ||
blank=True, max_length=150, verbose_name="last name" | ||
), | ||
), | ||
( | ||
"is_staff", | ||
models.BooleanField( | ||
default=False, | ||
help_text="Designates whether the user can log into this admin site.", | ||
verbose_name="staff status", | ||
), | ||
), | ||
( | ||
"is_active", | ||
models.BooleanField( | ||
default=True, | ||
help_text="Designates whether this user should be treated as active. Unselect this instead of deleting accounts.", | ||
verbose_name="active", | ||
), | ||
), | ||
( | ||
"date_joined", | ||
models.DateTimeField( | ||
default=django.utils.timezone.now, verbose_name="date joined" | ||
), | ||
), | ||
( | ||
"username", | ||
models.CharField( | ||
max_length=150, unique=True, verbose_name="Username" | ||
), | ||
), | ||
( | ||
"email", | ||
models.EmailField( | ||
max_length=254, unique=True, verbose_name="E-mail address" | ||
), | ||
), | ||
( | ||
"role", | ||
models.CharField( | ||
choices=[ | ||
("user", "Аутентифицированный пользователь"), | ||
("moderator", "Модератор"), | ||
("admin", "Администратор"), | ||
], | ||
default="user", | ||
max_length=9, | ||
), | ||
), | ||
( | ||
"city", | ||
models.CharField(blank=True, max_length=30, verbose_name="City"), | ||
), | ||
( | ||
"birth_date", | ||
models.DateField(blank=True, null=True, verbose_name="Birth_date"), | ||
), | ||
( | ||
"address_quantity", | ||
models.IntegerField( | ||
default=0, | ||
validators=[django.core.validators.MaxValueValidator(5)], | ||
verbose_name="number_of_cities", | ||
), | ||
), | ||
( | ||
"phone_number", | ||
phonenumber_field.modelfields.PhoneNumberField( | ||
blank=True, | ||
max_length=128, | ||
region=None, | ||
verbose_name="Phone_number", | ||
), | ||
), | ||
( | ||
"photo", | ||
models.ImageField( | ||
blank=True, | ||
default="default.jpg", | ||
upload_to=users.models.User.user_directory_path, | ||
verbose_name="Photo", | ||
), | ||
), | ||
], | ||
options={ | ||
"ordering": ("id",), | ||
}, | ||
managers=[ | ||
("objects", django.contrib.auth.models.UserManager()), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name="Address", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("country", models.CharField(max_length=100, verbose_name="Country")), | ||
("city", models.CharField(max_length=100, verbose_name="City")), | ||
("street", models.CharField(max_length=100, verbose_name="Street")), | ||
("house", models.IntegerField(verbose_name="House_number")), | ||
( | ||
"building", | ||
models.IntegerField( | ||
blank=True, null=True, verbose_name="Buiding_number" | ||
), | ||
), | ||
("apartment", models.IntegerField(verbose_name="Apartment_number")), | ||
], | ||
options={ | ||
"verbose_name": "Address", | ||
"verbose_name_plural": "Addresses", | ||
}, | ||
), | ||
migrations.AddConstraint( | ||
model_name="address", | ||
constraint=models.UniqueConstraint( | ||
fields=("city", "street", "house", "building", "apartment"), | ||
name="unique address", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="user", | ||
name="address", | ||
field=models.ManyToManyField( | ||
related_name="users", to="users.address", verbose_name="Addresses" | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="user", | ||
name="groups", | ||
field=models.ManyToManyField( | ||
blank=True, | ||
help_text="The groups this user belongs to. A user will get all permissions granted to each of their groups.", | ||
related_name="user_set", | ||
related_query_name="user", | ||
to="auth.group", | ||
verbose_name="groups", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="user", | ||
name="user_permissions", | ||
field=models.ManyToManyField( | ||
blank=True, | ||
help_text="Specific permissions for this user.", | ||
related_name="user_set", | ||
related_query_name="user", | ||
to="auth.permission", | ||
verbose_name="user permissions", | ||
), | ||
), | ||
] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters