Skip to content

Commit

Permalink
refactor: django project structure (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
moonlitgrace authored Dec 6, 2024
1 parent 45f43ac commit ae53828
Show file tree
Hide file tree
Showing 42 changed files with 156 additions and 676 deletions.
3 changes: 1 addition & 2 deletions backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ __pycache__/
local_settings.py
db.sqlite3
db.sqlite3-journal
# ignore all files inside media (not folders)
# media
media/**/*
!media/**/*.gitkeep
!media/.gitkeep
# Generated graphs
graph_*.png
# # Ignore all files in migrations folders
Expand Down
75 changes: 48 additions & 27 deletions backend/apps/quiblet/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,56 @@
# Generated by Django 5.1.3 on 2024-12-01 17:12
# Generated by Django 5.1.3 on 2024-12-06 15:53

import dynamic_filenames
import shortuuid.django_fields
from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
('user', '0001_initial'),
]
dependencies = []

operations = [
migrations.CreateModel(
name='Quiblet',
name='Quib',
fields=[
(
'created_at',
models.DateTimeField(auto_now_add=True, verbose_name='create at'),
),
('is_public', models.BooleanField(default=True, verbose_name='is public')),
(
'id',
models.BigAutoField(
auto_created=True,
shortuuid.django_fields.ShortUUIDField(
alphabet='abcdefghijklmnopqrstuvwxyz0123456789',
editable=False,
length=7,
max_length=7,
prefix='',
primary_key=True,
serialize=False,
verbose_name='ID',
verbose_name='id',
),
),
('title', models.CharField(max_length=255, verbose_name='title')),
(
'slug',
models.SlugField(
blank=True, editable=False, max_length=25, verbose_name='slug'
),
),
('content', models.TextField(verbose_name='content')),
],
options={
'verbose_name': 'Quib',
'verbose_name_plural': 'Quibs',
'ordering': ['-created_at'],
},
),
migrations.CreateModel(
name='Quiblet',
fields=[
(
'created_at',
models.DateTimeField(auto_now_add=True, verbose_name='create at'),
Expand All @@ -40,6 +66,20 @@ class Migration(migrations.Migration):
verbose_name='avatar',
),
),
('is_public', models.BooleanField(default=True, verbose_name='is public')),
(
'id',
shortuuid.django_fields.ShortUUIDField(
alphabet='abcdefghijklmnopqrstuvwxyz0123456789',
editable=False,
length=7,
max_length=7,
prefix='',
primary_key=True,
serialize=False,
verbose_name='id',
),
),
('name', models.CharField(max_length=25, unique=True, verbose_name='name')),
('description', models.TextField(verbose_name='description')),
(
Expand All @@ -53,25 +93,6 @@ class Migration(migrations.Migration):
verbose_name='cover',
),
),
('is_public', models.BooleanField(default=True, verbose_name='is public')),
(
'members',
models.ManyToManyField(
blank=True,
related_name='quiblets',
to='user.profile',
verbose_name='members',
),
),
(
'rangers',
models.ManyToManyField(
blank=True,
related_name='ranged_quiblets',
to='user.profile',
verbose_name='rangers',
),
),
],
options={
'verbose_name': 'Quiblet',
Expand Down
24 changes: 0 additions & 24 deletions backend/apps/quiblet/migrations/0002_alter_quiblet_members.py

This file was deleted.

85 changes: 85 additions & 0 deletions backend/apps/quiblet/migrations/0002_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Generated by Django 5.1.3 on 2024-12-06 15:53

import django.db.models.deletion
import django.db.models.functions.text
from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
('quiblet', '0001_initial'),
('user', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='quib',
name='dislikes',
field=models.ManyToManyField(
blank=True,
related_name='disliked_quibs',
to='user.profile',
verbose_name='dislikes',
),
),
migrations.AddField(
model_name='quib',
name='likes',
field=models.ManyToManyField(
blank=True,
related_name='liked_quibs',
to='user.profile',
verbose_name='likes',
),
),
migrations.AddField(
model_name='quib',
name='quibber',
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name='quibs',
to='user.profile',
verbose_name='quibber',
),
),
migrations.AddField(
model_name='quiblet',
name='members',
field=models.ManyToManyField(
blank=True,
related_name='joined_quiblets',
to='user.profile',
verbose_name='members',
),
),
migrations.AddField(
model_name='quiblet',
name='rangers',
field=models.ManyToManyField(
blank=True,
related_name='ranged_quiblets',
to='user.profile',
verbose_name='rangers',
),
),
migrations.AddField(
model_name='quib',
name='quiblet',
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name='quibs',
to='quiblet.quiblet',
verbose_name='quiblet',
),
),
migrations.AddConstraint(
model_name='quiblet',
constraint=models.UniqueConstraint(
django.db.models.functions.text.Lower('name'),
name='unique_quiblet_name_case_insensitive',
),
),
]

This file was deleted.

77 changes: 0 additions & 77 deletions backend/apps/quiblet/migrations/0004_quib.py

This file was deleted.

This file was deleted.

Loading

0 comments on commit ae53828

Please sign in to comment.