Login

Save Redirect

Author:
dronestudios
Posted:
August 4, 2010
Language:
Python
Version:
1.2
Score:
0 (after 0 ratings)

Works on saving an already existing entry (updating) but not on saving a new one.

1
2
3
4
5
def change_view(self, request, object_id, extra_context=None):
    result = super(TodoAdmin, self).change_view(request, object_id, extra_context)
        if not request.POST.has_key('_addanother') and not request.POST.has_key('_continue'):
        result['Location'] = "/"
    return result

More like this

  1. New Snippet! by Antoliny0919 4 days, 23 hours ago
  2. Add Toggle Switch Widget to Django Forms by OgliariNatan 2 months, 3 weeks ago
  3. get_object_or_none by azwdevops 6 months, 2 weeks ago
  4. Mask sensitive data from logger by agusmakmun 8 months, 1 week ago
  5. Template tag - list punctuation for a list of items by shapiromatron 1 year, 10 months ago

Comments

Please login first before commenting.