Code

Opened 2 years ago

Closed 2 years ago

Last modified 14 months ago

#17727 closed New feature (wontfix)

Multiple values for Fields

Reported by: anonymous Owned by: nobody
Component: Database layer (models, ORM) Version: 1.4-beta-1
Severity: Normal Keywords: multiple values
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I think we should support multiple values for fields. Example:

""" <= 0: unlimited, 1: default"""
emails = models.EmailField(max_length=128, limit=5)

Like Drupal is doing, single value field, we store the value in same table; multiple values, we create new table.

Attachments (0)

Change History (2)

comment:1 Changed 2 years ago by akaariai

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

The normal way to do this in SQL is by using ForeignKeys, which you can already do (the limit=5 requires a little validation code, though). What you could have is a ListField containing multiple emails. I think django-nonrel has something like that, and it would be a nice feature when using SQL databases, too.

I am going to close this one as wontfix, as the feature as presented doesn't fit into Django. EmailField should represent a single value, stored in a single column. It would be nice to be able to do ListField(EmailField(), limit=5). But the basic fields should remain single-valued.

comment:2 Changed 14 months ago by akaariai

  • Component changed from ORM aggregation to Database layer (models, ORM)

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.