MikeN
MikeN

Reputation: 46327

Use a plain list instead of a list of tuples when specifying "choices" for a Django model or form field?

Can you use a plain list instead of a list of tuples when specifying "choices" for a Django model or form field?

So instead of specifying a tuple choices list like (("", ""),)

Could you specify a single item list where the display and stored value are identical?

Upvotes: 0

Views: 775

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 799150

No.

..., choices=tuple((x, x) for x in L), ...

Upvotes: 4

Related Questions