Re: vs {{ form }}

2017-05-19 Thread guettli


Am Freitag, 19. Mai 2017 10:46:02 UTC+2 schrieb James Schneider:
>
>
>
> On Thu, May 18, 2017 at 8:14 AM, guettli <guettli...@thomas-guettler.de 
> > wrote:
>
>>
>>
>>
>> Am Mittwoch, 17. Mai 2017 23:14:04 UTC+2 schrieb James Schneider:
>>>
>>>
>>>
>>> On May 17, 2017 6:31 AM, "guettli" <guettli...@thomas-guettler.de> 
>>> wrote:
>>>
>>> Hi Russell Keith-Magee,
>>>
>>> which version do you use? With  or without table?
>>>
>>>{{ form }} vs {{ form }}
>>>
>>>
>>> Both of these are incorrect.
>>>
>>> You need to wrap {{ form }} in a  HTML tag. If you want it in a 
>>> table, use {{ form.as_table }}.
>>>
>>>
>>> https://docs.djangoproject.com/en/1.11/topics/forms/#form-rendering-options
>>>
>>> There is no "correct" way, it depends on your template design as to 
>>> which one is more appropriate.
>>>
>>
>>
>> Hi James,
>>
>> yes, you are right. Both ways need a surrounding  tag. Maybe I 
>> condensed my question too much.
>>
>> I don't understand the "as_table" part you wrote. AFAIK {{ form.as_table 
>> }} and {{ form }} return the same result.
>>
>
>
> Hmm, it appears you're right. I mistakenly though that {{ form }} would 
> result in something similar to {{ form.as_p }}. I haven't rendered a {{ 
> form }} without crispy-forms in quite a while.
>
>
> https://docs.djangoproject.com/en/1.11/ref/forms/api/#outputting-forms-as-html
>
> Also tested myself quickly on a current project and verified the same.
>
> In that case, both of those formats are valid and effectively equivalent. 
> My original assertion about there being no "correct" format still stands, 
> since that is based on your template design. Adding the  tags will 
> place the form inside of a true HTML table. That may or may not be what you 
> want. You may want to be more semantic if using a table and use {{ 
> form.as_table }} just to make it clear that the variable is being 
> rendered as a table, rather than relying on a default output format. That's 
> personal preference, though, but it is slightly safer if the default format 
> for {{ form }} ever changed, which I doubt will be the case any time soon.
>
> Apologies for not checking myself before sending out the response. 
>
>

No need to apology :-)

Up to now I don't use crispy forms. I think a lot of people use it. Maybe I 
should try it.

Regards,
  Thomas

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/6b5594f4-541a-4f3c-9754-9354a6f05a4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: vs {{ form }}

2017-05-19 Thread James Schneider
On Thu, May 18, 2017 at 8:14 AM, guettli <guettli.goo...@thomas-guettler.de>
wrote:

>
>
>
> Am Mittwoch, 17. Mai 2017 23:14:04 UTC+2 schrieb James Schneider:
>>
>>
>>
>> On May 17, 2017 6:31 AM, "guettli" <guettli...@thomas-guettler.de> wrote:
>>
>> Hi Russell Keith-Magee,
>>
>> which version do you use? With  or without table?
>>
>>{{ form }} vs {{ form }}
>>
>>
>> Both of these are incorrect.
>>
>> You need to wrap {{ form }} in a  HTML tag. If you want it in a
>> table, use {{ form.as_table }}.
>>
>> https://docs.djangoproject.com/en/1.11/topics/forms/#form-
>> rendering-options
>>
>> There is no "correct" way, it depends on your template design as to which
>> one is more appropriate.
>>
>
>
> Hi James,
>
> yes, you are right. Both ways need a surrounding  tag. Maybe I
> condensed my question too much.
>
> I don't understand the "as_table" part you wrote. AFAIK {{ form.as_table
> }} and {{ form }} return the same result.
>


Hmm, it appears you're right. I mistakenly though that {{ form }} would
result in something similar to {{ form.as_p }}. I haven't rendered a {{
form }} without crispy-forms in quite a while.

https://docs.djangoproject.com/en/1.11/ref/forms/api/#outputting-forms-as-html

Also tested myself quickly on a current project and verified the same.

In that case, both of those formats are valid and effectively equivalent.
My original assertion about there being no "correct" format still stands,
since that is based on your template design. Adding the  tags will
place the form inside of a true HTML table. That may or may not be what you
want. You may want to be more semantic if using a table and use {{
form.as_table }} just to make it clear that the variable is being
rendered as a table, rather than relying on a default output format. That's
personal preference, though, but it is slightly safer if the default format
for {{ form }} ever changed, which I doubt will be the case any time soon.

