23 Jul 2015
I was writing a simple Django view. That view collected data from user request. During the testing I found a problem: data was collecting twice.
I tested my view by copy-pasting url to address bar of Google Chrome. And before I hit “Enter” request apeared in server log.
I have also tested in Firefox and Opera - extra requests did not appear.
The best solution is to avoid changing application state in GET requests. More info at StackExchange
21 Jul 2015
It was pretty easy to add an inline for many-to-many model relationship Django admin, like it was mentioned in the Django documentation.
The trick is that line in
But what wasn’t unclear to me is why there is no add/edit buttons on inline items in the Django admin interface, so I couldn’t add or edit any of related model’s objects.
admin.py (before fix):
My mistake was that I didn’t register related model
admin.py. After adding
admin.site.register(OfferGeo) add/edit buttons appeared.
admin.py looks like this:
Hope this helps someone else.