Re: Non-model driven ordering

2005-09-24 Thread Matt
Thanks for the hint. Here's what worked for me: class Toppings: ... class META: admin = meta.Admin(ordering=('_order',)) order_with_respect_to = 'pizza' and now the orderings seem to work. ... but (and there's always a but, huh?) now on an individual topping edit page t

Re: Non-model driven ordering

2005-09-24 Thread Achim Domma
Adrian Holovaty wrote: You're right -- it's a common problem, and there's a solution for it. See the "order_with_respect_to" model parameter. http://www.djangoproject.com/documentation/model_api/ We ought to have a model example page for that...I'll try to get that together. I'm very intere

Re: Non-model driven ordering

2005-09-23 Thread Andreas
> Also trying to go to the toppings list page in the admin I get the > following error: > [..] > FieldDoesNotExist: name=_order I had this problem too. Adrian suggested, as a workaround, adding something like ordering='name' in the meta.admin()-call. See http://groups.google.com/group/django-user

Re: Non-model driven ordering

2005-09-23 Thread Matt
Ok, this is as far as I can go tonight... explicitly adding _order = meta.IntegerField(null=True) to my Topping model makes the admin list page work. But the sql then has 2 _order fields in the create table, and the detail admin form fails with: TemplateSyntaxError: Variables and attribute

Re: Non-model driven ordering

2005-09-23 Thread Matt
Just created a new app from scratch and still no ordering. Was trying with IE earlier, now with Safari and Firefox. Firefox gives me this error: Error: Drag is not defined Source File: http://localhost:8000/media/js/admin/ordering.js Line: 20 Further investigation reveals the problem: http://

Re: Non-model driven ordering

2005-09-23 Thread Adrian Holovaty
On 9/23/05, Matt <[EMAIL PROTECTED]> wrote: > On the pizza admin page I have an inline list of pizza toppings. I get > an Ordering section with a non-editable ordering text box. I also see > some nifty looking boxes on the right-hand side that change color when > I hover over. Unfortunately I c

Re: Non-model driven ordering

2005-09-23 Thread Matt
Cool. And I sort of have it working. class Pizza: name = meta.CharField(maxlength=100) class Topping: name = meta.CharField(maxlength=100) pizza = meta.ForeignKey(Pizza, edit_inline=meta.TABULAR) class META: admin = meta.Admin() order_with_respect_to = 'pizza' On the p

Re: Non-model driven ordering

2005-09-23 Thread Adrian Holovaty
On 9/23/05, Matt <[EMAIL PROTECTED]> wrote: > I have a set of objects that need to be presented to the user in some > specified order not related to any data in the model (let's say the > ordering is based on the editors whim and not by object name or > published date) Hey Matt, You're right --

AW: Non-model driven ordering

2005-09-23 Thread Matt
What would be the Djangonic (?) way of handling the following situation: I have a set of objects that need to be presented to the user in some specified order not related to any data in the model (let's say the ordering is based on the editors whim and not by object name or published date) The o