You've got a lot of models in that file.  Which one are you trying to
save when it throws the error?

By the way, I notice that your "ItemWithMedia" class is probably
creating a database table.. if you never need to manipulate it direct
(ie, you only make subclasses of it), I might suggest putting this in
the definition:

    class ItemWithMedia(models.Model):
        # ... all of your old stuff goes here
        class Meta:
            abstract = True

That way Django knows it's just a base class.

Not sure what the problem is, yet...

On Nov 27, 3:27 pm, onoxo <vedran.ko...@gmail.com> wrote:
> btw. here is a full code:
>
> models.pyhttp://snipt.net/vedran/django-models-cannot-assign-none?key=ba151d53...
>
> admin.pyhttp://snipt.net/vedran/django-admin-cannot-assign-none?key=53222b89c...
>
> so... when i go to create new Actual item i get this error:
> Cannot assign None: "Actual.published" does not allow null values.
>
> On Nov 27, 10:57 pm, onoxo <vedran.ko...@gmail.com> wrote:
>
>
>
> > i get this error when i try to create new item in admin site.
>
> > here is my models.py
> > import datetime
> > from django.db import models
> > from tinymce import models as tinymce_models
> > from filebrowser.fields import FileBrowseField
>
> > class ItemWithMedia(models.Model):
> >     created = models.DateTimeField(auto_now_add=True)
> >     modified = models.DateTimeField(auto_now=True)
>
> > class Actual(ItemWithMedia):
> >     published = models.DateField('Published')
> >     title_hr = models.CharField('(hr)', max_length=200)
> >     title_en = models.CharField('(en)', max_length=200)
> >     body_text_hr = models.TextField('(hr)')
> >     body_text_en = models.TextField('(en)')
>
> >     def __unicode__(self):
> >         return self.title_hr
>
> >     class Meta:
> >         verbose_name = "Aktualno"
> >         verbose_name_plural = "Aktualni"
> >         ordering = ['-published']
>
> > what could be the problem?

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.


Reply via email to