Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#2209 closed enhancement (duplicate)

Edit inline and models without fields in the admin

Reported by: anonymous Owned by: Adrian Holovaty
Component: Core (Cache system) Version: dev
Severity: blocker Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If a model is a ForeignFey for another model with edit_inline=models.STACKED or TABULAR but have no fields itself the admin fails to display the the page at all. Failing with a error page.

class Cart(models.Model):

    class Admin:
        pass

class CartItem(models.Model):

    cart =  models.ForeignKey(Cart, edit_inline=models.STACKED)
    quantity = models.PositiveIntegerField(core=True)

Change History (6)

comment:1 by tyson@…, 18 years ago

See also #1972

comment:2 by James Bennett, 18 years ago

I guess with both of these tickets (this one and the one referenced in the above comment) I wonder what the perceived utility is of relating to an object which has no columns in the database other than a primary key; what actual problem does such a setup solve?

comment:3 by James Bennett, 18 years ago

Also, it looks like the common problem is that when a model has no fields, syncdb doesn't bother creating a table for it (using the model definitions above, no tables were created when running syncdb on the app). Which makes logical sense, but we could probably document that better.

comment:4 by James Bennett, 18 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #1972

comment:5 by anonymous, 18 years ago

Component: Admin interfaceCache system
milestone: Version 0.92
priority: normalhighest
Severity: normalblocker
Type: defectenhancement
Version: SVN

comment:6 by Adrian Holovaty, 18 years ago

milestone: Version 0.92

Milestone Version 0.92 deleted

Note: See TracTickets for help on using tickets.
Back to Top