On 5/20/06, PythonistL <[EMAIL PROTECTED]> wrote: > > Question 1 > I noticed in MySQL that if a table field has NULL value, then I can > test in Python with that filed with None. > In otherwords NULL in MySQL is the same as None. in Python > Is it so or am I wrong?
yes, the null value will be None use isnull in your filters to be sure: http://www.djangoproject.com/documentation/db_api/#isnull > > Question 2. > I also would like to test NULL values in my templates. So I would like > to use something like this: > {% ifequal Price NULL %} > ..... > .... > {%else%} > ..... > {% endifequal %} > > Is that possible? NULL doesn't work there neither None.What shall I use > in the template to test NULL values in MySQL? {% if Price %} should be sufficient > > Thank you for help > L. > > > > > -- Honza Král E-Mail: [EMAIL PROTECTED] ICQ#: 107471613 Phone: +420 606 678585 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---