Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 March 10, 2008 00:23:52

Brandon T.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Admin recipes anyone?


Hello,

I'm in my 2nd day of using Django, and there are a couple of things
I'd like to do, in regards to adding functionality to the outstanding
admin interface. These are age-old topics I'm sure, so I thought I'd
consult the community for best practices.

First, I will need to build order-able lists. Typically I've just
added a "position" column, and then implemented a flavor of drag-n-
drop to change the order, either through script.aculo.us or jQuery,
firing an Ajax call to do the ordering.

Second, sometimes I don't want to show all of the properties in the
model via the admin, like the "position" column.

I found the Django Snippets website, but I don't see a recipe for the
aforementioned tasks. I'm very impressed with Django so far. I've had
to write a paltry amount of code to accomplish a great deal. Even less
than Rails, which, till now, I didn't think could happen.

So, if anyone could give me some pointers on extending the admin, I
would be very grateful!

Kind regards,
Brandon Taylor
--~--~---------~--~----~------------~-------~--~----~
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
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

#2 March 10, 2008 10:45:24

David R.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Admin recipes anyone?


On 9 Mar 2008, at 11:23 pm, Brandon Taylor wrote:

>
> Hello,
>
> I'm in my 2nd day of using Django, and there are a couple of things
> I'd like to do, in regards to adding functionality to the outstanding
> admin interface. These are age-old topics I'm sure, so I thought I'd
> consult the community for best practices.
>
> First, I will need to build order-able lists. Typically I've just
> added a "position" column, and then implemented a flavor of drag-n-
> drop to change the order, either through script.aculo.us or jQuery,
> firing an Ajax call to do the ordering.
>
> Second, sometimes I don't want to show all of the properties in the
> model via the admin, like the "position" column.
>
> I found the Django Snippets website, but I don't see a recipe for the
> aforementioned tasks. I'm very impressed with Django so far. I've had
> to write a paltry amount of code to accomplish a great deal. Even less
> than Rails, which, till now, I didn't think could happen.
>
> So, if anyone could give me some pointers on extending the admin, I
> would be very grateful!

Brandon,

Whilst there are hacky, workaround kind of ways of doing this with
the admin system as it currently is, I suspect if wait until newforms-
admin hits trunk, it'll be a hell of a lot easier to do any admin
customisation you need to do.


--
David Reynolds




--~--~---------~--~----~------------~-------~--~----~
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
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

#3 March 10, 2008 14:19:27

[EMAIL P.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Admin recipes anyone?


On Mar 10, 9:44 am, David Reynolds <>
wrote:
> On 9 Mar 2008, at 11:23 pm, Brandon Taylor wrote:
>
> > I'm in my 2nd day of using Django, and there are a couple of things
> > I'd like to do, in regards to adding functionality to the outstanding
> > admin interface. These are age-old topics I'm sure, so I thought I'd
> > consult the community for best practices.
>
> > First, I will need to build order-able lists. Typically I've just
> > added a "position" column, and then implemented a flavor of drag-n-
> > drop to change the order, either through script.aculo.us or jQuery,
> > firing an Ajax call to do the ordering.
>
> > Second, sometimes I don't want to show all of the properties in the
> > model via the admin, like the "position" column.
>
> > I found the Django Snippets website, but I don't see a recipe for the
> > aforementioned tasks. I'm very impressed with Django so far. I've had
> > to write a paltry amount of code to accomplish a great deal. Even less
> > than Rails, which, till now, I didn't think could happen.
>
> > So, if anyone could give me some pointers on extending the admin, I
> > would be very grateful!
>
> Brandon,
>
> Whilst there are hacky, workaround kind of ways of doing this with
> the admin system as it currently is, I suspect if wait until newforms-
> admin hits trunk, it'll be a hell of a lot easier to do any admin
> customisation you need to do.

Seeing as how you're only on your second day I would recommend
switching to newforms-admin.

This would then allow you to use some of the helpful tips written by
the super-coder who cobbled together this page:http://code.djangoproject.com/wiki/NewformsHOWTOYour second request (hiding the position field) would be fulfilled by
this answer:http://code.djangoproject.com/wiki/NewformsHOWTO#Q:HowdoIuseupdated_atandcreated_ontypefieldsbutstopthembeingdisplayedRegards,

Felix
--~--~---------~--~----~------------~-------~--~----~
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
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

Board footer

Moderator control

Enjoy the 11th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support