Project

Profile

Help

Task #3025

closed

natural key fields are defined in two places

Added by dkliban@redhat.com over 6 years ago. Updated about 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
% Done:

0%

Estimated time:
Platform Release:
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
Sprint:
Sprint 26
Quarter:

Description

All models inheriting from Content define a 'unique together' set of fields. Content model also has a natural_key_fields tuple. As a result we have uniqueness defined in two place. To keep things DRY we should only define the uniqueness as part of the class Meta. Example of how this can work is already implemented in pulp_example[0].

[0] https://github.com/dkliban/pulp_example/blob/master/pulp_example/app/models.py#L89

Also available in: Atom PDF