Skip to content

Commit 259c496

Browse files
Track all files except .env
1 parent 65ba66e commit 259c496

36 files changed

+1470
-0
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
.venv
22
.idea
33
Notes
4+
data
5+
__pycache__/
6+
*.py[cod]
7+
*.pyo
8+
*.pyd
9+
*.DS_Store
10+
*.sock
411
.env

account/__init__.py

Whitespace-only changes.

account/apps.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class AccountConfig(AppConfig):
5+
default_auto_field = 'django.db.models.BigAutoField'
6+
name = 'account'

account/migrations/0001_initial.py

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Generated by Django 5.2 on 2025-04-20 09:51
2+
3+
import account.utils
4+
import django.core.validators
5+
import django.db.models.deletion
6+
import django.utils.timezone
7+
import simple_history.models
8+
from django.conf import settings
9+
from django.db import migrations, models
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='UserAccount',
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+
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
27+
('email', models.EmailField(max_length=254, unique=True, verbose_name='email address')),
28+
('username', models.CharField(help_text="User's unique username", max_length=30, unique=True, validators=[django.core.validators.RegexValidator(message='Username can only contain letters, numbers, underscores, or hyphens.', regex='^[\\w-]+$')], verbose_name='username')),
29+
('phone_number', models.CharField(blank=True, max_length=15, null=True, unique=True, validators=[django.core.validators.RegexValidator(message="Phone number must be entered in the format: '+999999999'. Up to 15 digits allowed.", regex='^\\+?1?\\d{9,15}$')], verbose_name='phone number')),
30+
('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
31+
('last_name', models.CharField(blank=True, max_length=30, verbose_name='last name')),
32+
('profile_image', models.ImageField(blank=True, null=True, upload_to='profile_images/', verbose_name='profile image')),
33+
('bio', models.TextField(blank=True, max_length=500, verbose_name='bio')),
34+
('last_login_ip', models.GenericIPAddressField(blank=True, null=True, verbose_name='last login IP')),
35+
('last_login', models.DateTimeField(auto_now=True, verbose_name='last login')),
36+
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
37+
('is_active', models.BooleanField(default=True, verbose_name='active')),
38+
('is_staff', models.BooleanField(default=False, verbose_name='staff status')),
39+
('is_manager', models.BooleanField(default=False, verbose_name='manager status')),
40+
('is_admin', models.BooleanField(default=False, verbose_name='admin status')),
41+
('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')),
42+
('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')),
43+
],
44+
options={
45+
'verbose_name': 'user',
46+
'verbose_name_plural': 'users',
47+
'ordering': ['-pk'],
48+
},
49+
),
50+
migrations.CreateModel(
51+
name='HistoricalProfile',
52+
fields=[
53+
('id', models.BigIntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
54+
('balance', models.DecimalField(decimal_places=2, default=0.0, help_text="User's current balance.", max_digits=10)),
55+
('date_created', models.DateTimeField(blank=True, editable=False)),
56+
('profile_pic', models.TextField(blank=True, help_text="User's profile picture.", max_length=100, null=True)),
57+
('history_id', models.AutoField(primary_key=True, serialize=False)),
58+
('history_date', models.DateTimeField(db_index=True)),
59+
('history_change_reason', models.CharField(max_length=100, null=True)),
60+
('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
61+
('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
62+
('user', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)),
63+
],
64+
options={
65+
'verbose_name': 'historical profile',
66+
'verbose_name_plural': 'historical profiles',
67+
'ordering': ('-history_date', '-history_id'),
68+
'get_latest_by': ('history_date', 'history_id'),
69+
},
70+
bases=(simple_history.models.HistoricalChanges, models.Model),
71+
),
72+
migrations.CreateModel(
73+
name='Profile',
74+
fields=[
75+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
76+
('balance', models.DecimalField(decimal_places=2, default=0.0, help_text="User's current balance.", max_digits=10)),
77+
('date_created', models.DateTimeField(auto_now_add=True)),
78+
('profile_pic', models.ImageField(blank=True, help_text="User's profile picture.", null=True, upload_to=account.utils.profile_upload_to_unique)),
79+
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='profile', to=settings.AUTH_USER_MODEL)),
80+
],
81+
),
82+
]

account/migrations/__init__.py

Whitespace-only changes.

account/tests.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.test import TestCase
2+
3+
# Create your tests here.

0 commit comments

Comments
 (0)