I cannot figure out how to add relation between tables.
class MyModel(BaseModel): a = peewee.TextField() b = peewee.TextField() c = peewee.IntegerField() d = peewee.TextField() e = peewee.FloatField() f = peewee.FloatField() class Meta: primary_key = peewee.CompositeKey('a', 'b', 'c', 'd') class RModel(BaseModel): """ """ record = peewee.ForeignKeyField(MyModel, related_name='record') date = peewee.DateTimeField(default=datetime.datetime.now)
I want to guaranteed that ‘a’, ‘b’, ‘c’, ‘d’ fields in MyModel will creates unique combination. (unique together)
I also would like to add relation to this table to RModel table.
I am still getting
AttributeError: 'CompositeKey' object has no attribute 'get_db_field'