pip3 install pipenv
pipenv shell
If you are using Python Shopify API
and getting following error
"Exceeded 4 calls per second for api client. Reduce request rates to resume uninterrupted service."
but want your script to continue working with some timeout after that,
you can use following script from shopify_limits_patch.py
.
For that just copy shopify_limits_patch.py
to your project and import shopify_limits_patch
.
Or if you want to call it implicitly import it, remove last line patch_shopify_with_limits()
and call it before all your shopify calls.
#After looking for a way to check if a model instance can be deleted in django , | |
#i came across many sample, but was not working as expected. Hope this solution can help. | |
#Let start by creating an Abstract model class which can be inherited by other model | |
class ModelIsDeletable(models.Model): | |
name = models.CharField(max_length=200, blank=True, null=True, unique=True) | |
description = models.CharField(max_length=200, blank=True, null=True) | |
date_modified = models.DateTimeField(auto_now_add=True) | |
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
import uuid | |
from django.db import migrations, models | |
def fill_mymodel_uuid(apps, schema_editor): | |
db_alias = schema_editor.connection.alias | |
MyModel = apps.get_model('myapp', 'MyModel') |