Opened 19 years ago

Closed 18 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)

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

Download all attachments as: .zip

Change History (9)

by jkocherhans, 19 years ago

Attachment: edit_external.png added

Initial screenshot.

comment:1 by jkocherhans, 19 years ago

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.

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 Christopher Lenz <cmlenz@…>, 19 years ago

Cc: cmlenz@… added

comment:3 by Wilson, 19 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 Chris Beaven, 19 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:5 by JustinB, 18 years ago

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

comment:6 by Karsten W. Rohrbach <karsten@…>, 18 years ago

Cc: karsten@… added

comment:7 by jkocherhans, 18 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 Chris Beaven, 18 years ago

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