diff --git a/ofu_app/apps/food/migrations/0003_auto_20171013_1902.py b/ofu_app/apps/food/migrations/0003_auto_20171013_1902.py new file mode 100644 index 0000000..f180b9f --- /dev/null +++ b/ofu_app/apps/food/migrations/0003_auto_20171013_1902.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.2 on 2017-10-13 17:02 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('food', '0002_auto_20171008_1102'), + ] + + operations = [ + migrations.AlterUniqueTogether( + name='happyhour', + unique_together=set([('date', 'location', 'starttime', 'endtime')]), + ), + ] diff --git a/ofu_app/apps/food/models.py b/ofu_app/apps/food/models.py index c5d1d80..1172710 100644 --- a/ofu_app/apps/food/models.py +++ b/ofu_app/apps/food/models.py @@ -37,7 +37,7 @@ class HappyHour(models.Model): description = models.CharField(max_length=MAX_LENGTH) class Meta: - unique_together = ('date', 'location') + unique_together = ('date', 'location', 'starttime', 'endtime') def __str__(self): return "Date: %s, Location: %s" % (self.date.strftime("%Y.%m.%d"), self.location) diff --git a/ofu_app/apps/food/utils/migrate_data.py b/ofu_app/apps/food/utils/migrate_data.py index 68d5f7c..c936096 100644 --- a/ofu_app/apps/food/utils/migrate_data.py +++ b/ofu_app/apps/food/utils/migrate_data.py @@ -54,6 +54,9 @@ def writeFekideDataInDB(data): happyhour.endtime = datetime.strptime(time[1], "%H:%M").time() happyhour.save() + print("%s: Happy Hour: Location: %s, Description: %s" % ( + str(happyhour.date.date()), str(happyhour.location), str(happyhour.description))) + def writeoutDBObjects(): pprint("SingleFood: " + str(SingleFood.objects.count())) @@ -65,7 +68,8 @@ def delete(): happy_hours = HappyHour.objects.all() print("Deleted following Happy Hours:") for happy_hour in happy_hours: - print("Happy Hour: Location: %s, Description: %s" % (str(happy_hour.location), str(happy_hour.description))) + print("%s: Happy Hour: Location: %s, Description: %s" % ( + str(happy_hour.date), str(happy_hour.location), str(happy_hour.description))) happy_hour.delete() diff --git a/ofu_app/templates/base.jinja b/ofu_app/templates/base.jinja index 30a858d..15932fb 100644 --- a/ofu_app/templates/base.jinja +++ b/ofu_app/templates/base.jinja @@ -10,6 +10,7 @@ {# {% javascript "main_js" %}#} {# {% block js_head %}{% endblock %}#} + {% block head_extra_first %}{% endblock %} {% block head_extra %}{% endblock %} diff --git a/ofu_app/templates/donar/show_room.jinja b/ofu_app/templates/donar/show_room.jinja index 7ef6954..39367cf 100644 --- a/ofu_app/templates/donar/show_room.jinja +++ b/ofu_app/templates/donar/show_room.jinja @@ -1,8 +1,28 @@ {% extends 'base.jinja' %} +{% block head_extra_first %} + + + +{% endblock %} {% block headline %}

Donar

{% endblock %} {% block content %} + {# TODO: implement Leaflet #} + {#
#} + {# #}
{% if room %}