From e2d98d9962f62985d88105fae4abd609c8b9b798 Mon Sep 17 00:00:00 2001 From: Martin Bauer Date: Sun, 30 Jun 2013 16:55:00 +0200 Subject: [PATCH] Eventplanner - cleaned up urls - permissions --- blechreiz/database.sqlite | Bin 54272 -> 47104 bytes blechreiz/settings.py | 2 +- blechreiz/urls.py | 18 +--- eventplanner/admin.py | 2 +- eventplanner/locale/de/LC_MESSAGES/django.po | 80 +++++++++++------- eventplanner/models.py | 30 +++++-- eventplanner/templates/custom_tabular.html | 78 +++++++++++++++++ .../eventplanner/eventplanning_view.html | 4 +- .../templates/eventplanner/events_grid.html | 20 ++++- eventplanner/tests.py | 16 ---- eventplanner/views.py | 74 ++++++++++------ musicians/models.py | 8 ++ planning.txt | 40 +++++++++ 13 files changed, 271 insertions(+), 101 deletions(-) create mode 100644 eventplanner/templates/custom_tabular.html delete mode 100644 eventplanner/tests.py create mode 100644 planning.txt diff --git a/blechreiz/database.sqlite b/blechreiz/database.sqlite index bb838bb0aaab331fd396657eb011c44bf50e37f4..7763ca4f371e8de57aebbc6f5a04c6b129abba72 100644 GIT binary patch delta 4629 zcmdT|YjjlA6~5>0JC8eL@`NOlWHOhK5CUYFd*_vjFNOp$zyyjxgw-16aWgZ?yqE_e zDP#!J)&9cbv1^&)YgJwJhq{395TVtIT}xZFQgvCah*qr+RK$h4RBC(fxic|AtNq)_ zV()X$-DjWg?DO4o_GagAVdux}FY79q+Zcwil7GdYY42i5>23eVd=2T-!5QVv;)AIa zl(aOGW}}ISx;gj*upj}KaIN_h%w8tU^eA@IehnrK(~2xz{)FHUg#>x4oXGN|)lXXs zYBh`T~;)X;Za^X-6%^DT^NT z%B;nQ$+MgVc#FwEpjuE2>-3AOe5{+D%T}PT(K+-idI-hPp2>=m`Dnph4s{`eI!%8v z8RGYQ4sBX|2sIJ%YRM%1Am0y!4Y^6 z?uR?!R|M7|fyMC%)l}*@q<||`b)!+$<`Pvm%u;o|LDhA zco#k;cwdF45-_8pC2N3szF?_%Meqd!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@q{Rv%O+(WLsc0W}hVyq19r zL4o&y|H5!E;?{lpsUG~+l~>*eE3f6M@2#i1>50dM)KO4xiH7*a$VZ5njo7 z@VF=h!u37y&e+3RbT?1t^NX8-`Nd>zekQpYo0-cbghU`wPv(;|$&L6%icc=iZYS!w zjpV(A6kptwk{jub_{{xiw7_pi?_`!{bCFDXd7-#0F4dFE*VhvHxeZxZswJ<^PA}cb zZOZw%T2ctt5<;YwzIwfs$V!y{X8thUUR=M=^QqA0PBojABlnehCY_SSt&$WI5@KR8;g4;s zKZxg(`FMSOJD!gT@tI5}ekHLJt6vi#PDn1kl#N}9)qzfoZM=y$+tT{2C>+aTJeLyV zrBy*%OD<;~$jjHI)a|94(W~ao*sfhj#y^5#55IvobnM%e*$BL$2s|9[\w]+)$', user_edit ), @@ -32,10 +26,4 @@ urlpatterns = patterns('', url(r'^website/$', website.views.home_view), url(r'^login/$', website.views.login_view), url(r'^logout/$', website.views.logout_view), - url(r'^events/$', eventplanner.views.eventplanning_view), - url(r'^eventParticipation/$', eventplanner.views.event_participation_detail ), - url(r'^eventParticipation/(\w+)/$', eventplanner.views.event_participation_detail ), - url(r'^eventParticipation/(\w+)/(\d+)$', eventplanner.views.event_participation_detail ), - url(r'^events/grid$', eventplanner.views.events_grid ), - url(r'^events/(?P\d+)$', eventplanner.views.EventUpdate.as_view() ), ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) \ No newline at end of file diff --git a/eventplanner/admin.py b/eventplanner/admin.py index d5e4562..edab05c 100644 --- a/eventplanner/admin.py +++ b/eventplanner/admin.py @@ -10,7 +10,7 @@ class EventParticipationInline(admin.TabularInline): has_add_permission = lambda self, req : False has_delete_permission = lambda self, req, obj : False - template = "custom_tabular.html" + template = "custom_tabular.html" class EventAdmin(admin.ModelAdmin): diff --git a/eventplanner/locale/de/LC_MESSAGES/django.po b/eventplanner/locale/de/LC_MESSAGES/django.po index 3808a99..10e733f 100644 --- a/eventplanner/locale/de/LC_MESSAGES/django.po +++ b/eventplanner/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-06-30 10:55+0200\n" +"POT-Creation-Date: 2013-06-30 16:20+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,18 +18,22 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: models.py:11 +#: models.py:10 msgid "Rehearsal" msgstr "Probe" -#: models.py:12 +#: models.py:11 msgid "Concert" msgstr "Konzert" -#: models.py:13 +#: models.py:12 msgid "General Rehearsal" msgstr "Generalprobe" +#: models.py:13 +msgid "Party" +msgstr "Feier" + #: models.py:16 msgid "title" msgstr "Titel" @@ -39,52 +43,70 @@ msgid "type" msgstr "Typ" #: models.py:18 -msgid "date" -msgstr "Datum" - -#: models.py:19 -msgid "time" -msgstr "Uhrzeit" - -#: models.py:20 -msgid "participants" -msgstr "Teilnehmer" - -#: models.py:22 -msgid "description" -msgstr "Beschreibung" - -#: models.py:23 msgid "location" msgstr "Ort" -#: models.py:44 +#: models.py:19 +msgid "description" +msgstr "Beschreibung" + +#: models.py:21 +msgid "date" +msgstr "Datum" + +#: models.py:22 +msgid "time" +msgstr "Uhrzeit" + +#: models.py:23 +msgid "meeting_time" +msgstr "" + +#: models.py:25 +msgid "participants" +msgstr "Teilnehmer" + +#: models.py:45 msgid "?" msgstr "" -#: models.py:45 +#: models.py:46 msgid "Yes" msgstr "Ja" -#: models.py:46 +#: models.py:47 msgid "No" msgstr "Nein" -#: models.py:49 +#: models.py:50 msgid "event" msgstr "Termin" -#: models.py:50 +#: models.py:51 msgid "musician" msgstr "Musiker" -#: models.py:51 +#: models.py:52 msgid "status" msgstr "Status" -#: models.py:52 +#: models.py:53 msgid "comment" msgstr "Kommentar" -#~ msgid "Delete?" -#~ msgstr "Löschen" +#: models.py:72 +msgid "Can modify participation status of other users" +msgstr "" + +#: templates/custom_tabular.html:17 +msgid "Delete?" +msgstr "Löschen" + +#: templates/custom_tabular.html:74 +#, python-format +msgid "Add another %(verbose_name)s" +msgstr "" + +#: templates/custom_tabular.html:75 +msgid "Remove" +msgstr "" diff --git a/eventplanner/models.py b/eventplanner/models.py index 12626bd..155c6b3 100644 --- a/eventplanner/models.py +++ b/eventplanner/models.py @@ -1,6 +1,5 @@ from django.db import models from django.utils.translation import ugettext as _ -from locpick.field import LocationField from musicians.models import Musician @@ -10,19 +9,21 @@ class Event ( models.Model ): EVENT_TYPES = ( ( 'Reh', _('Rehearsal') ), ( 'Conc', _('Concert') ), - ( 'GenReh', _('General Rehearsal') ), + ( 'GenReh', _('General Rehearsal') ), + ( 'Party', _('Party') ), ) title = models.CharField( max_length=40, verbose_name = _("title") ) - type = models.CharField( max_length=6, choices=EVENT_TYPES, default='Reh', verbose_name= _("type") ) + type = models.CharField( max_length=6, choices=EVENT_TYPES, default='Reh', verbose_name= _("type") ) + location = models.TextField( blank=False, verbose_name=_("location") ) + desc = models.TextField( blank=True, verbose_name=_("description")) + date = models.DateField( verbose_name= _("date") ) time = models.TimeField( null=True, blank=True, verbose_name = _("time") ) + meeting_time = models.TimeField( null=True, blank=True, verbose_name = _("meeting_time") ) + participants = models.ManyToManyField( Musician, through='EventParticipation', verbose_name=_("participants") ) - desc = models.TextField( blank=True, verbose_name=_("description")) - location = LocationField( verbose_name=_("location") ) - - def __unicode__(self): return self.title + " ( " + self.get_type_display() + " ) " @@ -51,10 +52,25 @@ class EventParticipation( models.Model ): status = models.CharField ( max_length=3, choices = OPTIONS, default='?', verbose_name=_("status") ) comment = models.CharField ( max_length=64, blank=True, verbose_name=_("comment") ) + def get_musician_username(self): return self.musician.user.username + + + @staticmethod + def get_or_create( musician , event ): + try: + result = EventParticipation.objects.get( event = event, musician = musician ) + except EventParticipation.DoesNotExist: + result = EventParticipation.objects.create( event = event, musician = musician, status='?', comment = '' ) + return result + class Meta: unique_together = ("event", "musician") + permissions = ( + ("change_others_participation", _("Can modify participation status of other users") ), + ) + \ No newline at end of file diff --git a/eventplanner/templates/custom_tabular.html b/eventplanner/templates/custom_tabular.html new file mode 100644 index 0000000..355cc9a --- /dev/null +++ b/eventplanner/templates/custom_tabular.html @@ -0,0 +1,78 @@ +{% load i18n admin_static admin_modify %} +

+ +
+ + diff --git a/eventplanner/templates/eventplanner/eventplanning_view.html b/eventplanner/templates/eventplanner/eventplanning_view.html index a82e4a9..6f5c9a8 100644 --- a/eventplanner/templates/eventplanner/eventplanning_view.html +++ b/eventplanner/templates/eventplanner/eventplanning_view.html @@ -51,7 +51,7 @@ request = $.ajax( { type: "PUT", - url: "/eventParticipation/" + p.data("username") + "/" + p.data("event-id"), + url: "{% url 'event_api' %}", contentType: "application/json", data: JSON.stringify(putObject) }); @@ -73,7 +73,7 @@ $.ajax( { type: "PUT", - url: "/eventParticipation/" + $(this).data("username") + "/" + $(this).data("event-id"), + url: "{% url 'event_api' %}", contentType: "application/json", data: JSON.stringify(putObject) }); diff --git a/eventplanner/templates/eventplanner/events_grid.html b/eventplanner/templates/eventplanner/events_grid.html index ffe486d..44d073c 100644 --- a/eventplanner/templates/eventplanner/events_grid.html +++ b/eventplanner/templates/eventplanner/events_grid.html @@ -29,9 +29,14 @@ {% addtoblock "js" %}