[Pulp-dev] natural key fields (task #3025)

Michael Hrivnak mhrivnak at redhat.com
Thu Sep 28 13:38:31 UTC 2017


Sounds great. It's valuable to have reasonable default behaviors in the
core.

On Tue, Sep 26, 2017 at 7:54 AM, Dennis Kliban <dkliban at redhat.com> wrote:

> The Content model in pulpcore defines a 'natural_key_fields' tuple that
> models inheriting from it need to populate with field names that make that
> content type unique. At the same time each model defines database
> uniqueness constraints in the Class Meta of the model.
>
> In pulp_example[0] I've demonstrated how the database uniqueness
> constraint can be used to get a list of all of the unique fields for
> content. As part of this task I'd like to move this code out of
> pulp_example and into pulpcore so all plugins can use it. I will also
> remove the 'natural_key_fields' tuple.
>
> Thoughts? Objections?
>
>
>
> [0] https://github.com/pulp/pulp_example/blob/master/pulp_
> example/app/models.py#L111
>
> _______________________________________________
> Pulp-dev mailing list
> Pulp-dev at redhat.com
> https://www.redhat.com/mailman/listinfo/pulp-dev
>
>


-- 

Michael Hrivnak

Principal Software Engineer, RHCE

Red Hat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/pulp-dev/attachments/20170928/d759af69/attachment.htm>


More information about the Pulp-dev mailing list