On 07/11/06, Florian Apolloner <[EMAIL PROTECTED]> wrote:
>
> I have a few questions about django, where I didn't found the answer in
> the docu.
>
> Here they are:
>
> 1.) In the admin-area you can use filters ( list_filter = ('is_staff',
> 'is_superuser') ), which show by default all entries. Now I want to
> have the entries prefilterd (let's say i have a boolean field, and want
> all entries with true filtered out).
> Which way is the easiest way to do so?
>
> 2.) Is there a hook or something to execute custom functions, if
> someone clicks save in the admin area?

If you want to do it whenever a new model is created then you do this:

class foo(model):
    ...
    def save(self):
        #anything you want to do before
        model.save(self)
        #anything you want to do after

>
> 3.) Lets assume I have a model with an integerfield position. In the
> admin-area I would like to be able to set this field to something, that
> would get me two arrows (up and down) to change place with the next
> item. Is there a way to do so? (Like a navigation-admin where I want to
> get 'Home' from bottom to top, or 'contact' after 'Forum' and not
> before it....)

I think you'd have to do quite a bit of hacking to get this into the
admin. Personally I've not found any good documentation on this but if
you read the code you should be able to get a grip on what's going on
and imitate it.

>
> I apologize for my bad English.
>
> Kind regards Florian Apolloner
>
>
> >
>


-- 
http://grimboy.co.uk

--~--~---------~--~----~------------~-------~--~----~
 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to