Thursday, April 20, 2017

Re: First models.py needs tuning

On Wed, 19 Apr 2017, Mike Dewhirst wrote:

> You probably need a single FK plus a meta option of unique_together
> https://docs.djangoproject.com/en/1.8/ref/models/options/#unique-together

Mike,

Okay. What would be the correct syntax for
PRIMARY KEY unique_together=('company', 'person', 'proj_nbr')

> Use the model's clean() method ...
> https://docs.djangoproject.com/en/1.8/ref/models/instances/#django.db.models.Model.clean

This I'll need to ponder more to figure out where to put the clean method
so it validates entries before they're saved.

Thanks,

Rich

No comments:

Post a Comment