Add ModelTopicProducer to cover generic model producing functionality
Opened this issue · 0 comments
stefan-cardnell-rh commented
Add a class (ModelTopicProducer
) to handle some generic functionality desired for syncing model instances between systems:
- Has a
model
attribute and attaches topost_save
/post_delete
signals of this model. - Has an (optional)
through_model
attribute and attaches tom2m_changed.post_add
signal. - Provides an abstract method
produce_for
which takes an instance of the model, which subclasses must implement to produce the event. - Provides an
initialize
method which initialises the topic with some initial events generated by a queryset of themodel
argument.