Opened 15 years ago

Last modified 8 years ago

#9976 new New feature

Generic Foreign Keys should have a nice widget(ala raw_id)

Reported by: Alex Gaynor Owned by:
Component: contrib.admin Version: dev
Severity: Normal Keywords: design_ux raw_id_fields
Cc: andy@…, Mikhail Korobov, Elijah Rutschman, carlos.palol@…, unknownlighter@…, hoddez, 4glitch@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: yes

Description

It would be nice if generic foreign keys could have a nice widget for the admin, right now they aren't very usable.

Attachments (3)

generic-foreign-key-widget.diff (11.2 KB) - added by Alex Gaynor 15 years ago.
9976.generic-foreign-key-widget.diff (11.2 KB) - added by Julien Phalip 12 years ago.
Updated patch to current trunk
9976.r17313.diff (10.9 KB) - added by Preston Timmons 12 years ago.
Updated patch to r17313

Download all attachments as: .zip

Change History (23)

comment:1 Changed 15 years ago by Alex Gaynor

Status: newassigned

Work on this can be found here:

http://github.com/alex/django/commits/generic-foreign-key-widget

(sorry not at a machine where I can produce a proper diff right now).

Changed 15 years ago by Alex Gaynor

comment:2 Changed 15 years ago by Jacob

Triage Stage: UnreviewedAccepted

comment:3 Changed 14 years ago by Russell Keith-Magee

Keywords: design_ux added

comment:4 Changed 14 years ago by Andy Baker

Cc: andy@… added

comment:5 Changed 13 years ago by Mikhail Korobov

Cc: Mikhail Korobov added

comment:6 Changed 13 years ago by anonymous

Cc: Elijah Rutschman added

comment:7 Changed 13 years ago by Gabe Jackson

Thanks for this! In case somebody is trying to get this to work on 1.2. you would have to add:

def label_for_value(self, value):
    return ''

to the GenericForeignKeyRawIdWidget class. otherwise it'll fail.

Greetings

Gabe

Last edited 8 years ago by Tim Graham (previous) (diff)

comment:8 Changed 13 years ago by Chris Beaven

Severity: Normal
Type: New feature

Changed 12 years ago by Julien Phalip

Updated patch to current trunk

comment:9 Changed 12 years ago by Julien Phalip

Easy pickings: unset
Has patch: set
UI/UX: set

I've updated the patch to current trunk and fixed the tests. I haven't examined the UI in detail yet though. Feedback and patches welcome.

Changed 12 years ago by Preston Timmons

Attachment: 9976.r17313.diff added

Updated patch to r17313

comment:10 Changed 12 years ago by Preston Timmons

I updated the patch to current trunk. I also fixed a typo in one of the raised exceptions and changed the Image model to use a CharField rather than an ImageField. I didn't see a good reason to require PIL to run the tests. I didn't examine the UI.

comment:11 Changed 12 years ago by Julien Phalip

Patch needs improvement: set

Thanks for updating the patch. Now that we've got Selenium support, it'd be also quite useful to write some Selenium tests for the Javascript part.

comment:12 Changed 12 years ago by carlos.palol@…

Cc: carlos.palol@… added

comment:13 Changed 12 years ago by LighteR

Cc: unknownlighter@… added

comment:14 Changed 12 years ago by anonymous

where can i find showGenericRelatedObjectLookupPopup()?

comment:15 Changed 12 years ago by James Pic

Hi all, i thought you'd like to know about a criticism of these patch and approach: https://github.com/yourlabs/django-autocomplete-light/issues/5#issuecomment-5809277

comment:16 Changed 11 years ago by hoddez

Cc: hoddez added

comment:17 Changed 11 years ago by Dmitri Bogomolov <4glitch@…>

Cc: 4glitch@… added

comment:18 Changed 9 years ago by Collin Anderson

Keywords: raw_id_fields added

comment:19 Changed 8 years ago by Asif Saifuddin Auvi

Owner: changed from Alex Gaynor to Asif Saifuddin Auvi
Version: 1.0master

comment:20 Changed 8 years ago by Asif Saifuddin Auvi

Owner: Asif Saifuddin Auvi deleted
Status: assignednew
Note: See TracTickets for help on using tickets.
Back to Top