Apologies for not checking myself before sending out the response.

-James

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/CA%2Be%2BciWAu90pheRRCeRQVVu87t1WaZYsJZjpg0ejh4y-wa2w7w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: vs {{ form }}

2017-05-18 Thread guettli



Am Mittwoch, 17. Mai 2017 23:14:04 UTC+2 schrieb James Schneider:
>
>
>
> On May 17, 2017 6:31 AM, "guettli" <guettli...@thomas-guettler.de 
> > wrote:
>
> Hi Russell Keith-Magee,
>
> which version do you use? With  or without table?
>
>{{ form }} vs {{ form }}
>
>
> Both of these are incorrect.
>
> You need to wrap {{ form }} in a  HTML tag. If you want it in a 
> table, use {{ form.as_table }}.
>
> https://docs.djangoproject.com/en/1.11/topics/forms/#form-rendering-options
>
> There is no "correct" way, it depends on your template design as to which 
> one is more appropriate.
>


Hi James,

yes, you are right. Both ways need a surrounding  tag. Maybe I 
condensed my question too much.

I don't understand the "as_table" part you wrote. AFAIK {{ form.as_table }} 
and {{ form }} return the same result.

Regards,
  Thomas

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/53df1a23-c1bb-4331-90ed-131483ebe528%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: vs {{ form }}

2017-05-17 Thread James Schneider
On May 17, 2017 6:31 AM, "guettli" <guettli.goo...@thomas-guettler.de>
wrote:

Hi Russell Keith-Magee,

which version do you use? With  or without table?

   {{ form }} vs {{ form }}


Both of these are incorrect.

You need to wrap {{ form }} in a  HTML tag. If you want it in a
table, use {{ form.as_table }}.

https://docs.djangoproject.com/en/1.11/topics/forms/#form-rendering-options

There is no "correct" way, it depends on your template design as to which
one is more appropriate.

-James

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/CA%2Be%2BciUnJ2FDo%2BQwZKgdhek7G47C0JHE4B%3DjB%2BSQUQ0N02Wcig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: vs {{ form }}

2017-05-17 Thread Melvyn Sopacua
On Tuesday 16 May 2017 08:51:49 knbk wrote:
> On Tuesday, May 16, 2017 at 9:51:07 AM UTC+2, guettli wrote:
> > This is a basic fact, and AFAIK this basic question is not solved
> > yet.
> > 
> > {{ form }}  *  vs   * {{ form }}
> 
> That question is actually answered by the documentation
> <https://docs.djangoproject.com/en/1.11/ref/forms/api/#outputting-form
> s-as-html>
> >- For flexibility, the output does *not* include the  and
> > tags, nor does it include the  and  tags or
> >an
> > tag. It’s your job to do that.

Not sure if flexibility really is the original intent, but the Form class is 
badly named when 
you think of it as HTML forms.

It is *not* an abstraction of the HTML  tag, it's closest to an 
abstraction of the DOM 
HTMLFormElements collection. Once you see that distinction, things become a lot 
easier to 
grasp.

-- 
Melvyn Sopacua

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/3195267.aVqerAnJ1u%40devstation.
For more options, visit https://groups.google.com/d/optout.


Re: vs {{ form }}

2017-05-17 Thread Melvyn Sopacua
On Tuesday 16 May 2017 12:05:59 Jani Tiainen wrote:

> "rightway" to do things is to keep rendering (html) in the place where
> it belongs to - in templates. That's the main functionality of
> templates.

First, there's no single place to render HTML. Template rendering deals very 
poorly with nesting 
and recusion. The right place for those really is a progamming language.

Second, forms don't have to be rendered as HTML, but I agree that rendering is 
in principle the 
job of a template (but not the only place).

> Unfortunately traditionally Django forms have been doing things wrong
> and pushed HTML rendering to Python code - bascially to change your
> HTML you need to change Python code, which in production would mean
> deploying site again.

I've never experienced that as an issue (ok, maybe once). In the vast majority 
of cases, the 
changes needed to a form are not HTML related.

And this brings me to the point you're not seeing: if a tag renders a piece of 
HTML correctly for 
the majority of the cases, then by all means use it. For the exceptions, you 
can use plain HTML.

So, the reason I advised the bootstrap3 package, is that it produces the 
correct HTML 9 outof 10. 
Do I need it? No. Does it save me time? Yes, definitely. And it keeps structure 
of templates 
readable.

