mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 14:03:30 +00:00 
			
		
		
		
	analytics/models: Remove extended_id and key_model.
They are unused / were part of a previous design.
This commit is contained in:
		@@ -61,31 +61,11 @@ class BaseCount(ModelReprMixin, models.Model):
 | 
				
			|||||||
    class Meta(object):
 | 
					    class Meta(object):
 | 
				
			||||||
        abstract = True
 | 
					        abstract = True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @staticmethod
 | 
					 | 
				
			||||||
    def extended_id():
 | 
					 | 
				
			||||||
        # type: () -> Tuple[str, ...]
 | 
					 | 
				
			||||||
        raise NotImplementedError
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @staticmethod
 | 
					 | 
				
			||||||
    def key_model():
 | 
					 | 
				
			||||||
        # type: () -> models.Model
 | 
					 | 
				
			||||||
        raise NotImplementedError
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
class InstallationCount(BaseCount):
 | 
					class InstallationCount(BaseCount):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    class Meta(object):
 | 
					    class Meta(object):
 | 
				
			||||||
        unique_together = ("property", "subgroup", "end_time")
 | 
					        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):
 | 
					    def __unicode__(self):
 | 
				
			||||||
        # type: () -> Text
 | 
					        # type: () -> Text
 | 
				
			||||||
        return u"<InstallationCount: %s %s %s>" % (self.property, self.subgroup, self.value)
 | 
					        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")
 | 
					        unique_together = ("realm", "property", "subgroup", "end_time")
 | 
				
			||||||
        index_together = ["property", "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):
 | 
					    def __unicode__(self):
 | 
				
			||||||
        # type: () -> Text
 | 
					        # type: () -> Text
 | 
				
			||||||
        return u"<RealmCount: %s %s %s %s>" % (self.realm, self.property, self.subgroup, self.value)
 | 
					        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
 | 
					        # aggregating from users to realms
 | 
				
			||||||
        index_together = ["property", "realm", "end_time"]
 | 
					        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):
 | 
					    def __unicode__(self):
 | 
				
			||||||
        # type: () -> Text
 | 
					        # type: () -> Text
 | 
				
			||||||
        return u"<UserCount: %s %s %s %s>" % (self.user, self.property, self.subgroup, self.value)
 | 
					        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
 | 
					        # aggregating from streams to realms
 | 
				
			||||||
        index_together = ["property", "realm", "end_time"]
 | 
					        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):
 | 
					    def __unicode__(self):
 | 
				
			||||||
        # type: () -> Text
 | 
					        # type: () -> Text
 | 
				
			||||||
        return u"<StreamCount: %s %s %s %s %s>" % (self.stream, self.property, self.subgroup, self.value, self.id)
 | 
					        return u"<StreamCount: %s %s %s %s %s>" % (self.stream, self.property, self.subgroup, self.value, self.id)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user