ForeignKey django 1.1.1 model
- by Spikie
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