Hi,

I have some troubles with my Django model: whenever I create a new
object the ID (primary key) is not being assigned to it after calling
obj.save().

I am on RHEL with Python 2.4.3 and Django 1.2.1 (with MySQL backend).

I've uploaded a code snippet which clearly shows the problem:
http://pastebin.com/qtRgZVQY

For the reference, this is the model I am using:
class Attribute(models.Model):
    id = models.PositiveIntegerField( db_column='attribute_id',
primary_key=True )
    name = models.CharField(max_length=255,
db_column='attribute_name', unique=True)
    _touchDate =
models.DateTimeField( db_column='attribute_touchDate', editable=False,
auto_now=True)
    _touchUser = models.CharField(max_length=255,
db_column='attribute_touchUser', editable=False, default='Unknown')

    class Meta:
        db_table = 'attribute'
        app_label = 'lib'
        ordering = ( 'name', )

    def __unicode__(self):
        return self.name

Could anybody point me into some directions in order to solve the
problem?

Regards,
Daniel

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