Opened 7 years ago

Last modified 4 days ago

#9976 assigned New feature

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

Reported by: Alex Owned by: Alex
Component: contrib.admin Version: 1.0
Severity: Normal Keywords: design_ux raw_id_fields
Cc: andy@…, kmike, elijahr, 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 7 years ago.
9976.generic-foreign-key-widget.diff (11.2 KB) - added by julien 4 years ago.
Updated patch to current trunk
9976.r17313.diff (10.9 KB) - added by prestontimmons 4 years ago.
Updated patch to r17313

Download all attachments as: .zip

Change History (21)

comment:1 Changed 7 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Status changed from new to assigned

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 7 years ago by Alex

comment:2 Changed 7 years ago by jacob

  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 6 years ago by russellm

  • Keywords design_ux added

comment:4 Changed 5 years ago by andybak

  • Cc andy@… added

comment:5 Changed 5 years ago by kmike

  • Cc kmike added

comment:6 Changed 5 years ago by anonymous

  • Cc elijahr added

comment:7 Changed 5 years ago by gabejackson

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 4 days ago by timgraham (previous) (diff)

comment:8 Changed 4 years ago by SmileyChris

  • Severity set to Normal
  • Type set to New feature

Changed 4 years ago by julien

Updated patch to current trunk

comment:9 Changed 4 years ago by julien

  • 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 4 years ago by prestontimmons

Updated patch to r17313

comment:10 Changed 4 years ago by prestontimmons

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 4 years ago by julien

  • 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 3 years ago by carlos.palol@…

  • Cc carlos.palol@… added

comment:13 Changed 3 years ago by LighteR

  • Cc unknownlighter@… added

comment:14 Changed 3 years ago by anonymous

where can i find showGenericRelatedObjectLookupPopup()?

comment:15 Changed 3 years ago by jpic

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 3 years ago by hoddez

  • Cc hoddez added

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

  • Cc 4glitch@… added

comment:18 Changed 11 months ago by collinanderson

  • Keywords raw_id_fields added
Note: See TracTickets for help on using tickets.
Back to Top