Hi, I resolver my first problem, but now I've another question... I need to specify in the 'order' field of Widget a list with multiple fields.. for example the field 'order' is set to: -publish_date,section
I know that in my view I can't do this: Story.objects.filter(id_site=Site.objects.get_current().id).select_related().order_by(order) so...how can I do? Thanks Davide On 30 Ott, 01:55, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Mon, 2007-10-29 at 09:35 -0700, [EMAIL PROTECTED] wrote: > > Hi all, > > I need to execute a query with aorder_bywith some parameters that I > > read from another query.. > > something like this: > > > this is my model: > > > class Widget(models.Model): > > name = models.CharField(maxlength=50,core=True) > > .... > > order = models.CharField(maxlength=50,blank=True,null=True) > > > and this is my view : > > > temp_list = > > Story.objects.filter(id_section=section_id).select_related().order_by(widget.order) > > > i have this error: > > OperationalError at / > > no such column: stories_story. > > > for example, if I make this: > > order = '-title' > > temp_list = > > Story.objects.filter(id_section=section_id).select_related().order_by(order) > > > it works (but it isn't whar i need...)!! > > What you don't tell us is what the value of widget.order is when you get > the error. It must be a string that can be validly passed toorder_by() > and it looks like it doesn't have the right value. So have a look in > that direction -- check that widget.order has a sensible value. > > Regards, > Malcolm > > -- > I don't have a solution, but I admire your > problem.http://www.pointy-stick.com/blog/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---