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

Add ModelTopicProducer to cover generic model producing functionality #21

Open
stefan-cardnell-rh opened this issue Oct 4, 2024 · 0 comments

Comments

@stefan-cardnell-rh
Copy link
Contributor

stefan-cardnell-rh commented Oct 4, 2024

Add a class (ModelTopicProducer) to handle some generic functionality desired for syncing model instances between systems:

  1. Has a model attribute and attaches to post_save/post_delete signals of this model.
  2. Has an (optional) through_model attribute and attaches to m2m_changed.post_add signal.
  3. Provides an abstract method produce_for which takes an instance of the model, which subclasses must implement to produce the event.
  4. Provides an initialize method which initialises the topic with some initial events generated by a queryset of the model argument.
@stefan-cardnell-rh stefan-cardnell-rh self-assigned this Oct 4, 2024
@stefan-cardnell-rh stefan-cardnell-rh removed their assignment Oct 23, 2024
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

No branches or pull requests

1 participant