Hi,
Let me see if i understand, you want put <fielset> and <section> per field?
Because if you want customize per field, you can iterate in fields of form
like this:
*{% for field in form %}*
<div>
<fieldset>
<section>
<label class="input" for="id_*{{ field.html_name }}*">*{{
field.label }}*
* {{ field }}*
</label>
</section>
</fieldset>
</div>
*{% endfor %}*
This pages can be useful, but is a little more advanced:
https://docs.djangoproject.com/en/dev/ref/forms/widgets/
https://docs.djangoproject.com/en/dev/topics/forms/#customizing-the-form-template
https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#howto-custom-template-tags-inclusion-tags
I hope this help you.
Cheers.
On Fri, Apr 11, 2014 at 8:15 AM, Fred DJar <[email protected]> wrote:
> Thanks for the response.But in my case i use customized html tags like
> <filedset> and <section>:
>
> <div>
> <fieldset>
> <section>
> <label class="input">
> <input type="text" placeholder="E-Mail">
> </label>
> </section>
> </fieldset>
> </div>
>
> so how to deal with html tags like <fieldset> and <section> and add them
> to the email param
>
> On Friday, 11 April 2014 12:08:19 UTC+1, Lucas Klassmann wrote:
>
>> Hi Fred.
>>
>> You must put {% block %} {% endblock %} in html where you want allow
>> override in others base.html descendants.
>>
>> Like this:
>>
>> # base.html
>>
>> <html>
>> <head>
>> <title>{% block title %}{% endblock %}</title>
>> </head>
>> <body>
>>
>> <form action="" method="POST">
>> <!-- Fields -->
>> {% block fields %}{% endblock %}
>> <input type="submit" value="Save" name="save">
>> </form>
>> </body>
>> </html>
>>
>>
>>
>> # other.html
>>
>> {% extends "base.html" %}
>>
>> {% block title %}My Title{% endblock %}
>>
>> {% block fields %}
>>
>> Subscribe: <input type="text" name="email" value="">
>>
>> {% endblock %}
>>
>>
>> Cheers.
>>
>>
>> On Fri, Apr 11, 2014 at 7:57 AM, Fred DJar <[email protected]> wrote:
>>
>>> ANY IDEA GUYS?
>>>
>>> On Thursday, 27 March 2014 13:48:47 UTC, Fred DJar wrote:
>>>>
>>>> Hello,
>>>> I am a beginner in python and django programming, i have a question
>>>> that already have been asked in stackoverflow and many forums, but i
>>>> couldnt solve my own.
>>>>
>>>> this exactly my situation:
>>>>
>>>> this the code in my app html page:
>>>>
>>>> *{% extends 'base.html' %}*
>>>>
>>>> *{% block content %}*
>>>>
>>>> *<form method="POST" action=""> {% csrf_token %} *
>>>> * {{ form.as_p }} *
>>>> * <footer>*
>>>> * <button type="submit" class="button">Confirmer</button>*
>>>> * </footer> *
>>>> *</form>*
>>>>
>>>> *{% endblock %}*
>>>>
>>>>
>>>>
>>>> but in my base.html i have already this form and this classes:
>>>>
>>>>
>>>> *<form action="" class="sky-form">*
>>>> * <section>*
>>>> * <label class="input">*
>>>> * <input type="password" placeholder="Confirmation">*
>>>> * <b class="tooltip tooltip-bottom-right">Retaper votre
>>>> mot de passe</b>*
>>>> * </label>*
>>>> * </section>*
>>>> *.*
>>>> *.*
>>>> *.*
>>>> *.*
>>>> *</form>*
>>>>
>>>>
>>>> where should i put *{% block content %}* and *{% endblock %}* in my
>>>> base.html!!!!!!
>>>>
>>>> i've also followed the tutorial from the official docs, but it did,'t
>>>> work out for me
>>>>
>>>> i'm sorry if my question seem silly!
>>>> Thanks in advance.
>>>>
>>> --
>>> 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 http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit https://groups.google.com/d/
>>> msgid/django-users/b8c9cb20-87e1-43b3-9238-04683a36aaf4%
>>> 40googlegroups.com<https://groups.google.com/d/msgid/django-users/b8c9cb20-87e1-43b3-9238-04683a36aaf4%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Lucas Klassmann
>> Desenvolvedor de Software
>>
>> Email: [email protected]
>> Web site: http://www.lucasklassmann.com
>>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8e009105-9413-4550-9709-7f932dfa8238%40googlegroups.com<https://groups.google.com/d/msgid/django-users/8e009105-9413-4550-9709-7f932dfa8238%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
--
Lucas Klassmann
Desenvolvedor de Software
Email: [email protected]
Web site: http://www.lucasklassmann.com
--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CAOz50p%2Bs%2B5pjepbKsYExNhPO%3DjBw8CusnKwRHUFaq6hKRCYZkg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.