X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/3546a2b2d5f52224bcf95803030611ab505f29cd..22aac0da99594406b261f14c135812c855c196ef:/apps/api/models.py?ds=sidebyside diff --git a/apps/api/models.py b/apps/api/models.py deleted file mode 100644 index ac694880..00000000 --- a/apps/api/models.py +++ /dev/null @@ -1,33 +0,0 @@ -from django.db import models - -# Create your models here. -class PartCache(models.Model): - document_id = models.CharField(max_length=255) - user_id = models.CharField(max_length=64, blank=True) - part_id = models.CharField(max_length=255) - - @classmethod - def update_cache(me, docid, userid, old, new): - old = set(old) - new = set(new) - - related = me.objects.filter(user_id=userid, document_id=docid) - - missing = old.difference(new) - related.filter(part_id__in=missing).delete() - - created = new.difference(old) - - for part in created: - me.objects.create(user_id=userid, document_id=docid, part_id=part) - - - - - - - - - - - \ No newline at end of file