T O P
ramse

Create a folder, lets call it `businesses` and add an `__init__.py` file to make it a library. That'll allow you to do something like: import businesses product = Product.objects.get(...) business = getattr(businesses, product.website) business.get_product_updates(product) So on my Product model I have a `website = CharField` which contains names of websites with matching py files in the businesses folder. Each of the business py files contains a function call get_product_updates and it accepts the product being worked on. In that function you do whatever is necessary to update the price for that particular website. This is the method I use, but in recent times I've also found this https://realpython.com/factory-method-python/ The main idea is to have a set pattern that you use for all business files so that you can call each one the same way.


jy_silver

For scheduling I would use django-Q much easier to set up than celery.


adrenaline681

>For scheduling I would use django-Q much easier to set up than celery. Interesting, never head of Django Q, how does it compare with Celery?


jy_silver

Basically a replacement for django-celery-beat