Hi,
I have some strange problem with django. I have modules.py something
like this:

class Link(models.Model):
    nazwa = models.CharField(maxlength=50, verbose_name="Tytul Linka")
    [...]
    ocena = models.IntegerField(verbose_name="Ocena", editable="False",
default=0)
    s_ocen = models.IntegerField(verbose_name="Suma ocen",
editable="False", default=0)
    l_ocen = models.IntegerField(verbose_name="Liczba ocen",
editable="False", default=0)
    class Admin:
        fields = (
            ('Link', {'fields': ('nazwa', 'adres', 'autor',
'subkategoria', 'serwis', 'opis',)}),
            ('Detale', {'fields': ('pub_date','dodal', 'ocena',
's_ocen', 'l_ocen',)}),
        )
        list_display = ('nazwa', 'subkategoria', 'serwis', 'autor',
'dodal', 'pub_date', )
        list_filter = ['autor', 'serwis', 'dodal','pub_date']
        search_fields = ['nazwa']
        pass
    def __str__(self):
        return self.nazwa

And where is my problem? I would like to do that fields: "ocena, s_ocen
and l_ocen" will not be editable by admin panel. That's why I puted
default=0 for them. But while I will delete those fileds from admin
panel, by editing to something like that:
        fields = (
            ('Link', {'fields': ('nazwa', 'adres', 'autor',
'subkategoria', 'serwis', 'opis',)}),
            ('Detale', {'fields': ('pub_date','dodal',)}),
        )
It is not working. When I try to add something by panel it sais that I
have to fix some errors, and those error is fact that, those 3
field(ocena s_ocen l_ocen) that are not displayed in panel are empty.
Default=0 isn't working - and my question is why?


--~--~---------~--~----~------------~-------~--~----~
 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to