Re: cannot save model to db

2008-10-03 Thread Manuel Meyer
Great tip, Thanks! Here my code, just in case someone is interested: from django.db import models from django.utils.translation import ugettext as _ import Image as PilImage import settings as s import os class Gallery(models.Model): title = models.CharField(_("Name"), max_length=200)

Re: cannot save model to db

2008-10-01 Thread Manuel Meyer
Am 30.09.2008 um 20:21 schrieb Rajesh Dhawan: > > You are overriding __init__ but not making sure to call the base > class's __init__ method which does a whole bunch of stuff whenever a > new instance of a Model class is created. This is most definitely > causing your problem. It's best not to ov

Re: cannot save model to db

2008-09-30 Thread Rajesh Dhawan
> I have a model for Thumbnail, but I cannot save it. It says: > AttributeError: 'Thumbnail' object has no attribute 'id'. > What is wrong? > > I use django 1.0-final-SVN-unknown > > thanks, Manuel > > Here is an example: > > >>> from portfolio.models import Photo, Thumbnail > >>> p = Photo.obj

cannot save model to db

2008-09-30 Thread Manuel Meyer
Hey, I have a model for Thumbnail, but I cannot save it. It says: AttributeError: 'Thumbnail' object has no attribute 'id'. What is wrong? I use django 1.0-final-SVN-unknown thanks, Manuel Here is an example: >>> from portfolio.models import Photo, Thumbnail >>> p = Photo.objects.all()[0]