Hi all,
I'm very impressed with 0.90. Works great!
>From the last two weeks (during which I managed to port my access
database, complete with interface - yeah!), I have 3 suggestions wrt
the admin interface:
1) It wasn't obvious how to use the search_fields option with
ForeignKeys. I figured it out eventually, but I guess I missed the
point at the end of the first tutorial (e.g. poll__pub_date__year). You
might want to highlight that in the tutorial a bit more.
2) Adding this gives a lot of flexibility to the admin interface.
(Sorry for the format - I can't get svn diff to work so I'm guessing):
Index: contrib/admin/views/main.py
===================================================================
--- contrib/admin/views/main.py (revision 1350)
+++ contrib/admin/views/main.py (working copy)
@@ -803,5 +803,5 @@
                return HttpResponseRedirect(request.path)
            else:
                request.user.add_message(msg)
-                return HttpResponseRedirect(post_url)
+                return HttpResponseRedirect(post_url % pk_value)
        if request.POST.has_key("_preview"):

Then you can easily override even using the admin interface, by putting
overrides in the urls.py file above the 'admin' entry and with a
'post_url' dictionary item:
    (r'^addnews/$', 'django.contrib.admin.views.main.add_stage', \
            {'app_label':'news', 'module_name':'mynews', 'post_url':
'/editrefs/%s/'}),


3) This one maybe isn't such a useful feature, but it made things easy
for me (again I'm guessing on the svn diff format):
Index: core/meta/__init__.py
===================================================================
--- core/meta/__init__.py       (revision 1350)
+++ core/meta/__init__.py       (working copy)
@@ -818,4 +818,7 @@
    db.db.commit()
    # Run any post-add hooks.
    if hasattr(self, '_post_add'):
        self._post_add()
    # Run any post-save hooks.
    if hasattr(self, '_post_save'):
        self._post_save()

And again pretty harmless. I used it to insert new records which
referred to the one I just saved, and didn't have to worry about
getting the last key or anything. Then they were redirected from the
previous 'post_url' %s change.

Hope this helps, and thanks for the great work,
 -rob

Reply via email to