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

feat(Besoins): mettre à jour automatiquement la date de transaction #1122

Merged
merged 2 commits into from
Mar 11, 2024

Conversation

raphodn
Copy link
Contributor

@raphodn raphodn commented Mar 8, 2024

Quoi ?

Suite de #1116

Dès que le champ siae_transactioned change, on met à jour siae_transactioned_last_updated

Comment ?

Grâce à un mécanisme similaire au modèle Siae, avec TRACK_UPDATE_FIELDS

  • note : cela marche que avec des save(), pas des bulk update()

Copy link
Contributor

@SebastienReuiller SebastienReuiller left a comment

Choose a reason for hiding this comment

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

LGTM !

https://stackoverflow.com/a/23363123
"""
super().__init__(*args, **kwargs)
for field_name in self.TRACK_UPDATE_FIELDS:
Copy link
Contributor

Choose a reason for hiding this comment

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

Je n'avais pas vu cette astuce, très sympa !

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, après je me dis que ça doit être factorisable dans une classe + héritage ? À noter dans la refactoring-to-do-list ^^

@raphodn raphodn merged commit 4f502e7 into master Mar 11, 2024
5 checks passed
@raphodn raphodn deleted the raphodn/tender-siae-transactioned-last-updated-set branch March 11, 2024 10:22
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