Opened 4 years ago

Closed 4 years ago

Last modified 3 years 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.

Change History (2)

comment:1 Changed 4 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 3 years ago by akaariai

  • Component changed from ORM aggregation to Database layer (models, ORM)
Note: See TracTickets for help on using tickets.
Back to Top