Re: Problem with abstract model class

2008-05-16 Thread Legioneer
: abstract = True On 16 май, 18:25, Julien <[EMAIL PROTECTED]> wrote: > Hi, > > I think it should be %(class)s, not %s(class)s    (take out the first > 's') > > Julien > > On May 16, 11:33 pm, Legioneer <[EMAIL PROTECTED]> wrote: > > > Hi All

Problem with abstract model class

2008-05-16 Thread Legioneer
Hi All, Got a problem when trying to define an abstract class. Below there is an examle: class PaymentData(models.Model): owner = models.ForeignKey(Customer, related_name="%s(class)s_related" ) class Meta: abstract = True When running 'python manage.py validate' receive an erro

Re: How to display images in Admin change page?

2008-04-17 Thread Legioneer
ck <[EMAIL PROTECTED]> wrote: > On Thu, 2008-04-17 at 07:00 -0700, Legioneer wrote: > > Hi All! > > > Trying to get a solution for a problem. I have a model which has one > > to many relationship with another model which contains an ImageField. > > E.g:

How to display images in Admin change page?

2008-04-17 Thread Legioneer
Hi All! Trying to get a solution for a problem. I have a model which has one to many relationship with another model which contains an ImageField. E.g: class Person(models.Model): name = models.CharField(max_length=512) class Image(models.Model): image = models.ImageField(upload_to='/im

Re: JSON serializers.serialize raises DoesNotExist on recursive data structures

2008-04-02 Thread Legioneer
) raises DoesNotExist exception where c = Category.objects.filter(parent__exact=0) On Apr 2, 1:07 pm, Legioneer <[EMAIL PROTECTED]> wrote: > yes. in admin there are no problems with it. > > On Apr 2, 4:40 am, 1234 <[EMAIL PROTECTED]> wrote: > > > Is this model work on in admin? &

Re: JSON serializers.serialize raises DoesNotExist on recursive data structures

2008-04-02 Thread Legioneer
yes. in admin there are no problems with it. On Apr 2, 4:40 am, 1234 <[EMAIL PROTECTED]> wrote: > Is this model work on in admin? > > 2008/4/1, Legioneer <[EMAIL PROTECTED]>: > > > > > My data model is very similar to your: > > > class Category(model

Re: JSON serializers.serialize raises DoesNotExist on recursive data structures

2008-04-01 Thread Legioneer
My data model is very similar to your: class Category(models.Model): name = models.CharField(max_length=64) descr = models.CharField(max_length=255, blank=True) rank = models.PositiveIntegerField(default=10) parent = models.ForeignKey('self', null=True, blank=True,

Re: JSON serializers.serialize raises DoesNotExist on recursive data structures

2008-04-01 Thread Legioneer
egory.objects.all() it > should work. > > Hope that helps, > Michael > > On Mon, Mar 31, 2008 at 5:39 AM, Legioneer <[EMAIL PROTECTED]> wrote: > > > Hi All, > > > I'm trying to serialize recursive model (a category which refers to > > itself) a

JSON serializers.serialize raises DoesNotExist on recursive data structures

2008-03-31 Thread Legioneer
Hi All, I'm trying to serialize recursive model (a category which refers to itself) and get a 'DoesNotExist: Category matching query does not exist', while other models work fine. Does anyone know a clue for this? I'm doing like this: from django.core import serializers; from newproject.models

Re: Does __unicode__() work in 0.96.1?

2008-03-27 Thread Legioneer
> > > The unicode branch was merged after the 0.96 release, thus 9.96.1 does not > > include its benefits... > > I meant 0.96.1 of course. thanks a lot --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" g

Does __unicode__() work in 0.96.1?

2008-03-27 Thread Legioneer
Hi All, I use django 0.96.1 on CentOS 4 box (python 2.3.4). When use __str__() in model definitions everything is fine, but when change it to __unicode__() I don't see it working (e.g. in admin interface there is a default output). Does 0.96.1 support __unicode__() or I should move to SVN versio