Answer the question
In order to leave comments, you need to log in
Django. How to keep in shape
PS the title had to be renamed, tk. the task was reduced - how to keep the form and I was advised accordingly.
I still have, in addition to the main app, only one app - entry_or_registration.
In the main app'e in urls I write:
url(r'see_you_later/', include('entry_or_registration.urls')),
url(r'^see_you_later/', 'entry_or_registration.views.save_registration'),
def save_registration (request ):
if request.method == 'POST':
form_user = Form_registration_user (request.POST)
if form_user.is_valid ():
form_user.save()
return render_to_response('see_you_later.html')
<form name="registration" method="post" action="see_you_later/">
{% csrf_token %}
{{ form_registration_user.as_table }}
{{ form_registration_security.as_p }}
<input type="submit" value="SignUp">
Answer the question
In order to leave comments, you need to log in
I myself am inexperienced in django, but I'll try :)
It's not clear what you want. The fields are really set in the NameForm in fields, and in the views there is the logic of processing the form after the user fills it out. Most likely there was something like this:
if form.is_valid():
args= form.save(commit=False) # принимаем данные от формы
args['поле_которое_заполняется_само'] = запрос_из_базы_данных
...
args.save()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question