andrewdodd / django-nsync

A simple way to keep your Django Model data 'n-sync with N external systems.
MIT License
14 stars 3 forks source link

Feedback on progress of the import #13

Closed gregoriopellegrino closed 6 years ago

gregoriopellegrino commented 6 years ago

Hi, I have some big imports to do (programmatically) and it would be very useful to have a function that gives the feedback on progress of the import.

Is there something that can help me?

Gregorio

andrewdodd commented 6 years ago

Hi Gregorio,

Sorry I don't really use this library very much anymore, but I'm glad that someone is!

It might be worth you implementing your own policy? One that is similar the ones in the policies.py module? Maybe something like this:

class NotifyStepsPolicy:
    def __init__(self, actions, callback):
        self.actions = actions
        self.callback = callback

    def execute(self):
        for action in self.actions:
            action.execute()
            self.callback(action)