33 lines
1.9 KiB
Python
33 lines
1.9 KiB
Python
|
|
# Generated by Django 5.0.3 on 2024-03-25 10:04
|
||
|
|
|
||
|
|
import django.db.models.deletion
|
||
|
|
import moku.models.post
|
||
|
|
import moku.validators
|
||
|
|
import shortuuid.django_fields
|
||
|
|
from django.conf import settings
|
||
|
|
from django.db import migrations, models
|
||
|
|
|
||
|
|
|
||
|
|
class Migration(migrations.Migration):
|
||
|
|
|
||
|
|
dependencies = [
|
||
|
|
('moku', '0001_initial'),
|
||
|
|
]
|
||
|
|
|
||
|
|
operations = [
|
||
|
|
migrations.CreateModel(
|
||
|
|
name='Post',
|
||
|
|
fields=[
|
||
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||
|
|
('uuid', shortuuid.django_fields.ShortUUIDField(alphabet=None, help_text='the unique id that identifies this post.', length=22, max_length=22, prefix='', verbose_name='unique id')),
|
||
|
|
('emoji', models.CharField(help_text='an emoji to accompany your post!', max_length=8, validators=[moku.validators.validate_emoji], verbose_name='emoji')),
|
||
|
|
('verb', models.CharField(choices=[('ate', '%(user)s ate %(food)s'), ('made', '%(user)s made %(food)s'), ('cooked', '%(user)s cooked %(food)s'), ('baked', '%(user)s baked %(food)s'), ('ordered', '%(user)s ordered %(food)s')], help_text='how should we best phrase this entry?', max_length=32, verbose_name='verb')),
|
||
|
|
('food', models.CharField(help_text='what did you eat?', max_length=128, verbose_name='food')),
|
||
|
|
('image', models.ImageField(blank=True, help_text='here you can upload a picture of what you ate!', upload_to=moku.models.post.post_image_filename, verbose_name='image')),
|
||
|
|
('created_at', models.DateTimeField(auto_now_add=True, help_text='when this post was created.')),
|
||
|
|
('updated_at', models.DateTimeField(auto_now=True, help_text='when this post was last updated.')),
|
||
|
|
('created_by', models.ForeignKey(db_column='created_by_user_id', on_delete=django.db.models.deletion.CASCADE, related_name='posts', to=settings.AUTH_USER_MODEL)),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
]
|