diff --git a/whats-open/api/admin.py b/whats-open/api/admin.py index d49972fd02e36451bc3a3ba3235ca55f5c2a8045..a9cc5cb6544d8100bd6765fb3d288fbe10df2d3a 100644 --- a/whats-open/api/admin.py +++ b/whats-open/api/admin.py @@ -145,19 +145,24 @@ class FacilityAdmin(admin.ModelAdmin): return initial_data -class OpenTimeInline(admin.StackedInline): +class OpenTimeInline(admin.TabularInline): """ A table of time periods that represent an "open time" for a Facility. https://docs.djangoproject.com/en/1.11/ref/contrib/admin/#django.contrib.admin.TabularInline """ - # Columns correspond to each attribute in the OpenTime table model = OpenTime - extra = 1 + # 7 days of the week, so only have 7 rows + extra = 7 # We are basically reordering things to look nicer to the user here fieldsets = ( - (None, {"fields": (("start_day", "start_time"), ("end_day", "end_time"))}), + (None, { + 'fields': ( + ('start_day', 'start_time'), + ('end_day', 'end_time') + ), + }), ) diff --git a/whats-open/api/migrations/0006_auto_20190219_1729.py b/whats-open/api/migrations/0006_auto_20190219_1729.py new file mode 100644 index 0000000000000000000000000000000000000000..21298ace236239b4aa690bdd8b9cf5b91a4b8311 --- /dev/null +++ b/whats-open/api/migrations/0006_auto_20190219_1729.py @@ -0,0 +1,18 @@ +# Generated by Django 2.0.10 on 2019-02-19 22:29 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0005_auto_20190129_1215'), + ] + + operations = [ + migrations.AlterField( + model_name='alert', + name='url', + field=models.URLField(blank=True, verbose_name='Reference URL'), + ), + ] diff --git a/whats-open/api/models.py b/whats-open/api/models.py index 8d1b3e374cae840b3521362d2e84a817d9b6aa27..bfdfcece2c23fd5842ed7798942db778e214aa99 100644 --- a/whats-open/api/models.py +++ b/whats-open/api/models.py @@ -423,7 +423,7 @@ class Alert(TimeStampedModel): # The text that is displayed that describes the Alert subject = models.CharField(max_length=130) body = models.TextField() - url = models.URLField("Reference URL", max_length=200) + url = models.URLField("Reference URL", max_length=200, blank=True) # The date + time that the alert will be start being served start_datetime = models.DateTimeField()