forms.Form are python class representing an HTML form. You use them to
ask data to your user. Nothing more.

models.Model are python class representing an entry in your database.
You create them in python, always.

Sometimes, you use a form by itself. For exemple, a login form will
ask data, search a user matching these data and log you in if a user
is found.

Sometimes, you use a form to create an object. A signup form for
exemple. You will use a form to ask data then create a user object
with the data.

But even in this last exemple, the form object isn't related to the
models object, in the sense each one can live without the other and
have (nearly) non-overlapping role. The form object don't touch the
database and the model object don't provide a form.


I'm not sure I am being clear enough so don't hesitate to ask question.

2016-08-16 9:13 GMT+02:00 Gergely Polonkai <[email protected]>:
> Hello,
>
> rename migrations in your head to database migrations, or even model to
> database migrations.
>
> The migration process takes all your models and applies all the changes in
> them to your database (usually an SQL instance in the wild).
>
> Forms, on the other hand, are just that: forms, that can get some input from
> somewhere. Although they can be used to interact with models (in fact, there
> is ModelForm designed specifically for this case), they are not models,
> thus, migrations don't apply to them.
>
> Hope that makes the picture clear.
>
> Best,
> Gergely
>
>
> On Tue, Aug 16, 2016, 00:56 Pranjal Tale <[email protected]> wrote:
>>
>> Hello!
>> I was writing my models with forms.Forms and after writing when i run
>> "python manage.py makemigrations app_label" it shows the error as "app not
>> deceted".
>>
>> And at at same time when i build some models with models.Model and when i
>> run the same command so all the migrations get implemented.
>>
>> It is so that for forms based models migrations are not applied
>> If not i am unable to find the bug
>> Please Help
>> Thanks.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/f2b8c7cb-4e9c-4543-a80c-65d5bee3d935%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CACczBUK-iZkH3u_KSYkT%2B%2BO2e2%3D8ckzBk6KegSC0uQeYTwv-5Q%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEuG%2BTYgg9axWueNzGU395%3DBBUKroUKOUKLcJuzExp34%2BUmVWg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to