Opened 16 years ago

Closed 16 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


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)

edit_external.png (41.9 KB) - added by jkocherhans 16 years ago.
Initial screenshot.

Download all attachments as: .zip

Change History (9)

Changed 16 years ago by jkocherhans

Attachment: edit_external.png added

Initial screenshot.

comment:1 Changed 16 years ago by jkocherhans

Summary: edit_inline=meta.EXTERNALNew 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.


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 Changed 16 years ago by Christopher Lenz <cmlenz@…>

Cc: cmlenz@… added

comment:3 Changed 16 years ago by Wilson

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 Changed 16 years ago by Chris Beaven

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:5 Changed 16 years ago by JustinB

When will it be implemented? Can't wait to use it.

comment:6 Changed 16 years ago by Karsten W. Rohrbach <karsten@…>

Cc: karsten@… added

comment:7 Changed 16 years ago by jkocherhans

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 Changed 16 years ago by Chris Beaven

Resolution: wontfix
Status: newclosed

Closing due to the fact this isn't going to happen in it's current form.

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