Re: How to return Admin to previous filters after save?

2008-12-02 Thread cyberjack

Thanks, that's good to know.

-Josh



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How to return Admin to previous filters after save?

2008-12-01 Thread Malcolm Tredinnick


On Mon, 2008-12-01 at 14:54 -0800, cyberjack wrote:
> I have an admin interface managing a few thousand records. Finding a
> record requires heavy use of multiple list_filter selections. However,
> once a user edits a record, the admin interface redirects to the root
> admin URL and loses the filter state.
> 
> Is there an easy way to have the admin editor return to the calling
> URL after a form submit?

Yes there is: wait until Django 1.1 is released. It's item "Admin-08" in
http://code.djangoproject.com/wiki/Version1.1Features .


Regards,
Malcolm



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



How to return Admin to previous filters after save?

2008-12-01 Thread cyberjack

I have an admin interface managing a few thousand records. Finding a
record requires heavy use of multiple list_filter selections. However,
once a user edits a record, the admin interface redirects to the root
admin URL and loses the filter state.

Is there an easy way to have the admin editor return to the calling
URL after a form submit?

 Ie, I'd like the Admin tool to redirect to
   /admin/app/?is_active__exact=0__exact=A__exact=B
instead of
  /admin/app/?

As a work-around, I have my users bookmark common filter
configurations, but it's still pretty frustrating. I feel like there
must be some way to customize the Admin save function, but I don't
know where to start.

Thanks,

-Josh
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How to return Admin to previous filters after save?

2008-02-20 Thread Nathaniel Whiteinge

On Feb 19, 7:08 pm, cyberjack <[EMAIL PROTECTED]> wrote:
> Thanks for the suggestion, but there has got to be a simple way to
> solve this problem. Does anyone else have an idea for solving this
> problem?

It's just a regular Django view that's doing the work here. Take a
look at the `change_stage` view [1] -- lines 355 to 369 in particular
-- you'll see the redirects are hard-coded. All the simple solutions
will be workarounds because of that.

.. [1] 
http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/views/main.py?rev=6991#L310

A complex solution would be to make a copy of that view somewhere,
modify it to suit your needs, and point at your version with an
URLconf that has higher precedence than your Admin URLconf (since
Django stops at the first matching pattern). I can't guess about many
potential pitfalls here, but it looks like it could be fairly
straightforward if you get all your imports right.


> Baring that, is there a way I can diff the the newforms-admin and see
> what's changed?
> Maybe I can figure out how the do the URL redirection if it's included
> in the new branch.

I misspoke by suggesting newforms-admin; I don't know for sure that
this is possible. It is far more flexible than the current Admin, so I
have high hopes, and other people also want this same functionality
[2].

.. [2] http://code.djangoproject.com/ticket/6002


- whiteinge
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How to return Admin to previous filters after save?

2008-02-14 Thread Nathaniel Whiteinge

Another workaround: I used JavaScript to open links on the change_list
page in a pop-up window (helps to append `?_popup=1` to the URL). It's
not perfect (you have to refresh the change_list page to see your
changes), but it keeps all your filtering intact.

I believe redirecting to an URL of your choosing is (or will be)
possible with the newforms-admin branch.

- whiteinge
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How to return Admin to previous filters after save?

2008-02-14 Thread cyberjack

> Not a solution but a workaround. I had exactly the same problem as a user, I 
> solved it by bookmarking the right url.

 I've recommended this to our users, but it's a real pain. Each user
is pretty active, so there is a lot of (load-bookmark, make edit, load-
bookmark, repeat) annoyance.

 Does anyone know how to have the admin page redirect to
HTTP_REFERER?

Thanks,

-Josh


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How to return Admin to previous filters after save?

2008-02-14 Thread yml

Not a solution but a workaround.
I had exactly the same problem as a user, I solved it by bookmarking
the right url.

--yml

On 14 fév, 03:50, cyberjack <[EMAIL PROTECTED]> wrote:
> I have an admin interface managing a few thousand records. Finding a
> record requires heavy use of multiple list_filter selections. However,
> once a user edits a record, the admin interface redirects to the root
> admin URL and loses the filter state.
>
> Is there an easy way to have the admin editor return to the calling
> URL after a form submit?
>
>  Ie, I'd like the Admin tool to redirect to
>/admin/foo/?is_active__exact=0__exact=A__exact=B
> instead of
>   /admin/foo/?
>
> Thanks,
>
> -Josh
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



How to return Admin to previous filters after save?

2008-02-13 Thread cyberjack

I have an admin interface managing a few thousand records. Finding a
record requires heavy use of multiple list_filter selections. However,
once a user edits a record, the admin interface redirects to the root
admin URL and loses the filter state.

Is there an easy way to have the admin editor return to the calling
URL after a form submit?

 Ie, I'd like the Admin tool to redirect to
   /admin/foo/?is_active__exact=0__exact=A__exact=B
instead of
  /admin/foo/?

Thanks,

-Josh
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---