I'm getting an error (bubbled up from PostgreSQL) when visiting the
Admin page for a table I have called "staged_order."

Here is the class:
*******************************
class StagedOrder(models.Model):
    def __str__(self):
        return 'FIXME'
    staging_area = models.ForeignKey(StagingArea)
    placed_order = models.ForeignKey(PlacedOrder)
    in_time = models.DateTimeField()
    done_time = models.DateTimeField()
    out_time = models.DateTimeField()
    changed = models.DateTimeField(auto_now_add=True, editable=False)
    created = models.DateTimeField(auto_now=True, editable=False)
    class Meta:
        db_table = 'staged_order'
    class Admin:
        list_display = ('staging_area', 'placed_order', 'in_time',
'done_time', 'out_time', 'changed', 'created')
        list_filter = ('in_time', 'done_time', 'out_time', 'changed',
'created')
        search_fields = ('staging_area', 'placed_order')
        fields = (
            ('Core information', {'fields': ('staging_area',
'placed_order', 'in_time', 'done_time', 'out_time')}),
            ('Record dates', {'fields': ('changed', 'created')}),
        )
*******************************


Here is the error:
*******************************
ProgrammingError at /admin/core/stagedorder/
ERROR:              target lists can have at most 1664 entries SELECT
Request Method:     GET
Request URL:        http://localhost:8000/admin/core/stagedorder/
Exception Type:     ProgrammingError
Exception Value:    ERROR: target lists can have at most 1664 entries
SELECT
    <SNIP>
        Big, HUGE, ugly SELECT statement.
    </SNIP>
Exception Location:
/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/db/backends/util.py
in execute, line 12
*******************************


If I remove 'staging_area' and 'placed_order' from the custom
"list_display" from the Admin class, I don't get the error.

There must be some kind of spanning or looping going on as the SELECT
is full of this type of thing: "AND "country176"."world_region_id" =
"world_region177"."id" AND "shipper169"."message_type_id" =
"message_type178"."id" AND."

I have a country, message_type, etc tables but they are a few
foreign-keys away and shouldn't be involved in this Admin page.

Any ideas what might be causing this?  I've DROP DATABASE and CREATE
DATABASE and did a fresh sync all with no luck.

BTW... this in on Django version 0.96-pre

Thanks all.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to