sc3 / django-townsquare

Python-Django port of Townsquare project found at https://github.com/sc3/townsquare
2 stars 5 forks source link

addevent form processing won't create more than one event #78

Open bepetersn opened 10 years ago

bepetersn commented 10 years ago

The logic required to make this work is already contained in the addvolunteer form.

However, the admin interface has this functionality already, and this can be copied to create the desired situation. Basically, you need to do a try-except, and inside of that do Event.objects.get() to check if the event already exists. The check for existence is necessarily a check for equality, and this can be based on time, date, and type all together...

On that note, it might be worth checking django docs to see if there is an idiom for defining the behavior of the equality operation for a model instance.

bepetersn commented 10 years ago

updated this issue for you, @mmisery