Add upload form and update Photo model
This commit is contained in:
parent
c43f3612e3
commit
555c6c0d89
5 changed files with 211 additions and 38 deletions
|
@ -1,4 +1,4 @@
|
|||
# Generated by Django 5.1.4 on 2025-01-20 19:09
|
||||
# Generated by Django 5.1.4 on 2025-02-23 15:54
|
||||
|
||||
import datetime
|
||||
import django.db.models.deletion
|
||||
|
@ -33,7 +33,8 @@ class Migration(migrations.Migration):
|
|||
],
|
||||
options={
|
||||
'verbose_name_plural': 'Locations',
|
||||
'unique_together': {('city', 'place')},
|
||||
'ordering': ['city'],
|
||||
'unique_together': {('place', 'city')},
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
|
@ -56,7 +57,7 @@ class Migration(migrations.Migration):
|
|||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('slug', models.CharField(editable=False, max_length=15, verbose_name='Photo Slug')),
|
||||
('photo', models.ImageField(height_field='height', upload_to=gallery.models.photo.Photo._get_upload_path, verbose_name='Photo', width_field='width')),
|
||||
('photo', models.ImageField(height_field='height', upload_to=gallery.models.photo.get_upload_path, verbose_name='Photo', width_field='width')),
|
||||
('width', models.PositiveIntegerField(default=0, editable=False, verbose_name='Photo Width')),
|
||||
('height', models.PositiveIntegerField(default=0, editable=False, verbose_name='Photo Height')),
|
||||
('taken_at', models.DateTimeField(blank=True, editable=False, null=True, verbose_name='Taken at')),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue