views:

248

answers:

0

I have two abstract models:

class Createable(models.Model):
    createLog = models.ForeignKey(ActionLog, related_name="%(app_label)s_%(class)s_create_action_log")

    class Meta:
        abstract = True

class Deleteable(models.Model):
    deleteLog = models.ForeignKey(ActionLog, related_name="%(app_label)s_%(class)s    _delete_action_log")

    class Meta:
        abstract=True

I have about a dozen other models that inherit from Createable and/or Deleteable.

The foreign key is to a model called action log:

class ActionLog(models.Model):
    user = models.ForeignKey(User)
    recordDate = models.DateTimeField(auto_now_add=True)
    actionType = models.CharField(max_length=25)
    recordClass = models.CharField(max_length=60)
    recordId = models.IntegerField()

I get errors for all models that inherit from the two abstract models. ie:

labs.labreport: Accessor for field 'createLog' clashes with related field 'ActionLog.labs_labreport_create_action_log'. Add a related_name argument to the definition for 'createLog'. labs.labreport: Reverse query name for field 'createLog' clashes with related field 'ActionLog.labs_labreport_create_action_log'. Add a related_name argument to the definition for 'createLog'. labs.labreport: Accessor for field 'deleteLog' clashes with related field 'ActionLog.labs_labreport_delete_action_log'. Add a related_name argument to the definition for 'deleteLog'. labs.labreport: Reverse query name for field 'deleteLog' clashes with related field 'ActionLog.labs_labreport_delete_action_log'. Add a related_name argument to the definition for 'deleteLog'.

I don't see why it would still clash, given the related_name argument. Ideas anyone?