-- 
Melvyn Sopacua

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/2662495.ivQWgKXhZU%40devstation.
For more options, visit https://groups.google.com/d/optout.


Re: vs {{ form }}

2017-05-17 Thread Melvyn Sopacua
On Tuesday 16 May 2017 00:51:07 guettli wrote:
> Am Mittwoch, 10. Mai 2017 10:56:56 UTC+2 schrieb Melvyn Sopacua:
> > On Tuesday 09 May 2017 14:08:44 Jani Tiainen wrote:
> > > And to use bootstrap you don't need any special package, you can
> > > do it
> > > 
> > > without it just fine.
> > 
> > To render a webpage, you don't need Django you can do just fine
> > typing HTML. What's your point really?
> 
> I know that I can render a webpage without django.
> 
> What is the point?

I am on your side of the fence. Please observe thread structure and quoting.

-- 
Melvyn Sopacua

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/2138702.X2u15DLyCN%40devstation.
For more options, visit https://groups.google.com/d/optout.


Re: vs {{ form }}

2017-05-17 Thread guettli
Hi Russell Keith-Magee,

which version do you use? With  or without table?

   {{ form }} vs {{ form }}

Regards,
  Thomas

Am Dienstag, 16. Mai 2017 17:52:19 UTC+2 schrieb Russell Keith-Magee:
>
>
> On 16 May 2017, 12:51 AM -0700, guettli <guettli...@thomas-guettler.de 
> >, wrote:
>
>
> I know that real super heroes prefer the hard way. I don't like the hard 
> way. Call me wuss, pussy, weenie if you want to. 
>
>
> That kind of language is completely unnecessary. I don’t care how 
> frustrated you are - the Django community code of conduct requires that you 
> keep a civil tone. If you persist in using language like this, we’ll block 
> your account from posting.
>
> Yours,
> Russ Magee %-)
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/8901710a-b653-4fd0-b4c9-b7f82dbee174%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: vs {{ form }}

2017-05-16 Thread knbk

On Tuesday, May 16, 2017 at 9:51:07 AM UTC+2, guettli wrote:
>
>
> This is a basic fact, and AFAIK this basic question is not solved yet.
>
> {{ form }}  *  vs   * {{ form }}
>

That question is actually answered by the documentation 
<https://docs.djangoproject.com/en/1.11/ref/forms/api/#outputting-forms-as-html>
:


>- For flexibility, the output does *not* include the  and 
> tags, nor does it include the  and  tags or an 
> tag. It’s your job to do that.
>
>  

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/ee89870f-368d-4b90-8569-2a0e34071e2f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: vs {{ form }}

2017-05-16 Thread Russell Keith-Magee

On 16 May 2017, 12:51 AM -0700, guettli , 
wrote:
>
> I know that real super heroes prefer the hard way. I don't like the hard way. 
> Call me wuss, pussy, weenie if you want to.

That kind of language is completely unnecessary. I don’t care how frustrated 
you are - the Django community code of conduct requires that you keep a civil 
tone. If you persist in using language like this, we’ll block your account from 
posting.

Yours,
Russ Magee %-)

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/6c165556-d18b-4382-9797-55d8c56fcc3a%40Spark.
For more options, visit https://groups.google.com/d/optout.


Re: vs {{ form }}

2017-05-16 Thread Jani Tiainen

Hi,

"rightway" to do things is to keep rendering (html) in the place where 
it belongs to - in templates. That's the main functionality of templates.


Unfortunately traditionally Django forms have been doing things wrong 
and pushed HTML rendering to Python code - bascially to change your HTML 
you need to change Python code, which in production would mean deploying 
site again.


django-sniplates [1] is one of such library that pushes rendering 
solution to templates. Another alternative is


Fortunately Django 1.11 got template based widget rendering [2]. Which 
is the right direction.


But it's really up to you which way you choose.

[1] https://sniplates.readthedocs.io/en/latest/

[2] https://docs.djangoproject.com/en/1.11/ref/forms/renderers/

On 16.05.2017 10:51, guettli wrote:



Am Mittwoch, 10. Mai 2017 10:56:56 UTC+2 schrieb Melvyn Sopacua:

On Tuesday 09 May 2017 14:08:44 Jani Tiainen wrote:

> And to use bootstrap you don't need any special package, you can
do it

> without it just fine.

To render a webpage, you don't need Django you can do just fine
typing HTML. What's your point really?


I know that I can render a webpage without django.

What is the point?

I don't want to do the same thing over and over again.

I search simple, easy and small solutions based on solid basic facts.

This is a basic fact, and AFAIK this basic question is not solved yet.

