L
L
Larisa .•º2017-03-02 15:01:22
Django
Larisa .•º, 2017-03-02 15:01:22

How to initialize a form field?

There is

class TestForm(forms.ModelForm):
    class Meta:
        model = TestModel
        fields = (
                  'lforestry',

To create an object, I use generic.CreateView, I
set Tell me self.form_class = TestForm
how to assign the value lforestry = value in the form ?, there is a value, I get COOKIES

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2017-03-02
@sim3x

https://docs.djangoproject.com/en/1.10/ref/forms/a...
stackoverflow.com/questions/5113660/how-to-set-or-...
! Keep in mind that cookies from the client will need to be validated and cleared.
Therefore, it's easier not to save anything in cookies.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question