Skip to content

Commit

Permalink
🎨 Clean up order of methods in models
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei-maertens committed Dec 8, 2023
1 parent ac1a636 commit f430c48
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions cookie_consent/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,19 @@ class Meta:
def __str__(self):
return self.name

def get_version(self) -> str:
try:
return str(self.cookie_set.all()[0].get_version())
except IndexError:
return ""
@clear_cache_after
def save(self, *args, **kwargs):
super().save(*args, **kwargs)

@clear_cache_after
def delete(self, *args, **kwargs):
return super().delete(*args, **kwargs)

@clear_cache_after
def save(self, *args, **kwargs):
super().save(*args, **kwargs)
def get_version(self) -> str:
try:
return str(self.cookie_set.all()[0].get_version())
except IndexError:
return ""

def for_json(self) -> CookieGroupDict:
return {
Expand Down Expand Up @@ -123,21 +123,21 @@ class Meta:
def __str__(self):
return "%s %s%s" % (self.name, self.domain, self.path)

@clear_cache_after
def save(self, *args, **kwargs):
super().save(*args, **kwargs)

@clear_cache_after
def delete(self, *args, **kwargs):
return super().delete(*args, **kwargs)

@property
def varname(self):
return "%s=%s:%s" % (self.cookiegroup.varname, self.name, self.domain)

def get_version(self):
return self.created.isoformat()

@clear_cache_after
def delete(self, *args, **kwargs):
return super().delete(*args, **kwargs)

@clear_cache_after
def save(self, *args, **kwargs):
super().save(*args, **kwargs)


ACTION_ACCEPTED = 1
ACTION_DECLINED = -1
Expand Down

0 comments on commit f430c48

Please sign in to comment.