Re: What exactly does order_with_respect_to do?

2013-01-24 Thread Anton Agestam
Thanks for the correction, found this thread when Googleing for an explanation. On Tuesday, December 15, 2009 5:28:10 PM UTC+1, smcoll wrote: > > This is probably a dead thread, but... i think the answer given is > incorrect. > > 'order_with_respect_to' adds an 

Re: order_with_respect_to fails for GenericForeignKey

2010-05-17 Thread Russell Keith-Magee
2010/5/17 Alper Çuğun : > Hello, > > A quick Google search reveals a ton of confusion about: > Meta: order_with_respect_to > > I have an abbreviated Model: > > class NewsItem(models.Model): >    # newsitems will be linked to blogs and projects >    content_type =

order_with_respect_to fails for GenericForeignKey

2010-05-17 Thread Alper Çuğun
Hello, A quick Google search reveals a ton of confusion about: Meta: order_with_respect_to I have an abbreviated Model: class NewsItem(models.Model): # newsitems will be linked to blogs and projects content_type = models.ForeignKey(ContentType) object_id

Re: Specifying an order_with_respect_to for a self referential one to many relationship (still) fails

2010-05-11 Thread Russell Keith-Magee
efore 1.2 goes final. The release candidate released last week contains all the features and bugfixes that will be in the final release, with the exception of any critical bugs found between now and the final release (there have been 2 confirmed, and possibly a third reported so far). order_with_res

Re: Specifying an order_with_respect_to for a self referential one to many relationship (still) fails

2010-05-11 Thread thierry
This bug is 4 years old. Weird that It was not corrected yet because it seems to be a core functionality of the ORM. Do django developpers have planned something before 1.2 stable release ? Regards, Thierry. -- You received this message because you are subscribed to the Google Groups "Django u

Re: Specifying an order_with_respect_to for a self referential one to many relationship (still) fails

2010-05-07 Thread Karen Tracey
On Fri, May 7, 2010 at 7:05 AM, thierry wrote: > I'd like to know if this problem, described in this post > > http://www.google.com/url?sa=D&q=http://groups.google.com/group/django-updates/browse_thread/thread/e247ff8079eda192&usg=AFQjCNHKyZDdY0P7z3TnSKg92GnTnlNz0Q > , > will be solved in the nex

Specifying an order_with_respect_to for a self referential one to many relationship (still) fails

2010-05-07 Thread thierry
Hi all, I'd like to know if this problem, described in this post http://www.google.com/url?sa=D&q=http://groups.google.com/group/django-updates/browse_thread/thread/e247ff8079eda192&usg=AFQjCNHKyZDdY0P7z3TnSKg92GnTnlNz0Q, will be solved in the next stable release of Django. Thanks. -- You recei

Re: What exactly does order_with_respect_to do?

2009-12-15 Thread Hanne Moa
2009/12/15 smcoll : > i'd be curious to know if anyone has seen an admin implementation for > reordering with this field.  i'd also heard some chatter a while back > that this might be removed in future releases of Django, because it > leans toward the "magic" end of things I always end up making

Re: What exactly does order_with_respect_to do?

2009-12-15 Thread smcoll
This is probably a dead thread, but... i think the answer given is incorrect. 'order_with_respect_to' adds an '_order' integer field to the model. Each set of instances that share a parent object of the relation specified by 'order_with_respect_to' get ordered as a

Re: What exactly does order_with_respect_to do?

