#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 , 19 years ago
comment:2 by , 19 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 , 19 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:5 by , 19 years ago
| Component: | Admin interface → Cache system |
|---|---|
| milestone: | → Version 0.92 |
| priority: | normal → highest |
| Severity: | normal → blocker |
| Type: | defect → enhancement |
| Version: | → SVN |
See also #1972