Django

Code

Ticket #27 (new)

Opened 3 years ago

Last modified 6 months ago

Single form field for multiple database fields

Reported by: adrian Assigned to: nobody
Milestone: post-1.0 Component: Forms
Version: Keywords: feature_request
Cc: cmawebsite@gmail.com Triage Stage: Someday/Maybe
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Some admin interfaces would benefit from being able to have multiple fields' worth of data entered in a single field. For example, a field for a sports stat could be entered into a single field as "XX-YY-ZZ", whereas the three values are actually three separate fields in the DB.

Relevant conversation:

<jacobkm> Well, I'm using those aggregate fields for stats where you type something like "3-17" and it gets split into multiple fields.  I see there's a CommaSeperatedIntegerField in formfields which would work for this, but there needs to be a way in the datadescriptions to say "this group of fields should be presented as a single field"
<django34> The DD will have to provide a format string of some sort
<jacobkm> Easy enough
<jacobkm> are you thinking of a % format string or a regex?
<django34> Not sure...
<django34> Probably just %
<django34> fields_together = '%(last_name)s, %(first_name)s'

Attachments

Change History

06/12/06 06:46:57 changed by Main

  • type changed from enhancement to defect.

02/10/07 10:23:39 changed by Gary Wilson <gary.wilson@gmail.com>

  • stage changed from Unreviewed to Accepted.

I know there have been some newforms examples where multiple form fields are used for a single database field. Is it just as easy to do the opposite, single form field for multiple database fields?

03/02/07 06:05:54 changed by Simon Willison

This would be useful for tagging interfaces as well, where you often want to enter multiple tags separated by spaces.

07/19/07 07:16:06 changed by mir@noris.de

  • stage changed from Unreviewed to Accepted.

The stage was 'Unreviewed', but from the history it should be 'Accepted'. Probably a spam-removal-relict ... I haven't looked at the details.

09/15/07 14:26:10 changed by PhiR

  • keywords set to feature_request.

01/03/08 16:18:46 changed by CollinAnderson

  • summary changed from Create an admin-input format string framework to Single form field for multiple database fields.
  • component changed from Metasystem to django.newforms.
  • stage changed from Accepted to Unreviewed.

Seems to me this is a newforms limitation.

01/03/08 16:19:02 changed by CollinAnderson

  • cc set to cmawebsite@gmail.com.

02/27/08 18:56:36 changed by jacob

  • stage changed from Unreviewed to Someday/Maybe.

06/16/08 12:13:47 changed by mrts

  • milestone set to post-1.0.

Non-essential for 1.0.


Add/Change #27 (Single form field for multiple database fields)




Change Properties
Action