2009-11-30 Thread Preston Holmes
On Nov 29, 4:50 pm, Continuation wrote: > In the doc (http://docs.djangoproject.com/en/dev/ref/models/options/ > #order-with-respect-to) it is mentioned that  order_with_respect_to > marks an object as "orderable" with respect to a given field. > > What exactly does th

order_with_respect_to doesn't work for model related to self

2009-11-30 Thread cerberos
I have a model that's related to itself, the instance names are not unique. I want to order by full path so the result is like a list of directory paths a a/b a/b/c a/c b/d/g b/e It's obvious why order_with_respect_to it doesn't work (although a mention of this exception in th

Re: What exactly does order_with_respect_to do?

2009-11-30 Thread anentropic
I've been wondering this too, the docs aren't clear. On Nov 30, 12:50 am, Continuation wrote: > In the doc (http://docs.djangoproject.com/en/dev/ref/models/options/ > #order-with-respect-to) it is mentioned that  order_with_respect_to > marks an object as "orderable&

What exactly does order_with_respect_to do?

2009-11-29 Thread Continuation
In the doc (http://docs.djangoproject.com/en/dev/ref/models/options/ #order-with-respect-to) it is mentioned that order_with_respect_to marks an object as "orderable" with respect to a given field. What exactly does that mean? Can someone give me an example of how this could be used?

Model inheritance and order_with_respect_to

2009-07-07 Thread moberley
ance). The parent model in that relationship has a ForeignKey relation to a third model with an order_with_respect_to meta option set to that ForeignKey. Although I seem to be able to work with these models in the shell (create, save, list). If I use the dumpdata management command I get the follo

Re: Meta, order_with_respect_to for recursive relation

2009-03-07 Thread Malcolm Tredinnick
uot;django-mptt" and "treebeard" for some things you can either use out of the box or some ideas you can utilise. > > > So I added to my model definintion the following: > class Meta: > order_with_respect_to = 'parent_category' > > > All

Meta, order_with_respect_to for recursive relation

2009-03-07 Thread NicoEchániz
embers to be ordered with respect to the parent category, like so: Pets Pets -> Dogs Pets -> Cats Vehicles Vehicles -> cars etc. So that when a product is added, the category selection displays in a logical order. So I added to my model definintion the following: class M

Re: order_with_respect_to fail any workaround ?

2008-12-23 Thread Thierry Stiegler
y", blank=True, null=True) > >     class Meta: >         ordering = ['name'] >        order_with_respect_to= 'parent' > >     def __unicode__(self): >         return self.name > > > An I got this error : > > Validating models... > Unhandled except

Re: order_with_respect_to fail any workaround ?

2008-12-06 Thread Thierry Stiegler
Juste for precision I use the trunk. On Dec 6, 9:34 am, Thierry Stiegler <[EMAIL PROTECTED]> wrote: > Hello, > > I got some errors by using the Meta options order_with_respect_to: > > class Category(PublicationBase, LocalisationBase): >     ITEM_PER_PAGE = 12 >

order_with_respect_to fail any workaround ?

2008-12-06 Thread Thierry Stiegler
Hello, I got some errors by using the Meta options order_with_respect_to: class Category(PublicationBase, LocalisationBase): ITEM_PER_PAGE = 12 name = models.CharField(max_length=255) pictogram = models.ImageField(upload_to="categories", blank=True)

admin inline formsets / drag/drop resp. move-up/down / how to retrieve "order_with_respect_to"?

2008-10-10 Thread patrickk
I like to implement drag/drop functionality resp. move-up/move-down buttons for inline-elements within the admin-interface. therefore, in tabular.html/stacked.html I need to know whether or not "order_with_respect_to" is being used for that model - if yes, the buttons will be availabl

Re: order_with_respect_to still dead wth MySQL?

2007-07-16 Thread John Shaffer
Note that the ticket is marked "new" rather than "closed: fixed". This usually means that it is still an issue. A triager might look at it and mark it "ready for checkin" rather than "patch needs improvement", which will give it a much better chance of getting into trunk. --~--~-~--~~

order_with_respect_to still dead wth MySQL?

2007-07-16 Thread Austin Govella
Does order_with_respect_to still not work? http://code.djangoproject.com/ticket/1760 I'm getting an error: * (1093, "You can't specify target table 'tasks_action' for update in FROM clause") -- Austin Govella Thinking & Making: IA, UX, and IxD http://thin

Re: Problem with order_with_respect_to and self

2007-03-27 Thread Anderson Santos Silva
nt or custom page that will be shown") position = models.IntegerField(verbose_name="Order of appearence",blank=True, null=True) def __str__(self): return self.description class Admin: list_display = ('description','position')

Re: Problem with order_with_respect_to and self

2007-03-26 Thread [EMAIL PROTECTED]
Malcom, Sorry, you are correct. I completely flubbed on that one. -Doug On Mar 26, 8:24 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Mon, 2007-03-26 at 22:51 +, [EMAIL PROTECTED] wrote: > >http://www.djangoproject.com/documentation/model-api/#many-to-one-rel... > > > class

Re: Problem with order_with_respect_to and self

2007-03-26 Thread Malcolm Tredinnick
On Mon, 2007-03-26 at 22:41 -0300, Anderson Santos Silva wrote: > I am working with the trunk, and I never tried the order_with_respect_to > before, so I don't know how it works but it's on the official Django's > documentation. > Since my model is called Section, it

Re: Problem with order_with_respect_to and self

2007-03-26 Thread Anderson Santos Silva
I am working with the trunk, and I never tried the order_with_respect_to before, so I don't know how it works but it's on the official Django's documentation. Since my model is called Section, it's probably something about Python tricks to get a property dinamically. That

Re: Problem with order_with_respect_to and self

2007-03-26 Thread Malcolm Tredinnick
On Mon, 2007-03-26 at 19:23 -0300, Anderson Santos Silva wrote: > Hello, I am having problem when I use the order_with_respect_to and > a self related foreign key model: > > When I validate this, it raises "'str' object has no attribute > 'get_sec

Re: Problem with order_with_respect_to and self

2007-03-26 Thread Malcolm Tredinnick
On Mon, 2007-03-26 at 22:51 +, [EMAIL PROTECTED] wrote: > http://www.djangoproject.com/documentation/model-api/#many-to-one-relationships > > class Section(models.Model): > parent = models.ForeignKey('self', < BAD > parent = models.ForeignKey('Section', < GOOD I'm sorry, but

Re: Problem with order_with_respect_to and self

2007-03-26 Thread [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote: > Hello, I am having problem when I use the order_with_respect_to and > a self related foreign key model: > > When I validate this, it raises "'str' object has no attribute > 'get_section_order'" and when I

Problem with order_with_respect_to and self

2007-03-26 Thread Anderson Santos Silva
Hello, I am having problem when I use the order_with_respect_to and a self related foreign key model: When I validate this, it raises "'str' object has no attribute 'get_section_order'" and when I use self or Section, it raises the error: "Section

Re: order_with_respect_to Revisited!

2007-01-08 Thread patrick k.
I did something like that, but it´s not very generic: see http://groups.google.com/group/django-developers/browse_frm/ thread/dc0e4a9d6ad02ea3/ patrick Am 08.01.2007 um 10:34 schrieb [EMAIL PROTECTED]: I see quite a few posts on the elusive "order_with_respect_to" meta at

order_with_respect_to Revisited!

2007-01-08 Thread [EMAIL PROTECTED]
I see quite a few posts on the elusive "order_with_respect_to" meta attribute. I implemented a drag-and-drop version of this for a PHP app I was building, but I was wondering if anyone's made any effort to create one for Django. The behavior I'm looking for is something si

any update - MySQL and order_with_respect_to ?

2006-12-28 Thread Chris Kelly
I've recently run into the pesky "order_with_respect_to and MySQL not supporting updating a table and selecting it in a subquery" issue. Any official work being done on this issue at the moment? Unfortunately pgsql isn't an option... http://code.djangoproject.com/ticket/1760

Re: Problem with order_with_respect_to

2006-10-30 Thread Tim Shaffer
I'm guessing you're using MySQL? I believe order_with_respect_to has been broken for a while now when used with MySQL. I haven't been able to get it working since I can remember. There is a ticket regarding this issue... http://code.djangoproject.

Problem with order_with_respect_to

2006-10-30 Thread Daniel Austria
Hi, i have a problem with the order_with_respect_to field in the Meta-Class. Editing the Model in the Admin interface (Saving new levels) i get the exception: You can't specify target table 'heracles_level' for update in FROM clause If i remove the order_with_respect_to field

Re: order_with_respect_to : explanation?

2006-08-11 Thread Jeremy Dunck
On 8/11/06, Antonio Cavedoni <[EMAIL PROTECTED]> wrote: > Fair enough, but if the field is invisible, how does one specifies > said ordering? For example, if I have a list of 5 items, and I > suddenly decide that item 4 should be on top of the list, how do I > move it up? I think, since you're ba

Re: order_with_respect_to : explanation?

2006-08-11 Thread Antonio Cavedoni
On 11 Aug 2006, at 11:13, Ivan Sagalaev wrote: > This option creates an invisible field "_order" for manually > specifying the order of child records of a single given parent > record. This is mostly visible in Admin where child records with > "edit_inline" appear in the same order that the

Re: order_with_respect_to : explanation?

2006-08-11 Thread Ivan Sagalaev
gabor wrote: > i've read the documentation, i checked the group-archives, > but still... i just cannot understand what that setting does. > > could someone explain it to me? I remember me asking the same question some time ago :-) This option creates an invisible field "_order" for manually spe

order_with_respect_to : explanation?

2006-08-10 Thread gabor
hi, i've read the documentation, i checked the group-archives, but still... i just cannot understand what that setting does. could someone explain it to me? thanks, gabor --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gr

order_with_respect_to and edit_inline in MR

2006-06-06 Thread Colleen Owens
Hi, I switched my code over to M-R this past weekend and was surprised that it went pretty smoothly. There are a couple things in my models that aren't working anymore though. The first is order_with_respect_to. I have an inline edited object that I want to order with respect to its re

Re: For what is useful order_with_respect_to?

2006-05-16 Thread Rudolph
Hi, This question is yet unsolved (for me). Does "order_with_respect_to" have a widget in the admin interface (nothing seems to change). And does it have an API, something like: object.move_up() object.move_down() object.move_first() object.move_last(). And when I delete an item,

Re: For what is useful order_with_respect_to?

2006-05-02 Thread Ivan Sagalaev
Adrian Holovaty wrote: >No, ordering by ID wouldn't work, because you might want to change the >order of objects. Continuing Wilson's example, you may want to change >the ordering of choices for a given poll. > > Am I right guessing that to do this one should remove all related record and add

Re: For what is useful order_with_respect_to?

2006-05-02 Thread Adrian Holovaty
ting them > >alphabetically. In that case you could set order_with_respect_to = > >'poll_id' in your choices model. > > > > > Wouldn't ordering = ('id',) also work? No, ordering by ID wouldn't work, because you might want to change the order of

Re: For what is useful order_with_respect_to?

2006-05-02 Thread patrickk
i just tried what wilson wrote: used order_with_respect_to = 'poll' (instead of 'poll_id') still, my admin-screen didn´t change (it´s the same whether using order_with_respect_to or not using it). i know there´s been some discussion concerning oder_with_respect_to. it´

Re: For what is useful order_with_respect_to?

2006-04-26 Thread Ivan Sagalaev
Wilson Miner wrote: >To use the tutorial app as an example, if you have a number of choices >for each poll, you may want to make the choices orderable by an >arbitrary index within the poll, rather than sorting them >alphabetically. In that case you could set order_with_respect_to

Re: For what is useful order_with_respect_to?

2006-04-26 Thread Wilson Miner
To use the tutorial app as an example, if you have a number of choices for each poll, you may want to make the choices orderable by an arbitrary index within the poll, rather than sorting them alphabetically. In that case you could set order_with_respect_to = 'poll_id' in your choices

For what is useful order_with_respect_to?

2006-04-26 Thread Ivan Sagalaev
Being not native English speaker I can't really get the purpose or order_with_respect_to just by reading docs. Looking at how it's implemented I see that related objects get some sort index unique within one parent record and can be ordered in creation order. But why it is needed? C

ManyToMany relations and order_with_respect_to

2006-03-03 Thread akaihola
In my model I have Papers and Persons. One Paper usually has multiple Persons as authors, and they have to be in a determined order. Every Person can of course be author for multiple Papers. On top of all, I'd like to be able to edit authors inline and re-arrange their order for every Paper in ad

Re: order_with_respect_to ???

2006-03-01 Thread bruno desthuilliers
akaihola wrote: >>I must be a bit dumb, but I fail to understand the doc for the >>"order_with_respect_to" META option... Could someone be kind enough to >>have mercy and take time to explain slowly ? > > > I've been wondering about it too, and this is

Re: order_with_respect_to ???

2006-03-01 Thread patrick k
- doesn´t work with mysql < 4.1 > >> I must be a bit dumb, but I fail to understand the doc for the >> "order_with_respect_to" META option... Could someone be kind enough to >> have mercy and take time to explain slowly ? > > I've been wondering

Re: order_with_respect_to ???

2006-03-01 Thread akaihola
> I must be a bit dumb, but I fail to understand the doc for the > "order_with_respect_to" META option... Could someone be kind enough to > have mercy and take time to explain slowly ? I've been wondering about it too, and this is what I've found out: - used on

order_with_respect_to ???

2006-03-01 Thread bruno desthuilliers
Hi everybody I must be a bit dumb, but I fail to understand the doc for the "order_with_respect_to" META option... Could someone be kind enough to have mercy and take time to explain slowly ? TIA -- bruno desthuilliers développeur [EMAIL PROTECTED] http://www.m

Re: order_with_respect_to

2006-02-24 Thread patrick k
ncated in the message. You can try to use > sqlite as database if you have sqlite and > pysqlite installed or simply drop order_with_respect_to from your model. > > Also you can use something like this as a workaround (untested): > > class Filmstarts(meta.Model): > film = meta.Fore

Re: order_with_respect_to

2006-02-24 Thread nesh
e entered is "7786". Probably last *6* and *'* are truncated in the message. You can try to use sqlite as database if you have sqlite and pysqlite installed or simply drop order_with_respect_to from your model. Also you can use something like this as a workaround (untes

Re: order_with_respect_to

2006-02-24 Thread patrick k
i´m using 4.0.18 (well, my hosting company does). besides that, i don´t really understand the query. it is "SELECT COUNT(*) FROM `skip_filmstarts_a` WHERE `film_id` = '778". the film_id i have entered is "7786". patrick > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > patrick k wrote:

Re: order_with_respect_to

2006-02-24 Thread nesh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 patrick k wrote: > query is: > > 'INSERT INTO `skip_filmstarts_a` (`film_id`,`_order`) VALUES (%s,(SELECT > COUNT(*) FROM `skip_filmstarts_a` WHERE `film_id` = %s))' No luck, django.core.meta.__init_py:1020 # TODO: This assumes the database support

Re: order_with_respect_to

2006-02-24 Thread patrick k
> Not! This will happen when a exception is thrown from some code in template > rendering, you must put > *TEMPLATE_DEBUG=False* to get actual error. did that - see previous posting > > Also post result of django-admin.py sql for Filmstarts table. CREATE TABLE `skip_filmstarts_a` ( `id` m

Re: order_with_respect_to

2006-02-24 Thread nesh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Amit Upadhyay wrote: > On 2/24/06, *patrick k* <[EMAIL PROTECTED] > > wrote: > > here it is (i´m not sure if you need all of this ...): > > TemplateSyntaxError: Caught an exception while rendering. > > > This

Re: order_with_respect_to

2006-02-24 Thread patrick k
Title: Re: order_with_respect_to sorry for didn´t making myself clear. "exactly the same error message" - that´s what i wanted to say. nevertheless, i tried to use TEMPLATE_DEBUG=False and got the following error: (1064, "You have an error in your SQL syntax. Check the manual t

Re: order_with_respect_to

2006-02-24 Thread Amit Upadhyay
On 2/24/06, patrick k <[EMAIL PROTECTED]> wrote: did that. exactly the same error.Enabling template debugging won't solve your problem, it will just help you pin point it. The errors should be the same, but the output should also include some template code, with a few line in red, post those l

Re: order_with_respect_to

2006-02-24 Thread patrick k
Title: Re: order_with_respect_to did that. exactly the same error. On 2/24/06, patrick k <[EMAIL PROTECTED]> wrote: here it is (i´m not sure if you need all of this ...): TemplateSyntaxError: Caught an exception while rendering. This is a template syntax error, you can  put a TEMPLATE

Re: order_with_respect_to

2006-02-24 Thread Amit Upadhyay
On 2/24/06, patrick k <[EMAIL PROTECTED]> wrote: here it is (i´m not sure if you need all of this ...): TemplateSyntaxError: Caught an exception while rendering.This is a template syntax error, you can put a TEMPLATE_DEBUG=True in your settings file and restart server to help you find about

Re: order_with_respect_to

2006-02-24 Thread patrick k
Title: Re: order_with_respect_to here it is (i´m not sure if you need all of this ...): Traceback (most recent call last):   File "/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/core/servers/basehttp.py", line 272, in run self.result = application(se

Re: order_with_respect_to

2006-02-24 Thread Amit Upadhyay
Hi Patrick,good point.i´d still appreciate some help with my initial question though. Can you please post the exact error that you are getting? -- Amit UpadhyayBlog: http://www.rootshell.be/~upadhyay +91-9867-359-701 --~--~-~--~~~---~--~~ You received this message be

Re: order_with_respect_to

2006-02-24 Thread va:patrick.kranzlmueller
good point.i´d still appreciate some help with my initial question though.thanks,patrickAm 24.02.2006 um 17:10 schrieb Amit Upadhyay:On 2/24/06, va:patrick.kranzlmueller <[EMAIL PROTECTED]> wrote: class Filmstarts(meta.Model): id = meta.AutoField('ID', primary_key=True)Why are you doing this? E

Re: order_with_respect_to

2006-02-24 Thread Amit Upadhyay
On 2/24/06, va:patrick.kranzlmueller <[EMAIL PROTECTED]> wrote: class Filmstarts(meta.Model): id = meta.AutoField('ID', primary_key=True)Why are you doing this? Every model has a file named `id` if you do not specify any primary_key. If there is no strong reason to do it, consider removing this

order_with_respect_to

2006-02-24 Thread va:patrick.kranzlmueller
i´m having the following model which gives me an error when trying to save something: class Filmstarts(meta.Model): id = meta.AutoField('ID', primary_key=True) film = meta.ForeignKey(Film, raw_id_admin=True) class META: order_with_respect_to = "film&

order_with_respect_to question

2005-12-20 Thread [EMAIL PROTECTED]
Hello, With regards to order_with_respect_to, what if the object I would like to order is not a child of some parent object. Say I have a blog app and via the admin I can enter any amount of 'tags'. On the front page of the blog I may want to have those tags in a specific order