{{ form }} /  vs/{{ form }}

The answer "do what fits" is not an answer for me. I don't want to 
waste mental energy and

think about this over and over again.

I know that real super heroes prefer the hard way. I don't like the 
hard way. Call me wuss, pussy, weenie if you want to.




--
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 django-users+unsubscr...@googlegroups.com 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto:django-users@googlegroups.com>.

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/aa114307-d17a-4c6e-b32e-d2533bac5890%40googlegroups.com 
<https://groups.google.com/d/msgid/django-users/aa114307-d17a-4c6e-b32e-d2533bac5890%40googlegroups.com?utm_medium=email_source=footer>.

For more options, visit https://groups.google.com/d/optout.


--
Jani Tiainen

--
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/3d2f30ae-3f0f-85ba-b97d-2d6274cbf324%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: vs {{ form }}

2017-05-16 Thread guettli


Am Mittwoch, 10. Mai 2017 10:56:56 UTC+2 schrieb Melvyn Sopacua:
>
> On Tuesday 09 May 2017 14:08:44 Jani Tiainen wrote:
>
>  
>
> > And to use bootstrap you don't need any special package, you can do it
>
> > without it just fine.
>
>  
>
> To render a webpage, you don't need Django you can do just fine typing 
> HTML. What's your point really?
>
>  
>

I know that I can render a webpage without django.

What is the point?

I don't want to do the same thing over and over again.

I search simple, easy and small solutions based on solid basic facts.

This is a basic fact, and AFAIK this basic question is not solved yet.

{{ form }}  *  vs   * {{ form }}

The answer "do what fits" is not an answer for me. I don't want to waste 
mental energy and
think about this over and over again.

I know that real super heroes prefer the hard way. I don't like the hard 
way. Call me wuss, pussy, weenie if you want to.



-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/aa114307-d17a-4c6e-b32e-d2533bac5890%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: vs {{ form }}

2017-05-10 Thread Melvyn Sopacua
On Tuesday 09 May 2017 14:08:44 Jani Tiainen wrote:

> And to use bootstrap you don't need any special package, 
you can do it
> without it just fine.

To render a webpage, you don't need Django you can do just 
fine typing HTML. What's your point really?

-- 
Melvyn Sopacua

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/1900443.cYJS2hrC1k%40devstation.
For more options, visit https://groups.google.com/d/optout.


Re: vs {{ form }}

2017-05-09 Thread Jani Tiainen
And, if your really want to, you can do all that manually without using 
django rendering facilities - since nothing forces you to do that. It's 
just few convenience tools to create something to start with.


That way you have full control over your forms and how they look like 
and where are all the fields placed.


And to use bootstrap you don't need any special package, you can do it 
without it just fine.


On 09.05.2017 12:13, Melvyn Sopacua wrote:


On Friday 05 May 2017 06:17:12 guettli wrote:

> Am Donnerstag, 4. Mai 2017 16:03:25 UTC+2 schrieb Todor Velichkov:

> > Take a look at:

> > 1) Form rendering options

> >  > -options> 2) Outputting forms as HTML

> >  > rms-as-html>

> >

> > {{ form }} and {{ form.as_table }} are basically the same.

> > So in terms of valid markup {{ form }} would be more

> > correct.

>

> OK, {{ form }} is what I do now. Somehow I am unsure

> if this is really the best way.

There is never a best way. Only a best way for the job.

Django's job is to provide sensible, workable defaults. Table, 
paragraph and list view are 3 common ways to render form elements.


If you however use Bootstrap for css, you're much more helped by using 
the bootstrap3 package 
. Example:




{% csrf_token %}

{% bootstrap_form form %}

{% buttons submit='Go!' %}{% endbuttons%}



--

Melvyn Sopacua

--
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 django-users+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@googlegroups.com 
.

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/9008764.HJ6FAVUOio%40devstation 
.

For more options, visit https://groups.google.com/d/optout.


--
Jani Tiainen

--
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/9717aea0-49df-ec2d-0986-5fd184cc0aa5%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: vs {{ form }}

2017-05-09 Thread Melvyn Sopacua
On Friday 05 May 2017 06:17:12 guettli wrote:
> Am Donnerstag, 4. Mai 2017 16:03:25 UTC+2 schrieb Todor Velichkov:
> > Take a look at:
> > 1) Form rendering options
> >  > -options> 2) Outputting forms as HTML
> >  > rms-as-html>
> > 
> > {{ form }} and {{ form.as_table }} are basically the same.
> > So in terms of valid markup {{ form }} would be more
> > correct.
> 
> OK,  {{ form }} is what I do now. Somehow I am unsure
> if this is really the best way.

