Задать вопрос

Тел: +7 965 3737 888

416

Просмотров

0

Ответов

CodeLookupField

This is a custom form-field designed to make those optional "enter a discount code" fields a little easier to deal with. You create one like this:

code = CodeLookupField(model=MyModel, field_name='slug', max_length=20)

And then when you validate your form, cleaned_data['code'] will be the actual object if anything was retrieved, or None if the user entered a bad piece of data.

Вопрос полезен? Да0/Нет0
file_2324.py(419.0б)
None