Login

Tag "separated"

Snippet List

SeparatedValuesField

A Django newforms field which takes another newforms field during initialization and validates every item in a comma-separated list with this field class. Please use it like this: from django.newforms import EmailField emails = CommaSeparatedValuesField(EmailField) You would be able to enter a string like "[email protected],[email protected]" because every email address would be validated when clean() is executed. This of course also applies to any other Field class. You can define the sepator (default: ",") during initialization with the `separator` parameter like this: from django.newforms import EmailField` emails = SeparatedValuesField(EmailField, separator="###")

  • newforms
  • field
  • comma
  • separated
Read More

1 snippet posted so far.