Rename stoken to etag and cstoken to stoken.

This conforms better with what people know from HTTP and properly
differentiates from CSToken which is now renamed to stoken.
This commit is contained in:
Tom Hacohen
2020-05-27 10:09:45 +03:00
parent 8eee280bbb
commit 9c63f8d674
3 changed files with 67 additions and 67 deletions

View File

@@ -46,11 +46,11 @@ class Collection(models.Model):
return self.main_item.content
@property
def stoken(self):
def etag(self):
return self.content.uid
@cached_property
def cstoken(self):
def stoken(self):
last_revision = CollectionItemRevision.objects.filter(item__collection=self).last()
if last_revision is None:
# FIXME: what is the etag for None? Though if we use the revision for collection it should be shared anyway.
@@ -77,7 +77,7 @@ class CollectionItem(models.Model):
return self.revisions.get(current=True)
@property
def stoken(self):
def etag(self):
return self.content.uid