ForeignKey django 1.1.1 model

Posted by Spikie on Stack Overflow See other posts from Stack Overflow or by Spikie
Published on 2010-03-31T14:02:01Z Indexed on 2010/03/31 14:03 UTC
Read the original article Hit count: 344

Filed under:

i have

class staff_name(models.Model):

firstname = models.CharField(max_length=150)
surname = models.CharField(max_length=150)

class inventory_transaction(models.Model):

staffs = models.ForeignKey(staff_name)

i want to get or create staff surname and first name through inventory_transaction

i used these code below

inventory_transaction.objects.get_or_create(staffs_surname_contains=sname,staffs_firstname_contains=fname)

i got this error "staffs_surname_contains can not be defined"

what have i done wrong ?

thanks

© Stack Overflow or respective owner

Related posts about django-models