Opened 20 years ago
Closed 19 years ago
#1476 closed enhancement (wontfix)
New field option: edit_external=True
| Reported by: | jkocherhans | Owned by: | Adrian Holovaty |
|---|---|---|---|
| Component: | contrib.admin | Version: | |
| Severity: | minor | Keywords: | |
| Cc: | cmlenz@…, karsten@… | Triage Stage: | Unreviewed |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
I've been using a new type of edit_inline behavior for a lot of apps here that works very well, especially for objects that have too many fields to be displayed efficiently by models.TABLULAR and models.STACKED. Related objects are displayed as lists, with an add link that will pre-fill the related object's ForeignKey field with the appropriate id. I'd like to add support for linking back to the parent object, as well as add/change links to OneToOneFields, but I haven't come up with any ideas I like for how to display those. Feedback would be appreciated. I have most of the code written and my plans are to tweak it a little, and submit it as a patch to magic-removal. Screenshot forthcoming.
Attachments (1)
Change History (9)
by , 20 years ago
| Attachment: | edit_external.png added |
|---|
comment:1 by , 20 years ago
| Summary: | edit_inline=meta.EXTERNAL → New field option: edit_external=True |
|---|
This is actually a lot easier to implement using a new field constructor argument called edit_external. Editing an object externally doesn't have the semantics of edit_inline and would require a lot of special cases in the code.
Example:
class Article(models.Model): title = models.CharField(maxlength=50) description = models.TextField() class Admin: pass class Incident(models.Model): article = models.ForeignKey(Article, edit_external=True) description = models.TextField() class Admin: pass
comment:2 by , 20 years ago
| Cc: | added |
|---|
comment:3 by , 20 years ago
I think this could be very useful. For the sake of consistency, it should probably be implemented along the lines of the new edit_inline tabular format (with links to popup edit forms instead of form fields in each row). That way we can reuse the adding, ordering and removing functions from the tabular format.
comment:4 by , 20 years ago
Great! I can see a lot of uses for this functionality (including some of my current projects).
Basic pagination would be useful for when there are lots of child objects... otherwise the side list could get unmanagable.
comment:6 by , 19 years ago
| Cc: | added |
|---|
comment:7 by , 19 years ago
This won't be implemented as is. In a discussion with Wilson Miner (I forget if it was IRC or email) he told me that the sidebar slot is going away at some point in the future. It may be the distant future however. I tried implementing this by creating a new edit_inline=EXTERNAL option, but ran into a bunch of snags. From what i remember it took too many hacks to make it work like the rest of the edit_inline options.
As far as I know the code that this screenshot came from is still in production. To implement it I overrode admin templates and wrote a few template tags to get the related objects given the original object in the template context. It's kind of a hack, but if you really need this, it's not a messy hack. I don't still have access to that code, but it wasn't anything incredibly tricky.
comment:8 by , 19 years ago
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |
Closing due to the fact this isn't going to happen in it's current form.
Initial screenshot.