Thanks!
On Dec 22, 10:16 am, Malcolm Tredinnick
wrote:
> On Sun, 2008-12-21 at 23:07 -0800, sunn wrote:
>
> [...]
>
> > I would like to order my Block objects by first page.sortorder and
> > then sortorder. Any idea on how to accomplish this?
> > I have tried with ordering = ['page.sortorder', '
On Sun, 2008-12-21 at 23:07 -0800, sunn wrote:
[...]
> I would like to order my Block objects by first page.sortorder and
> then sortorder. Any idea on how to accomplish this?
> I have tried with ordering = ['page.sortorder', 'sortorder'] but this
> does not work ("ordering" refers to "page.sorto
from django.db import models
class Page(models.Model):
sortorder = models.IntegerField()
parent = models.ForeignKey('self', null=True, blank=True)
class Meta:
ordering = ['sortorder']
def __unicode__(self):
return self.display
class Block(models.Model):
sortor
I changed the query from an "inner join" to "left outer join" which
returned issues with null resolutions.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to dja
In a helpdesk app, I have a model called 'issue' which has a foreign
key called 'resolution'. The 'resolution' model allows null values -
if an issue is open, 'resolution' will be null, if closed, there will
be a value there.
Before queryset-refactor, I could do the following and get results
sort
On Sun, 2008-03-02 at 09:38 -0800, watusee wrote:
> Thanks for you quick and helpful reply Malcolm! A few clarifications
> if I may. I couldn't quite figure out how to connect what the admin
> tool does to seeing queries in connection.queries. I can however see
> the the offending query when I ge
Thanks for you quick and helpful reply Malcolm! A few clarifications
if I may. I couldn't quite figure out how to connect what the admin
tool does to seeing queries in connection.queries. I can however see
the the offending query when I get an error in the admin. If I do see
a query that is not wh
On Sat, 2008-03-01 at 20:02 -0800, watusee wrote:
> Using the manual Many to Many model as follows in revision 7188
[...]
> #
>
> I've done a lot of searching but can't quite figure out if this is
> something that:
>
> a) Should work in said revision and
Using the manual Many to Many model as follows in revision 7188
#
class Book(models:Model):
name = models.CharField(max_length=64)
class Admin:
pass
class Author(models:Model):
name = models.CharField(max_length=64)
class Admin:
pass
class B
On Wed, 2007-11-14 at 00:00 +, Michael wrote:
> Thanks Malcolm, this helped me on one problem I had. But, I've
> another similar problem but in my case, I've multiple foreign keys, so
> I'm not sure what to do about the database table name part.
>
> My models:
> class Member(models.Model):
Thanks Malcolm, this helped me on one problem I had. But, I've
another similar problem but in my case, I've multiple foreign keys, so
I'm not sure what to do about the database table name part.
My models:
class Member(models.Model):
# first_name, last_name, etc.
class Meta:
ordering
On Oct 19, 3:11 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Fri, 2007-10-19 at 06:54 -0700, äL wrote:
> > I would like to order a list in a view by foreign key. If I try
> >orderinghow in the
> > code below my list is ordered by 'person'. And this means that the
> > list
> > ist order
On Fri, 2007-10-19 at 06:54 -0700, äL wrote:
> I would like to order a list in a view by foreign key. If I try
> ordering how in the
> code below my list is ordered by 'person'. And this means that the
> list
> ist ordered by the ID of the table Person. But I need a list ordered
> by 'nameLast'.
>
I would like to order a list in a view by foreign key. If I try
ordering how in the
code below my list is ordered by 'person'. And this means that the
list
ist ordered by the ID of the table Person. But I need a list ordered
by 'nameLast'.
Thus I changed ordering 'person' into 'person.nameLast'. B
is it possible? I am on the latest trunk, 0.96-pre...
in the admin class, I can fake ordering by a foreign key field using
the table name and list_select_related
class Admin:
list_select_related = True
ordering = ['myapp_mytable.myfield']
the same does no
is it possible?
in the admin class, I can fake ordering by a foreign key field using
the table name and list_select_related
class Admin:
list_select_related = True
ordering = ['myapp_mytable.myfield']
the same does not seem to work for class Meta, which g
On 5/22/06, Douglas Campos <[EMAIL PROTECTED]> wrote:
> i have a model formed by :
> vendor = foreign key
> name, ver, rev, etc
>
> how can i order by vendor first?
> ordering = [ 'vendor', 'name' ] fails
>
> any ideas?
Ordering by a foreign key isn't technically supported at this point,
but you
i have a model formed by :
vendor = foreign key
name, ver, rev, etc
how can i order by vendor first?
ordering = [ 'vendor', 'name' ] fails
any ideas?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" g
My original question
(http://groups.google.com/group/django-users/browse_frm/thread/1581881fb9c1ddc1/#):
Here is a simplified version of what I am trying to do:
App X:
class A:
shortname = meta.CharField(maxlength=6)
App Y:
class B:
the_A = meta.ForeignKey(A)
Y.views:
blist = bs.get_li
Hi Adrian,
Thanks for the reply.
I did try using the full table names without success.
This is the error and traceback (with real class names):
OperationalError at /debtors/current/
(1109, "Unknown table 'matterlist_matters' in order clause")
Traceback (most recent call last):
File
"/opt/lo
On 3/13/06, jtm <[EMAIL PROTECTED]> wrote:
> Y.views:
> blist = bs.get_list(order_by=['as.shortname'])
>
> But Django is telling me that there is no table named 'as'.
> Everything seems to be importing fine. Does anyone have any
> hints?
Go into your database command-line client and type "\dt" (P
Here is a simplified version of what I am trying to do:
App X:
class A:
shortname = meta.CharField(maxlength=6)
App Y:
class B:
the_A = meta.ForeignKey(A)
Y.views:
blist = bs.get_list(order_by=['as.shortname'])
But Django is telling me that there is no table named 'as'.
Everything seem
Hi Jacob,
thanks, it's good to know that I'm not going to find the bug in my
code.
While trying different things, I too found out that adding the
"ordering"-option made the listview work again. The first thing I tried
was adding ordering = ['theparent']:
class FirstChild(meta.Model):
Hey Andreas --
I actually ran into this same problem myself today. It appears to be
a bug in the admin changelist view; until I get a chance to actually
track it down you can work around it by adding a "ordering" option to
your META.admin::
class FirstChild(meta.Model):
...
I'm trying to order a class by its parent, but apparently I'm doing
something wrong. The code I use:
class ParentClass(meta.Model):
somevar= meta.CharField(maxlength=100)
def __repr__(self):
return self.somevar
class META:
admin = meta.Admin()
ord
25 matches
Mail list logo