There is never a best way. Only a best way for the job.
Django's job is to provide sensible, workable defaults. Table, paragraph and 
list view are 
3 common ways to render form elements.

If you however use Bootstrap for css, you're much more helped by using the 
bootstrap3 
package[1]. Example:


{% csrf_token %}
{% bootstrap_form form %}
{% buttons submit='Go!' %}{% endbuttons%}


-- 
Melvyn Sopacua


[1] https://djangopackages.org/packages/p/django-bootstrap3/

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/9008764.HJ6FAVUOio%40devstation.
For more options, visit https://groups.google.com/d/optout.


Re: {{ form }} vs {{ form }}

2017-05-05 Thread guettli


Am Donnerstag, 4. Mai 2017 16:03:25 UTC+2 schrieb Todor Velichkov:
>
> Take a look at:
> 1) Form rendering options 
> 
> 2) Outputting forms as HTML 
> 
>
> {{ form }} and {{ form.as_table }} are basically the same.
> So in terms of valid markup {{ form }} would be more 
> correct.
>
>
OK,  {{ form }} is what I do now. Somehow I am unsure if 
this is really the best way.

But I will do this for until I find a better solution.

Thank you Todor for your answer.

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/bcdeda9c-0c58-4d07-abfd-10409c65624b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: {{ form }} vs {{ form }}

2017-05-04 Thread Todor Velichkov
Take a look at:
1) Form rendering options 

2) Outputting forms as HTML 


{{ form }} and {{ form.as_table }} are basically the same.
So in terms of valid markup {{ form }} would be more correct.

On Thursday, May 4, 2017 at 4:46:13 PM UTC+3, guettli wrote:
>
> I am unsure how to render a form.
>
> I see these ways
>
>
>- {{ form }}  
>- {{ form }}
>
>
> If I use a model form, then the first way is the correct one.
>
>
> How to you solve this?
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/95dbd8e6-e89c-465f-b7ea-fa81d1fa3ac4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


{{ form }} vs {{ form }}

2017-05-04 Thread guettli
I am unsure how to render a form.

I see these ways


   - {{ form }}  
   - {{ form }}


If I use a model form, then the first way is the correct one.


How to you solve this?

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/b6b267c8-03a8-4021-9e49-568887540295%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Model field vs Form field vs Widget

2009-09-03 Thread Joshua Russo
On Thu, Sep 3, 2009 at 1:11 PM, alexandre...@gmail.com <
alexandre...@gmail.com> wrote:

>
> Hi, I'm a newbie on Django and would like a reference reading on model
> fields, form fields and widgets.
>
> For example I want to have a model field called CountryField that
> automatically in forms displays as a bombobox with country options.
>
> Furthermore, I want to develop a Zip Code field like the country field
> with one difference the table of Zip Codes has over a million records
> so I want do develop a widget that popus another form that let me
> search over that huge amount of records and fills back do the field.
>
>
> I just want to create model classes with special fields, and they know
> how to display themselves in forms.


The online docs are the best place to start

Models and model fields:
http://docs.djangoproject.com/en/dev/topics/db/models/
http://docs.djangoproject.com/en/dev/ref/models/fields/
http://docs.djangoproject.com/en/dev/howto/custom-model-fields/

Forms and form fields:
http://docs.djangoproject.com/en/dev/topics/forms/
http://docs.djangoproject.com/en/dev/ref/forms/fields/
http://docs.djangoproject.com/en/dev/ref/forms/validation/

Widgets:
http://docs.djangoproject.com/en/dev/ref/forms/widgets/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Model field vs Form field vs Widget

2009-09-03 Thread alexandre...@gmail.com

Hi, I'm a newbie on Django and would like a reference reading on model
fields, form fields and widgets.

For example I want to have a model field called CountryField that
automatically in forms displays as a bombobox with country options.

Furthermore, I want to develop a Zip Code field like the country field
with one difference the table of Zip Codes has over a million records
so I want do develop a widget that popus another form that let me
search over that huge amount of records and fills back do the field.


I just want to create model classes with special fields, and they know
how to display themselves in forms.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



datetime formatting (model vs. form)

2008-08-29 Thread Gerard Petersen

Hi All,

Im trying to get the date format to european (dd-mm-). I configured the 
timezone in settings.py. Since I use modelforms, should this field format be 
set in the model?

Currently the error on the form field is "Enter a valid date". Is this due to 
the model or the form field definition?

Thanx a lot!

Regards

Gerard.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---