Hi all,

for some reason Dates are displayed as (None) in admin and in shell as well.

model.py:
# -*- coding: utf-8 -*-
from django.db import models
from django.contrib import admin


class Record(models.Model):
    date = models.DateField(_('Čas zadání'), null=True, blank=True) #, 
auto_now=True, auto_now_add=True, editable=True, blank=False)
    water = models.ForeignKey('Water', verbose_name='Voda')
    gas = models.ForeignKey('Gas', verbose_name='Plyn')
    el = models.ForeignKey('El', verbose_name='Elektřina')
    note = models.TextField('Poznámka', blank=True)

    def __unicode__(self):
        return unicode(self.date)

    class Meta:
        ordering = ['date']
        verbose_name = 'záznam'
        verbose_name_plural = 'záznamy'

class RecordAdmin(admin.ModelAdmin):
    list_display = ('date', 'water', 'gas', 'el', 'note')
    search_fields = ['date']
    date_hierarchy = 'date'
 
.
.
.

Does anybody know what could be wrong?

Thanks
Tom

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to