<s> from django . db import models <EOL> import json_field <EOL> from olympia . amo . models import ModelBase <EOL> class CompatReport ( ModelBase ) : <EOL> guid = models . CharField ( max_length = <NUM_LIT> ) <EOL> version = models . CharField ( max_length = <NUM_LIT> ) <EOL> app_guid = models . CharField ( max_length = <NUM_LIT> ) <EOL> app_version = models . CharField ( max_length = <NUM_LIT> ) <EOL> app_build = models . CharField ( max_length = <NUM_LIT> ) <EOL> client_os = models . CharField ( max_length = <NUM_LIT> ) <EOL> client_ip = models . CharField ( max_length = <NUM_LIT> ) <EOL> comments = models . TextField ( ) <EOL> other_addons = json_field . JSONField ( ) <EOL> works_properly = models . BooleanField ( default = False ) <EOL> class Meta : <EOL> db_table = '<STR_LIT>' <EOL> @ classmethod <EOL> def get_counts ( self , guid ) : <EOL> works = dict ( CompatReport . objects . filter ( guid = guid ) <EOL> . values_list ( '<STR_LIT>' ) <EOL> . annotate ( models . Count ( '<STR_LIT:id>' ) ) ) <EOL> return { <EOL> '<STR_LIT:success>' : works . get ( True , <NUM_LIT:0> ) , <EOL> '<STR_LIT>' : works . get ( False , <NUM_LIT:0> ) <EOL> } <EOL> class AppCompat ( ModelBase ) : <EOL> """<STR_LIT>""" <EOL> class Meta : <EOL> abstract = True <EOL> db_table = '<STR_LIT>' <EOL> class CompatTotals ( ModelBase ) : <EOL> """<STR_LIT>""" <EOL> app = models . PositiveIntegerField ( ) <EOL> total = models . PositiveIntegerField ( ) <EOL> class Meta : <EOL> db_table = '<STR_LIT>' </s>
