Skip to content

Commit 62aa782

Browse files
committed
Made Migrations Again
1 parent b3dd3e5 commit 62aa782

File tree

5 files changed

+111
-0
lines changed

5 files changed

+111
-0
lines changed
0 Bytes
Binary file not shown.
64 Bytes
Binary file not shown.

lead/__pycache__/admin.cpython-39.pyc

1.7 KB
Binary file not shown.

lead/__pycache__/views.cpython-39.pyc

63 Bytes
Binary file not shown.

lead/migrations/0001_initial.py

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Generated by Django 3.2.4 on 2021-10-01 14:18
2+
3+
from django.conf import settings
4+
import django.contrib.auth.models
5+
import django.contrib.auth.validators
6+
import django.core.validators
7+
from django.db import migrations, models
8+
import django.db.models.deletion
9+
import django.utils.timezone
10+
11+
12+
class Migration(migrations.Migration):
13+
14+
initial = True
15+
16+
dependencies = [
17+
('auth', '0012_alter_user_first_name_max_length'),
18+
]
19+
20+
operations = [
21+
migrations.CreateModel(
22+
name='User',
23+
fields=[
24+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
25+
('password', models.CharField(max_length=128, verbose_name='password')),
26+
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
27+
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
28+
('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
29+
('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
30+
('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
31+
('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
32+
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
33+
('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')),
34+
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
35+
('is_organiser', models.BooleanField(default=True)),
36+
('is_agent', models.BooleanField(default=False)),
37+
('groups', 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')),
38+
('user_permissions', 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')),
39+
],
40+
options={
41+
'verbose_name': 'user',
42+
'verbose_name_plural': 'users',
43+
'abstract': False,
44+
},
45+
managers=[
46+
('objects', django.contrib.auth.models.UserManager()),
47+
],
48+
),
49+
migrations.CreateModel(
50+
name='Agent',
51+
fields=[
52+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
53+
('date_created', models.DateField(auto_now_add=True)),
54+
],
55+
options={
56+
'ordering': ['-date_created'],
57+
},
58+
),
59+
migrations.CreateModel(
60+
name='Category',
61+
fields=[
62+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
63+
('name', models.CharField(choices=[('Contacted', 'Contacted'), ('Unassigned', 'Unassigned'), ('Converted', 'Converted')], max_length=200)),
64+
],
65+
),
66+
migrations.CreateModel(
67+
name='Profile',
68+
fields=[
69+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
70+
('gender', models.CharField(choices=[('Male', 'Male'), ('Female', 'Female'), ('Others', 'Others')], max_length=255)),
71+
('contact', models.CharField(max_length=16, validators=[django.core.validators.RegexValidator(regex='^\\+?1?\\d{8,15}$')])),
72+
('avatar', models.ImageField(default='default.png', upload_to='profile_pics')),
73+
('signup_confirmation', models.BooleanField(default=False)),
74+
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
75+
],
76+
),
77+
migrations.CreateModel(
78+
name='Lead',
79+
fields=[
80+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
81+
('first_name', models.CharField(max_length=200)),
82+
('last_name', models.CharField(max_length=200)),
83+
('age', models.IntegerField(default=0)),
84+
('email', models.EmailField(max_length=254)),
85+
('description', models.TextField(max_length=255)),
86+
('contact', models.CharField(max_length=16, validators=[django.core.validators.RegexValidator(regex='^\\+?1?\\d{8,15}$')])),
87+
('date_created', models.DateField(auto_now_add=True)),
88+
('agent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='lead.agent')),
89+
('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='lead.category')),
90+
('organisation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='lead.profile')),
91+
],
92+
options={
93+
'ordering': ['-id'],
94+
},
95+
),
96+
migrations.AddField(
97+
model_name='category',
98+
name='organisation',
99+
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='lead.profile'),
100+
),
101+
migrations.AddField(
102+
model_name='agent',
103+
name='organisation',
104+
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='lead.profile'),
105+
),
106+
migrations.AddField(
107+
model_name='agent',
108+
name='user',
109+
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
110+
),
111+
]

0 commit comments

Comments
 (0)