Closed XanderVertegaal closed 8 months ago
Thanks for the clear and extensive explanation. It's good to hear your thoughts on this. I will transfer a few fixtures I've added to the tests where they are used. There is no need to 'pollute' the global conftest.py
with these.
This PR updates the Person model (resolves #11) and outfactors
LetterActionDate
to thecore
module (resolves #18).Note: this branch is based on feature/separate-apps, which should be merged first.
In more detail:
The
unique=True
on thePersonName.person
field has been replaced by aUniqueConstraint
. Adding multiple names to one person would not work properly before, but now it does. This also removes a recurring warning about havingForeignKey(unique=True)
, which Django does not like.Person.__str__()
has been updated appropriately to deal with multiple names.Tests have been added for the display of Person names, but I am not sure if the way I did it is the way to go. (See comments below; input is appreciated.)
Added models:
Office
(fancy name for what is essentially a 'job') andOccupation
(for the relationship between aPerson
and anOffice
),PersonDateOfBirth
andPersonDateOfDeath
.The
LetterActionDate
model has been outfactored to an abstract model calledLettercraftDate
. The following models subclass it:LetterEventDate
,PersonDateOfBirth
,PersonDateOfDeath
,Occupation
.Running
pytest
displayed warnings about a deprecated setting insettings.py
. Since we do not use it and it does not have a function anymore, I removed it.