analytics/models: Remove extended_id and key_model.

They are unused / were part of a previous design.
This commit is contained in:
Rishi Gupta
2017-03-08 19:41:07 -08:00
committed by Tim Abbott
parent b648c06009
commit e33ef1c788

View File

@@ -61,31 +61,11 @@ class BaseCount(ModelReprMixin, models.Model):
class Meta(object):
abstract = True
@staticmethod
def extended_id():
# type: () -> Tuple[str, ...]
raise NotImplementedError
@staticmethod
def key_model():
# type: () -> models.Model
raise NotImplementedError
class InstallationCount(BaseCount):
class Meta(object):
unique_together = ("property", "subgroup", "end_time")
@staticmethod
def extended_id():
# type: () -> Tuple[str, ...]
return ()
@staticmethod
def key_model():
# type: () -> models.Model
return None
def __unicode__(self):
# type: () -> Text
return u"<InstallationCount: %s %s %s>" % (self.property, self.subgroup, self.value)
@@ -97,16 +77,6 @@ class RealmCount(BaseCount):
unique_together = ("realm", "property", "subgroup", "end_time")
index_together = ["property", "end_time"]
@staticmethod
def extended_id():
# type: () -> Tuple[str, ...]
return ('realm_id',)
@staticmethod
def key_model():
# type: () -> models.Model
return Realm
def __unicode__(self):
# type: () -> Text
return u"<RealmCount: %s %s %s %s>" % (self.realm, self.property, self.subgroup, self.value)
@@ -121,16 +91,6 @@ class UserCount(BaseCount):
# aggregating from users to realms
index_together = ["property", "realm", "end_time"]
@staticmethod
def extended_id():
# type: () -> Tuple[str, ...]
return ('user_id', 'realm_id')
@staticmethod
def key_model():
# type: () -> models.Model
return UserProfile
def __unicode__(self):
# type: () -> Text
return u"<UserCount: %s %s %s %s>" % (self.user, self.property, self.subgroup, self.value)
@@ -145,16 +105,6 @@ class StreamCount(BaseCount):
# aggregating from streams to realms
index_together = ["property", "realm", "end_time"]
@staticmethod
def extended_id():
# type: () -> Tuple[str, ...]
return ('stream_id', 'realm_id')
@staticmethod
def key_model():
# type: () -> models.Model
return Stream
def __unicode__(self):
# type: () -> Text
return u"<StreamCount: %s %s %s %s %s>" % (self.stream, self.property, self.subgroup, self.value, self.id)