Code: Models
class A1(models.Model):
user = models.ForeignKey(User)
field1 = models.CharField(max_length=200)
field2 = models.CharField(max_length=200)
class A2(models.Model):
user = models.ForeignKey(User)
field1 = models.CharField(max_length=200)
field2 = models.CharField(max_length=200)
field3 = models.CharField(max_length=200)
Usage:
def insertRecord(modelName, fields, user)
record = modelName(User=user, **fields)
record.save()
Error: 'unicode' object is not callable.
Input: modelName: A2 fields: {u'field1': u'd2d2d2', u'field2': u'e2e2e2', u'field3': u'f2f2f2'} type(fields): 'dict'
Any solution/work around for this please ? Thanks,