Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a authorities/responsabilities models #225

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

AnasGhrab
Copy link
Collaborator

For a better management of persons and related informations.

@yomguy
Copy link
Member

yomguy commented Jun 24, 2020

Thanks a lot @AnasGhrab for this PR. I will review it next week.

@yomguy yomguy changed the base branch from master to dev June 24, 2020 15:58
Copy link
Member

@yomguy yomguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @AnasGhrab, review done. As commented, I think you should update the on_delete parameters to avoid before we can merge. Everything else is really fine, thanks! 👎

authority = models.ForeignKey('Authority', on_delete = models.CASCADE)
role = models.ForeignKey('Role', on_delete = models.CASCADE)
item = models.ForeignKey('MediaItem', on_delete = models.CASCADE)
collection = models.ForeignKey('MediaCollection', on_delete = models.CASCADE)
Copy link
Member

@yomguy yomguy Jul 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For those 4 fields, to avoid cascade deleting, I strongly advise to set on_delete=models.SET_NULL.
If not, in this case and for example, a Responsability could be deleted when the related Role or Item is deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants