class Migration(migrations.Migration): """ Default schema of freeradius 3. radius app's model schema begins from next migration, this helps to enable users to migrate from freeradius 3 """ initial = True nas_model = swapper.get_model_name('openwisp_radius', 'Nas') model_app_label = swapper.split(nas_model)[0] dependencies = [(model_app_label, '__first__')] operations = [ migrations.CreateModel( name='Nas', fields=[ ( 'id', models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name='ID', ), ), ( 'created', model_utils.fields.AutoCreatedField( default=django.utils.timezone.now, editable=False, verbose_name='created', ), ), ( 'modified', model_utils.fields.AutoLastModifiedField( default=django.utils.timezone.now, editable=False, verbose_name='modified', ), ), ( 'name', models.CharField( db_column='nasname', db_index=True, help_text='NAS Name (or IP address)', max_length=128, verbose_name='name', ), ), ( 'short_name', models.CharField(db_column='shortname', max_length=32, verbose_name='short name'), ), ( 'type', models.CharField( default='other', max_length=30, verbose_name='type', choices=RAD_NAS_TYPES, ), ), ( 'secret', models.CharField(help_text='Shared Secret', max_length=60, verbose_name='secret'), ), ( 'ports', models.PositiveIntegerField(blank=True, null=True, verbose_name='ports'), ), ( 'community', models.CharField(blank=True, max_length=50, null=True, verbose_name='community'), ), ( 'description', models.CharField( blank=True, max_length=200, null=True, verbose_name='description', ), ), ( 'server', models.CharField(blank=True, max_length=64, null=True, verbose_name='server'), ), ], options={ 'swappable': swapper.swappable_setting('openwisp_radius', 'Nas'), 'db_table': 'nas', 'verbose_name_plural': 'NAS', 'abstract': False, 'verbose_name': 'NAS', }, bases=(openwisp_users.mixins.ValidateOrgMixin, models.Model), ), migrations.CreateModel( name='RadiusAccounting', fields=[ ( 'id', models.BigAutoField(db_column='radacctid', primary_key=True, serialize=False), ), ( 'session_id', models.CharField( db_column='acctsessionid', db_index=True, max_length=64, verbose_name='session ID', ), ), ( 'unique_id', models.CharField( db_column='acctuniqueid', max_length=32, unique=True, verbose_name='accounting unique ID', ), ), ( 'username', models.CharField( blank=True, db_index=True, max_length=64, null=True, verbose_name='username', ), ), ( 'groupname', models.CharField(blank=True, max_length=64, null=True, verbose_name='group name'), ), ( 'realm', models.CharField(blank=True, max_length=64, null=True, verbose_name='realm'), ), ( 'nas_ip_address', models.GenericIPAddressField( db_column='nasipaddress', db_index=True, verbose_name='NAS IP address', ), ), ( 'nas_port_id', models.CharField( blank=True, db_column='nasportid', max_length=15, null=True, verbose_name='NAS port ID', ), ), ( 'nas_port_type', models.CharField( blank=True, db_column='nasporttype', max_length=32, null=True, verbose_name='NAS port type', ), ), ( 'start_time', models.DateTimeField( blank=True, db_column='acctstarttime', db_index=True, null=True, verbose_name='start time', ), ), ( 'stop_time', models.DateTimeField( blank=True, db_column='acctstoptime', db_index=True, null=True, verbose_name='stop time', ), ), ( 'session_time', models.PositiveIntegerField( blank=True, db_column='acctsessiontime', null=True, verbose_name='session time', ), ), ( 'authentication', models.CharField( blank=True, db_column='acctauthentic', max_length=32, null=True, verbose_name='authentication', ), ), ( 'connection_info_start', models.CharField( blank=True, db_column='connectinfo_start', max_length=50, null=True, verbose_name='connection info start', ), ), ( 'connection_info_stop', models.CharField( blank=True, db_column='connectinfo_stop', max_length=50, null=True, verbose_name='connection info stop', ), ), ( 'input_octets', models.BigIntegerField( blank=True, db_column='acctinputoctets', null=True, verbose_name='input octets', ), ), ( 'output_octets', models.BigIntegerField( blank=True, db_column='acctoutputoctets', null=True, verbose_name='output octets', ), ), ( 'calling_station_id', models.CharField( blank=True, db_column='callingstationid', max_length=50, null=True, verbose_name='calling station ID', ), ), ( 'called_station_id', models.CharField( blank=True, db_column='calledstationid', max_length=50, null=True, verbose_name='called station ID', ), ), ( 'terminate_cause', models.CharField( blank=True, db_column='acctterminatecause', max_length=32, null=True, verbose_name='termination cause', ), ), ( 'service_type', models.CharField( blank=True, db_column='servicetype', max_length=32, null=True, verbose_name='service type', ), ), ( 'framed_protocol', models.CharField( blank=True, db_column='framedprotocol', max_length=32, null=True, verbose_name='framed protocol', ), ), ( 'framed_ip_address', models.GenericIPAddressField( blank=True, db_column='framedipaddress', db_index=True, null=True, verbose_name='framed IP address', ), ), ( 'update_time', models.DateTimeField( blank=True, db_column='acctupdatetime', null=True, verbose_name='update time', ), ), ( 'interval', models.IntegerField( blank=True, db_column='acctinterval', null=True, verbose_name='interval', ), ), ], options={ 'swappable': 'OPENWISP_RADIUS_RADIUSACCOUNTING_MODEL', 'db_table': 'radacct', 'verbose_name_plural': 'accountings', 'abstract': False, 'verbose_name': 'accounting', }, bases=(openwisp_users.mixins.ValidateOrgMixin, models.Model), ), migrations.CreateModel( name='RadiusCheck', fields=[ ( 'id', models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name='ID', ), ), ( 'created', model_utils.fields.AutoCreatedField( default=django.utils.timezone.now, editable=False, verbose_name='created', ), ), ( 'modified', model_utils.fields.AutoLastModifiedField( default=django.utils.timezone.now, editable=False, verbose_name='modified', ), ), ( 'username', models.CharField(db_index=True, max_length=64, verbose_name='username'), ), ('value', models.CharField(max_length=253, verbose_name='value')), ( 'op', models.CharField( choices=[ ('=', '='), (':=', ':='), ('==', '=='), ('+=', '+='), ('!=', '!='), ('>', '>'), ('>=', '>='), ('<', '<'), ('<=', '<='), ('=~', '=~'), ('!~', '!~'), ('=*', '=*'), ('!*', '!*'), ], default=':=', max_length=2, verbose_name='operator', ), ), ( 'attribute', models.CharField( choices=[ ('Max-Daily-Session', 'Max-Daily-Session'), ('Max-All-Session', 'Max-All-Session'), ('Max-Daily-Session-Traffic', 'Max-Daily-Session-Traffic'), ('Cleartext-Password', 'Cleartext-Password'), ('NT-Password', 'NT-Password'), ('LM-Password', 'LM-Password'), ('MD5-Password', 'MD5-Password'), ('SMD5-Password', 'SMD5-Password'), ('SHA-Password', 'SHA-Password'), ('SSHA-Password', 'SSHA-Password'), ('Crypt-Password', 'Crypt-Password'), ], default='NT-Password', max_length=64, verbose_name='attribute', ), ), ], options={ 'swappable': 'OPENWISP_RADIUS_RADIUSCHECK_MODEL', 'db_table': 'radcheck', 'verbose_name_plural': 'checks', 'abstract': False, 'verbose_name': 'check', }, bases=( openwisp_users.mixins.ValidateOrgMixin, openwisp_radius.base.models.AutoUsernameMixin, models.Model, ), ), migrations.CreateModel( name='RadiusGroupCheck', fields=[ ( 'id', models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name='ID', ), ), ( 'created', model_utils.fields.AutoCreatedField( default=django.utils.timezone.now, editable=False, verbose_name='created', ), ), ( 'modified', model_utils.fields.AutoLastModifiedField( default=django.utils.timezone.now, editable=False, verbose_name='modified', ), ), ( 'groupname', models.CharField(db_index=True, max_length=64, verbose_name='group name'), ), ( 'attribute', models.CharField(max_length=64, verbose_name='attribute'), ), ( 'op', models.CharField( choices=[ ('=', '='), (':=', ':='), ('==', '=='), ('+=', '+='), ('!=', '!='), ('>', '>'), ('>=', '>='), ('<', '<'), ('<=', '<='), ('=~', '=~'), ('!~', '!~'), ('=*', '=*'), ('!*', '!*'), ], default=':=', max_length=2, verbose_name='operator', ), ), ('value', models.CharField(max_length=253, verbose_name='value')), ], options={ 'swappable': 'OPENWISP_RADIUS_RADIUSGROUPCHECK_MODEL', 'db_table': 'radgroupcheck', 'verbose_name_plural': 'group checks', 'abstract': False, 'verbose_name': 'group check', }, bases=(openwisp_radius.base.models.AutoGroupnameMixin, models.Model), ), migrations.CreateModel( name='RadiusGroupReply', fields=[ ( 'id', models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name='ID', ), ), ( 'created', model_utils.fields.AutoCreatedField( default=django.utils.timezone.now, editable=False, verbose_name='created', ), ), ( 'modified', model_utils.fields.AutoLastModifiedField( default=django.utils.timezone.now, editable=False, verbose_name='modified', ), ), ( 'groupname', models.CharField(db_index=True, max_length=64, verbose_name='group name'), ), ( 'attribute', models.CharField(max_length=64, verbose_name='attribute'), ), ( 'op', models.CharField( choices=[('=', '='), (':=', ':='), ('+=', '+=')], default='=', max_length=2, verbose_name='operator', ), ), ('value', models.CharField(max_length=253, verbose_name='value')), ], options={ 'swappable': 'OPENWISP_RADIUS_RADIUSGROUPREPLY_MODEL', 'db_table': 'radgroupreply', 'verbose_name_plural': 'group replies', 'abstract': False, 'verbose_name': 'group reply', }, bases=(openwisp_radius.base.models.AutoGroupnameMixin, models.Model), ), migrations.CreateModel( name='RadiusPostAuth', fields=[ ( 'id', models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name='ID', ), ), ('username', models.CharField(max_length=64, verbose_name='username')), ( 'password', models.CharField( blank=True, db_column='pass', max_length=64, verbose_name='password', ), ), ('reply', models.CharField(max_length=32, verbose_name='reply')), ( 'date', models.DateTimeField(auto_now_add=True, db_column='authdate', verbose_name='date'), ), ( 'called_station_id', models.CharField( blank=True, db_column='calledstationid', max_length=50, null=True, verbose_name='called station ID', ), ), ( 'calling_station_id', models.CharField( blank=True, db_column='callingstationid', max_length=50, null=True, verbose_name='calling station ID', ), ), ], options={ 'swappable': 'OPENWISP_RADIUS_RADIUSPOSTAUTH_MODEL', 'db_table': 'radpostauth', 'verbose_name_plural': 'post auth log', 'abstract': False, 'verbose_name': 'post auth', }, bases=(openwisp_users.mixins.ValidateOrgMixin, models.Model), ), migrations.CreateModel( name='RadiusReply', fields=[ ( 'id', models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name='ID', ), ), ( 'created', model_utils.fields.AutoCreatedField( default=django.utils.timezone.now, editable=False, verbose_name='created', ), ), ( 'modified', model_utils.fields.AutoLastModifiedField( default=django.utils.timezone.now, editable=False, verbose_name='modified', ), ), ( 'username', models.CharField(db_index=True, max_length=64, verbose_name='username'), ), ('value', models.CharField(max_length=253, verbose_name='value')), ( 'op', models.CharField( choices=[('=', '='), (':=', ':='), ('+=', '+=')], default='=', max_length=2, verbose_name='operator', ), ), ( 'attribute', models.CharField(max_length=64, verbose_name='attribute'), ), ], options={ 'swappable': 'OPENWISP_RADIUS_RADIUSREPLY_MODEL', 'db_table': 'radreply', 'verbose_name_plural': 'replies', 'abstract': False, 'verbose_name': 'reply', }, bases=( openwisp_users.mixins.ValidateOrgMixin, openwisp_radius.base.models.AutoUsernameMixin, models.Model, ), ), migrations.CreateModel( name='RadiusUserGroup', fields=[ ( 'id', models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name='ID', ), ), ( 'created', model_utils.fields.AutoCreatedField( default=django.utils.timezone.now, editable=False, verbose_name='created', ), ), ( 'modified', model_utils.fields.AutoLastModifiedField( default=django.utils.timezone.now, editable=False, verbose_name='modified', ), ), ( 'username', models.CharField(db_index=True, max_length=64, verbose_name='username'), ), ( 'groupname', models.CharField(max_length=64, verbose_name='group name'), ), ('priority', models.IntegerField(default=1, verbose_name='priority')), ], options={ 'swappable': 'OPENWISP_RADIUS_RADIUSUSERGROUP_MODEL', 'db_table': 'radusergroup', 'verbose_name_plural': 'user groups', 'abstract': False, 'verbose_name': 'user group', }, bases=( openwisp_radius.base.models.AutoGroupnameMixin, openwisp_radius.base.models.AutoUsernameMixin, models.Model, ), ), ]
class Migration(migrations.Migration): initial = True dependencies = [ ("auth", "0011_update_proxy_permissions"), ] operations = [ migrations.CreateModel( name="User", fields=[ ( "last_login", models.DateTimeField( blank=True, null=True, verbose_name="last login" ), ), ( "is_superuser", models.BooleanField( default=False, help_text="Designates that this user has all permissions without explicitly assigning them.", verbose_name="superuser status", ), ), ( "is_staff", models.BooleanField( default=False, help_text="Designates whether the user can log into this admin site.", verbose_name="staff status", ), ), ( "is_active", models.BooleanField( default=True, help_text="Designates whether this user should be treated as active. Unselect this instead of deleting accounts.", verbose_name="active", ), ), ( "date_joined", models.DateTimeField( default=django.utils.timezone.now, verbose_name="date joined" ), ), ("id", models.BigAutoField(primary_key=True, serialize=False)), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ("email", models.EmailField(max_length=255, unique=True)), ("password", models.CharField(max_length=255)), ("is_email_verified", models.BooleanField(default=False)), ("first_name", models.CharField(max_length=255)), ("last_name", models.CharField(max_length=255)), ("birthday", models.DateField()), ("phone", models.CharField(max_length=255)), ("website", models.CharField(blank=True, max_length=255, null=True)), ("description", models.TextField(blank=True, null=True)), ("street", models.CharField(max_length=255)), ("city", models.CharField(max_length=255)), ("zip", models.CharField(max_length=255)), ("residence_country_code", models.CharField(max_length=255)), ("nationality_country_code", models.CharField(max_length=255)), ("image_url", models.CharField(blank=True, max_length=255, null=True)), ( "drivers_license_photo_url", models.CharField(blank=True, max_length=255, null=True), ), ( "id_photo_url", models.CharField(blank=True, max_length=255, null=True), ), ( "business_license_url", models.CharField(blank=True, max_length=255, null=True), ), ( "declared_as_seller", models.BooleanField(blank=True, default=False, null=True), ), ( "invoice_street", models.CharField(blank=True, max_length=255, null=True), ), ( "invoice_city", models.CharField(blank=True, max_length=255, null=True), ), ( "invoice_zip", models.CharField(blank=True, max_length=255, null=True), ), ("company_name", models.CharField(max_length=255)), ("company_type", models.CharField(max_length=255)), ("vat_id", models.CharField(blank=True, max_length=255, null=True)), ("tax_id", models.CharField(max_length=255)), ( "company_registration_id", models.CharField(blank=True, max_length=255, null=True), ), ( "association_registration_id", models.CharField(blank=True, max_length=255, null=True), ), ( "organic_control_body", models.CharField(blank=True, max_length=255, null=True), ), ( "is_certified_organic_producer", models.BooleanField(blank=True, default=False, null=True), ), ( "mangopay_user_id", models.CharField(blank=True, max_length=255, null=True), ), ( "mangopay_user_type", models.CharField(blank=True, max_length=255, null=True), ), ( "mangopay_validation_level", models.CharField(blank=True, max_length=255, null=True), ), ("bank", models.CharField(blank=True, max_length=255, null=True)), ("bic", models.CharField(blank=True, max_length=255, null=True)), ("iban", models.CharField(blank=True, max_length=255, null=True)), ( "groups", models.ManyToManyField( blank=True, help_text="The groups this user belongs to. A user will get all permissions granted to each of their groups.", related_name="user_set", related_query_name="user", to="auth.Group", verbose_name="groups", ), ), ( "user_permissions", models.ManyToManyField( blank=True, help_text="Specific permissions for this user.", related_name="user_set", related_query_name="user", to="auth.Permission", verbose_name="user permissions", ), ), ], options={ "verbose_name": "user", "verbose_name_plural": "users", "abstract": False, }, bases=(core.tasks.mixin.TasksMixin, models.Model), managers=[("objects", users.models.user.UserManager()),], ), ]
class Room(models.Model): roocode = models.BigAutoField(primary_key=True) roostartdatetime = models.DateTimeField('Datetime to start chat', null=True, blank=True) rooendclient1 = models.BooleanField(default=False) rooendclient2 = models.BooleanField(default=False) rooendc1datetime = models.DateTimeField('Datetime to end chat client1', null=True, blank=True) rooendc2datetime = models.DateTimeField('Datetime to end chat client2', null=True, blank=True) clicode1 = models.ForeignKey(Client, models.DO_NOTHING, db_column='clicode1', related_name='room_client1') clicode2 = models.ForeignKey(Client, models.DO_NOTHING, db_column='clicode2', related_name='room_client2') def __str__(self): return '%s to %s (%s)' % (self.clicode1, self.clicode2, self.roostartdatetime) def __unicode__(self): return self.roocode @property def websocket_group(self): return Group("room-%s-%s" % (self.clicode1.clicode, self.clicode2.clicode)) def get_room(clicode1, clicode2, clicodesent): if clicode1.clicode > clicode2.clicode: aux = clicode1 clicode1, clicode2 = clicode2, aux filtro = Q(clicode1=clicode1.clicode) & Q(clicode2=clicode2.clicode) room = Room.objects.filter(filtro).order_by("-roocode").first() if room: if room.roostartdatetime is None: get_room = room elif room.rooendclient1 is True & room.rooendclient2 is True: get_room = Room.create_room(clicode1, clicode2) else: if clicode1.clicode == clicodesent.clicode: endclient = room.rooendclient1 seg = timezone.now() - room.rooendc1datetime elif clicode2.clicode == clicodesent.clicode: endclient = room.rooendclient2 seg = timezone.now() - room.rooendc2datetime if endclient is True: Room.objects.filter(roocode=room.roocode).update( rooendclient1=True, rooendclient2=True) get_room = Room.create_room(clicode1, clicode2) else: if seg.total_seconds() <= 300: get_room = room else: Room.objects.filter(roocode=room.roocode).update( rooendclient1=True, rooendclient2=True) get_room = Room.create_room(clicode1, clicode2) else: get_room = Room.create_room(clicode1, clicode2) return get_room def create_room(clicode1, clicode2): room = Room(clicode1=clicode1, clicode2=clicode2) room.save() return room def send_message_room(self, data): if self.rooendclient1 is True: gen = str(self.clicode1.gencode.gencode) if (gen == GenderE['woman'].value or gen == GenderE['lesbian'].value): gender = 'she' else: gender = 'he' data["error"] = { 'type': '2', 'message': ('When @%s get into the room, ' ' %s can see your messages') % (self.clicode1.cliusername, gender), 'title': '@%s left the room' % (self.clicode1.cliusername) } Channel(self.clicode2.clireplychannel).send( {"text": json.dumps(data)}) elif self.rooendclient2 is True: gen = str(self.clicode2.gencode.gencode) if (gen == "2" or gen == "4"): gender = 'she' else: gender = 'he' data["error"] = { 'type': '2', 'message': ('When @%s get into the room, ' ' %s can see your messages') % (self.clicode2.cliusername, gender), 'title': '@%s left the room' % (self.clicode2.cliusername) } Channel(self.clicode1.clireplychannel).send( {"text": json.dumps(data)}) elif (self.clicode1.clireplychannel is not None and self.clicode2.clireplychannel is not None): data["error"] = {'type': '0', 'message': ''} # Perfect self.websocket_group.add(self.clicode1.clireplychannel) self.websocket_group.add(self.clicode2.clireplychannel) self.websocket_group.send({'text': json.dumps(data)}) elif self.clicode1.clireplychannel: if self.clicode2.tclcode.tclcode != ClientTypeE['our_client'].value: gen = str(self.clicode1.gencode.gencode) if (gen == "2" or gen == "4"): gender = 'she' else: gender = 'he' data["error"] = { 'type': '2', 'message': 'When @%s connects, %s ' 'can see your messages' % (self.clicode2.cliusername, gender), 'title': '@%s is offline' % (self.clicode2.cliusername) } Channel(self.clicode1.clireplychannel).send( {"text": json.dumps(data)}) else: data["error"] = {'type': '0', 'message': ''} Channel(self.clicode1.clireplychannel).send( {"text": json.dumps(data)}) elif self.clicode2.clireplychannel: if self.clicode1.tclcode.tclcode != ClientTypeE['our_client'].value: gen = str(self.clicode1.gencode.gencode) if (gen == "2" or gen == "4"): gender = 'she' else: gender = 'he' data["error"] = { 'type': '2', 'message': 'When @%s connects, %s ' 'can see your messages' % (self.clicode1.cliusername, gender), 'title': '@%s is offline' % (self.clicode1.cliusername) } Channel(self.clicode2.clireplychannel).send( {"text": json.dumps(data)}) else: data["error"] = {'type': '0', 'message': ''} Channel(self.clicode2.clireplychannel).send( {"text": json.dumps(data)}) def set_startdatetime(self): Room.objects.filter(roocode=self.roocode).update( roostartdatetime=timezone.now()) def set_end(self, clicode): if self.clicode1.clicode == clicode: Room.objects.filter(roocode=self.roocode).update( rooendclient1=True) elif self.clicode2.clicode == clicode: Room.objects.filter(roocode=self.roocode).update( rooendclient2=True) def set_enddatetime(self, both, clicode): if both: Room.objects.filter(roocode=self.roocode).update( rooendc1datetime=timezone.now(), rooendc2datetime=timezone.now()) else: if self.clicode1.clicode == clicode: Room.objects.filter(roocode=self.roocode).update( rooendc1datetime=timezone.now()) elif self.clicode2.clicode == clicode: Room.objects.filter(roocode=self.roocode).update( rooendc2datetime=timezone.now()) def leave_page(clicode): client = Client.objects.filter(clicode=clicode) if client: if client.tclcode.tclcode == ClientTypeE['manager'].value: girls = ManagerClient.objects.filter(clicodemanager=clicode) for g in girls: code = g.clicodegirl.clicode filtro = (Q(clicode1=code) | Q(clicode2=code)) filtro = filtro & (Q(rooendclient1=False) | Q(rooendclient2=False)) filtro = filtro & Q(roostartdatetime__isnull=False) rooms = Room.objects.filter(filtro) for r in rooms: if (r.clicode1.clicode == code): r.rooendclient1 = True else: r.rooendclient2 = True r.save() else: filtro = (Q(clicode1=clicode) | Q(clicode2=clicode)) filtro = filtro & (Q(rooendclient1=False) | Q(rooendclient2=False)) filtro = filtro & Q(roostartdatetime__isnull=False) rooms = Room.objects.filter(filtro) for r in rooms: if (r.clicode1.clicode == clicode): r.rooendclient1 = True else: r.rooendclient2 = True r.save() def getChatsRequest(clicode): filtro = Q(clicode1=clicode) | Q(clicode2=clicode) result = {} result["mychats"], result["myrequest"] = [], [] roomsinvolved = Room.objects.filter(filtro).distinct( 'clicode1', 'clicode2') indChat, indReq = 0, 0 mychats, myrequest = {}, {} for room in roomsinvolved: if (int(clicode) == int(room.clicode1.clicode)): recieved = room.clicode2.clicode else: recieved = room.clicode1.clicode lastRoom = Room.objects.filter( clicode1=room.clicode1.clicode, clicode2=room.clicode2.clicode).order_by("roocode").last() messages = Message.objects.filter( roocode=lastRoom.roocode).order_by("mescode").last() cantidad = Message.objects.filter( clicodesent=clicode, clicoderecieved=recieved).aggregate(cant=Count('roocode')) if (cantidad['cant'] > 0): # mychat result["mychats"].append(messages.as_list(clicode=clicode)) else: # myrequest result["myrequest"].append(messages.as_list(clicode=clicode)) return result class Meta: db_table = 'room'
class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='ItemChangeLog', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ('timestamp', models.DateTimeField(auto_now=True)), ], options={ 'verbose_name': 'Item Changelog', 'verbose_name_plural': 'Item Changelog', 'db_table': 'changelog_item', }, ), migrations.CreateModel( name='ListChangeLog', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ('timestamp', models.DateTimeField(auto_now=True)), ], options={ 'verbose_name': 'List Changelog', 'verbose_name_plural': 'List Changelog', 'db_table': 'changelog_list', }, ), migrations.CreateModel( name='ListReport', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('subject', models.CharField(max_length=127)), ('remarks', models.CharField(blank=True, default='', max_length=255)), ('timestampReceived', models.DateTimeField(auto_now=True)), ], options={ 'verbose_name': 'List Report', 'verbose_name_plural': 'List Reports', 'db_table': 'list_report', }, ), migrations.CreateModel( name='UserReport', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('subject', models.CharField(max_length=127)), ('remarks', models.CharField(blank=True, default='', max_length=255)), ('timestampReceived', models.DateTimeField(auto_now=True)), ], options={ 'verbose_name': 'User Report', 'verbose_name_plural': 'User Reports', 'db_table': 'user_report', }, ), ]
class Migration(migrations.Migration): initial = True dependencies = [ ('wagtailcore', '0066_collection_management_permissions'), ('promotions', '0004_auto_20211122_1358'), ] operations = [ migrations.CreateModel( name='FeaturesListPage', fields=[ ('page_ptr', models.OneToOneField( auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')), ], options={ 'abstract': False, }, bases=('wagtailcore.page', ), ), migrations.CreateModel( name='HomePageFeaturedPromotionsPage', fields=[ ('page_ptr', models.OneToOneField( auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')), ], options={ 'abstract': False, }, bases=('wagtailcore.page', ), ), migrations.CreateModel( name='FeaturesPagePromotionBlocks', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('sort_order', models.IntegerField(blank=True, editable=False, null=True)), ('features_page', modelcluster.fields.ParentalKey( on_delete=django.db.models.deletion.CASCADE, related_name='promotion_blocks', to='features.homepagefeaturedpromotionspage')), ('promotion_block', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='promotions.promotionblock', verbose_name='Promotion Block')), ], options={ 'ordering': ['sort_order'], 'abstract': False, }, ), ]
class Migration(migrations.Migration): initial = True dependencies = [ ('auth', '0012_alter_user_first_name_max_length'), ] operations = [ migrations.CreateModel( name='User', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('password', models.CharField(max_length=128, verbose_name='password')), ('email', models.EmailField(max_length=60, unique=True, verbose_name='email')), ('username', models.CharField(max_length=30, unique=True)), ('date_joined', models.DateTimeField(auto_now_add=True, verbose_name='date_joined')), ('last_login', models.DateTimeField(auto_now=True, verbose_name='last_login')), ('is_police', models.BooleanField(default=False)), ('is_repair_shop', models.BooleanField(default=False)), ('is_insurance_admin', models.BooleanField(default=False)), ('is_admin', models.BooleanField(default=False)), ('is_active', models.BooleanField(default=True)), ('is_staff', models.BooleanField(default=False)), ('is_superuser', models.BooleanField(default=False)), ('first_name', models.CharField(max_length=20)), ('last_name', models.CharField(max_length=20)), ('age', models.CharField(max_length=5)), ('gender', models.CharField(max_length=10)), ('mobile', models.CharField(max_length=12, null=True)), ('address', models.CharField(max_length=150)), ('groups', models.ManyToManyField( blank=True, help_text= 'The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')), ('user_permissions', models.ManyToManyField( blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')), ], options={ 'verbose_name': 'user', 'verbose_name_plural': 'users', 'abstract': False, }, ), ]
class ActivityType(models.Model): activity_type_id = models.BigAutoField(primary_key=True) activity_type = models.CharField(max_length=100, db_index=True) def __str__(self): return self.activity_type
class Comment(models.Model): id = models.BigAutoField(primary_key=True) recipe_pk = models.IntegerField() user_pk = models.IntegerField() content = models.TextField() create_time = models.DateTimeField(default=now)
class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Emitente', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('nome', models.CharField(max_length=60, verbose_name='Nome')), ('cnpj', models.CharField(blank=True, max_length=14, null=True, verbose_name='CNPJ')), ('inscricao_estadual', models.CharField(blank=True, max_length=14, null=True, verbose_name='Inscrição Estadual')), ('cpf', models.CharField(blank=True, max_length=11, null=True, verbose_name='CPF')), ('logradouro', models.CharField(max_length=60)), ('numero', models.CharField(max_length=40)), ('complemento', models.CharField(blank=True, max_length=60, null=True)), ('bairro', models.CharField(max_length=60)), ('municipio', models.CharField(max_length=60)), ('uf', models.CharField(max_length=2, verbose_name='UF')), ('cep', models.CharField(max_length=8, verbose_name='CEP')), ('telefones', models.CharField(blank=True, max_length=60, null=True)), ('email', models.EmailField(blank=True, max_length=100, null=True, verbose_name='E-mail')), ('certificado_a1', models.FileField( blank=True, null=True, upload_to=emitentes.models.emitente_upload_file)), ('logotipo_dfe', models.ImageField( blank=True, null=True, upload_to=emitentes.models.emitente_upload_file)), ('nfe_emite', models.BooleanField(default=False, verbose_name='Emite NFe')), ('nfe_serie', models.IntegerField(default=0, verbose_name='Série NFe')), ('nfe_numero', models.IntegerField(default=0, verbose_name='Número NFe')), ('nfe_serie_homologacao', models.IntegerField(default=0, verbose_name='Série NFe em homologação')), ('nfe_numero_homologacao', models.IntegerField( default=0, verbose_name='Número NFe em homologação')), ('nfce_emite', models.BooleanField(default=False, verbose_name='Emite NFCe')), ('nfce_serie', models.IntegerField(default=0, verbose_name='Série NFCe')), ('nfce_numero', models.IntegerField(default=0, verbose_name='Número NFCe')), ('nfce_serie_homologacao', models.IntegerField( default=0, verbose_name='Série NFCe em homologação')), ('nfce_numero_homologacao', models.IntegerField( default=0, verbose_name='Número NFCe em homologação')), ('cte_emite', models.BooleanField(default=False, verbose_name='Emite CTe')), ('cte_serie', models.IntegerField(default=0, verbose_name='Série CTe')), ('cte_numero', models.IntegerField(default=0, verbose_name='Número CTe')), ('cte_serie_homologacao', models.IntegerField(default=0, verbose_name='Série CTe')), ('cte_numero_homologacao', models.IntegerField( default=0, verbose_name='Número CTe em homologação')), ('mdfe_emite', models.BooleanField(default=False, verbose_name='Emite MDFe')), ('mdfe_serie', models.IntegerField(default=0, verbose_name='Série MDFe')), ('mdfe_numero', models.IntegerField(default=0, verbose_name='Número MDFe')), ('mdfe_serie_homologacao', models.IntegerField( default=0, verbose_name='Série MDFe em homologação')), ('mdfe_numero_homologacao', models.IntegerField( default=0, verbose_name='Número MDFe em homologação')), ('token', models.UUIDField(default=uuid.uuid4, editable=False)), ('requests_credit', models.IntegerField(default=100, verbose_name='Crédito Requisições')), ('requests_timer', models.IntegerField( default=0, verbose_name='Cronômetro de Requisições')), ('emissoes_suspensas', models.BooleanField(default=False, verbose_name='Suspender Emissões')), ('is_active', models.BooleanField( default=True, help_text= 'Emitentes inativos não aparecem no sistema (api)', verbose_name='Emitente Ativo')), ('created_at', models.DateField(auto_now_add=True, verbose_name='Cadastrado Em')), ('user_id', models.ForeignKey( on_delete=django.db.models.deletion.RESTRICT, to=settings.AUTH_USER_MODEL)), ], ), ]
class Migration(migrations.Migration): dependencies = [ ('main', '0024_v330_create_user_session_membership'), ] run_before = [ # As of this migration, OAuth2Application and OAuth2AccessToken are models in main app # Grant and RefreshToken models are still in the oauth2_provider app and reference # the app and token models, so these must be created before the oauth2_provider models ('oauth2_provider', '0001_initial') ] operations = [ migrations.CreateModel( name='OAuth2Application', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ('client_id', models.CharField( db_index=True, default=oauth2_provider.generators.generate_client_id, max_length=100, unique=True)), ( 'redirect_uris', models.TextField( blank=True, help_text='Allowed URIs list, space separated', validators=[oauth2_provider.validators.validate_uris]), ), ('client_type', models.CharField(choices=[('confidential', 'Confidential'), ('public', 'Public')], max_length=32)), ( 'authorization_grant_type', models.CharField( choices=[ ('authorization-code', 'Authorization code'), ('implicit', 'Implicit'), ('password', 'Resource owner password-based'), ('client-credentials', 'Client credentials'), ], max_length=32, ), ), ('client_secret', models.CharField( blank=True, db_index=True, default=oauth2_provider.generators.generate_client_secret, max_length=255)), ('name', models.CharField(blank=True, max_length=255)), ('skip_authorization', models.BooleanField(default=False)), ('created', models.DateTimeField(auto_now_add=True)), ('updated', models.DateTimeField(auto_now=True)), ('description', models.TextField(blank=True, default='')), ('logo_data', models.TextField(default='', editable=False, validators=[ django.core.validators.RegexValidator( re.compile('.*')) ])), ( 'user', models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='main_oauth2application', to=settings.AUTH_USER_MODEL), ), ], options={ 'verbose_name': 'application', }, ), migrations.CreateModel( name='OAuth2AccessToken', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ('token', models.CharField(max_length=255, unique=True)), ('expires', models.DateTimeField()), ('scope', models.TextField(blank=True)), ('created', models.DateTimeField(auto_now_add=True)), ('updated', models.DateTimeField(auto_now=True)), ('description', models.CharField(blank=True, default='', max_length=200)), ('last_used', models.DateTimeField(default=None, editable=False, null=True)), ( 'application', models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.OAUTH2_PROVIDER_APPLICATION_MODEL), ), ( 'user', models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='main_oauth2accesstoken', to=settings.AUTH_USER_MODEL), ), ], options={ 'verbose_name': 'access token', }, ), migrations.AddField( model_name='activitystream', name='o_auth2_access_token', field=models.ManyToManyField(to='main.OAuth2AccessToken', blank=True), ), migrations.AddField( model_name='activitystream', name='o_auth2_application', field=models.ManyToManyField(to='main.OAuth2Application', blank=True), ), ]
class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateModel( name='Car', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('car_title', models.CharField(max_length=255)), ('state', models.CharField(choices=[ ('AL', 'Alabama'), ('AK', 'Alaska'), ('AZ', 'Arizona'), ('AR', 'Arkansas'), ('CA', 'California'), ('CO', 'Colorado'), ('CT', 'Connecticut'), ('DE', 'Delaware'), ('DC', 'District Of Columbia'), ('FL', 'Florida'), ('GA', 'Georgia'), ('HI', 'Hawaii'), ('ID', 'Idaho'), ('IL', 'Illinois'), ('IN', 'Indiana'), ('IA', 'Iowa'), ('KS', 'Kansas'), ('KY', 'Kentucky'), ('LA', 'Louisiana'), ('ME', 'Maine'), ('MD', 'Maryland'), ('MA', 'Massachusetts'), ('MI', 'Michigan'), ('MN', 'Minnesota'), ('MS', 'Mississippi'), ('MO', 'Missouri'), ('MT', 'Montana'), ('NE', 'Nebraska'), ('NV', 'Nevada'), ('NH', 'New Hampshire'), ('NJ', 'New Jersey'), ('NM', 'New Mexico'), ('NY', 'New York'), ('NC', 'North Carolina'), ('ND', 'North Dakota'), ('OH', 'Ohio'), ('OK', 'Oklahoma'), ('OR', 'Oregon'), ('PA', 'Pennsylvania'), ('RI', 'Rhode Island'), ('SC', 'South Carolina'), ('SD', 'South Dakota'), ('TN', 'Tennessee'), ('TX', 'Texas'), ('UT', 'Utah'), ('VT', 'Vermont'), ('VA', 'Virginia'), ('WA', 'Washington'), ('WV', 'West Virginia'), ('WI', 'Wisconsin'), ('WY', 'Wyoming') ], max_length=100)), ('city', models.CharField(max_length=100)), ('color', models.CharField(max_length=100)), ('model', models.CharField(max_length=100)), ('year', models.IntegerField(choices=[(2000, 2000), (2001, 2001), (2002, 2002), (2003, 2003), (2004, 2004), (2005, 2005), (2006, 2006), (2007, 2007), (2008, 2008), (2009, 2009), (2010, 2010), (2011, 2011), (2012, 2012), (2013, 2013), (2014, 2014), (2015, 2015), (2016, 2016), (2017, 2017), (2018, 2018), (2019, 2019), (2020, 2020), (2021, 2021)], verbose_name='year')), ('condition', models.CharField(max_length=100)), ('price', models.IntegerField()), ('description', ckeditor.fields.RichTextField()), ('car_photo', models.ImageField(upload_to='photos/%y/%m/%d')), ('car_photo_1', models.ImageField(blank=True, upload_to='photos/%y/%m/%d')), ('car_photo_2', models.ImageField(blank=True, upload_to='photos/%y/%m/%d')), ('car_photo_3', models.ImageField(blank=True, upload_to='photos/%y/%m/%d')), ('car_photo_4', models.ImageField(blank=True, upload_to='photos/%y/%m/%d')), ('features', multiselectfield.db.fields.MultiSelectField(choices=[ ('Cruise Control', 'Cruise Control'), ('Audio Interface', 'Audio Interface'), ('Airbags', 'Airbags'), ('Air Conditioning', 'Air Conditioning'), ('Seat Heating', 'Seat Heating'), ('Alarm System', 'Alarm System'), ('ParkAssist', 'ParkAssist'), ('Power Steering', 'Power Steering'), ('Reversing Camera', 'Reversing Camera'), ('Direct Fuel Injection', 'Direct Fuel Injection'), ('Auto Start/Stop', 'Auto Start/Stop'), ('Wind Deflector', 'Wind Deflector'), ('Bluetooth Handset', 'Bluetooth Handset') ], max_length=195)), ('body_style', models.CharField(max_length=100)), ('engine', models.CharField(max_length=100)), ('transmission', models.CharField(max_length=100)), ('interior', models.CharField(max_length=100)), ('miles', models.IntegerField()), ('doors', models.CharField(choices=[('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6')], max_length=10)), ('passengers', models.IntegerField()), ('vin_no', models.CharField(max_length=100)), ('milage', models.IntegerField()), ('fuel_type', models.CharField(max_length=50)), ('no_of_owner', models.CharField(max_length=100)), ('is_features', models.BooleanField(default=False)), ('created_date', models.DateField(blank=True, default=datetime.datetime.now)), ], ), ]
class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateModel( name='Country', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=250)), ], options={ 'ordering': ('name', ), }, ), migrations.CreateModel( name='Source', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('url', models.CharField(max_length=500)), ('name', models.CharField(max_length=250)), ('origin', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='country_sources', to='main_app.country')), ], options={ 'ordering': ('name', ), }, ), migrations.CreateModel( name='Article', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('url', models.CharField(max_length=500)), ('title', models.TextField()), ('rating', models.IntegerField(default=0)), ('date', models.DateField(default=datetime.date.today)), ('length', models.IntegerField(default=0)), ('countries', models.ManyToManyField(related_name='country_articles', to='main_app.Country')), ('source', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='source_articles', to='main_app.source')), ], options={ 'ordering': ('-date', ), }, ), ]
class Migration(migrations.Migration): dependencies = [ ('foundation_tenant', '0001_initial'), ] operations = [ migrations.AlterField( model_name='calendarevent', name='id', field=models.BigAutoField(primary_key=True, serialize=False), ), migrations.AlterField( model_name='commentpost', name='id', field=models.BigAutoField(primary_key=True, serialize=False), ), migrations.AlterField( model_name='communityadvertisement', name='id', field=models.BigAutoField(primary_key=True, serialize=False), ), migrations.AlterField( model_name='communitypost', name='id', field=models.BigAutoField(primary_key=True, serialize=False), ), migrations.AlterField( model_name='document', name='id', field=models.BigAutoField(primary_key=True, serialize=False), ), migrations.AlterField( model_name='fileupload', name='id', field=models.BigAutoField(primary_key=True, serialize=False), ), migrations.AlterField( model_name='geocoordinate', name='id', field=models.BigAutoField(primary_key=True, serialize=False), ), migrations.AlterField( model_name='imageupload', name='id', field=models.BigAutoField(primary_key=True, serialize=False), ), migrations.AlterField( model_name='intake', name='id', field=models.BigAutoField(primary_key=True, serialize=False), ), migrations.AlterField( model_name='logevent', name='id', field=models.BigAutoField(primary_key=True, serialize=False), ), migrations.AlterField( model_name='message', name='id', field=models.BigAutoField(primary_key=True, serialize=False), ), migrations.AlterField( model_name='note', name='id', field=models.BigAutoField(primary_key=True, serialize=False), ), migrations.AlterField( model_name='notification', name='id', field=models.BigAutoField(primary_key=True, serialize=False), ), migrations.AlterField( model_name='questionanswer', name='id', field=models.BigAutoField(primary_key=True, serialize=False), ), migrations.AlterField( model_name='s3file', name='id', field=models.BigAutoField(primary_key=True, serialize=False), ), migrations.AlterField( model_name='task', name='id', field=models.BigAutoField(primary_key=True, serialize=False), ), migrations.AlterField( model_name='visitor', name='id', field=models.BigAutoField(primary_key=True, serialize=False), ), migrations.AlterField( model_name='workspace', name='id', field=models.BigAutoField(primary_key=True, serialize=False), ), ]
class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateModel( name='Author', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('first_name', models.CharField(max_length=100)), ('last_name', models.CharField(max_length=100)), ('date_of_birth', models.DateField(blank=True, null=True)), ('date_of_death', models.DateField(blank=True, null=True, verbose_name='Died')), ], options={ 'ordering': ['last_name', 'first_name'], }, ), migrations.CreateModel( name='Book', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('title', models.CharField(max_length=200)), ('summary', models.TextField( help_text='Enter a brief description of the book', max_length=1000)), ('isbn', models.CharField( help_text= '13 Character <a href="https://www.isbn-international.org/content/what-isbn">ISBN number</a>', max_length=13, unique=True, verbose_name='ISBN')), ('author', models.ForeignKey( null=True, on_delete=django.db.models.deletion.SET_NULL, to='catalog.author')), ], ), migrations.CreateModel( name='Genre', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField( help_text='Enter a book genre (e.g. Science Fiction)', max_length=200)), ], ), migrations.CreateModel( name='BookInstance', fields=[ ('id', models.UUIDField( default=uuid.uuid4, help_text= 'Unique ID for this particular book across whole library', primary_key=True, serialize=False)), ('imprint', models.CharField(max_length=200)), ('due_back', models.DateField(blank=True, null=True)), ('status', models.CharField(blank=True, choices=[('m', 'Maintenance'), ('o', 'On loan'), ('a', 'Available'), ('r', 'Reserved')], default='m', help_text='Book availability', max_length=1)), ('book', models.ForeignKey( null=True, on_delete=django.db.models.deletion.RESTRICT, to='catalog.book')), ], options={ 'ordering': ['due_back'], }, ), migrations.AddField( model_name='book', name='genre', field=models.ManyToManyField( help_text='Select a genre for this book', to='catalog.Genre'), ), ]
class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Customer', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(blank=True, max_length=200, null=True)), ('email', models.CharField(blank=True, max_length=200, null=True)), ('device', models.CharField(blank=True, max_length=200, null=True)), ('user', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( name='Order', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('date_ordered', models.DateTimeField(auto_now_add=True)), ('complete', models.BooleanField(default=False)), ('transaction_id', models.CharField(max_length=100, null=True)), ('customer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.customer')), ], ), migrations.CreateModel( name='Product', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=200)), ('price', models.DecimalField(decimal_places=2, max_digits=7)), ('image', models.ImageField(blank=True, null=True, upload_to='')), ('description', models.TextField()), ], ), migrations.CreateModel( name='ShippingAddress', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('address', models.CharField(max_length=200)), ('city', models.CharField(max_length=200)), ('state', models.CharField(max_length=200)), ('zipcode', models.CharField(max_length=200)), ('date_added', models.DateTimeField(auto_now_add=True)), ('customer', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.customer')), ('order', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.order')), ], ), migrations.CreateModel( name='OrderItem', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('quantity', models.IntegerField(blank=True, default=0, null=True)), ('date_added', models.DateTimeField(auto_now_add=True)), ('order', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.order')), ('product', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.product')), ], ), ]
class OCPUsageLineItemDaily(models.Model): """A daily aggregation of line items. This table is aggregated by OCP resource. """ class Meta: """Meta for OCPUsageLineItemDaily.""" db_table = "reporting_ocpusagelineitem_daily" indexes = [ models.Index(fields=["usage_start"], name="ocp_usage_idx"), models.Index(fields=["namespace"], name="namespace_idx", opclasses=["varchar_pattern_ops"]), models.Index(fields=["pod"], name="pod_idx"), models.Index(fields=["node"], name="node_idx", opclasses=["varchar_pattern_ops"]), ] id = models.BigAutoField(primary_key=True) report_period = models.ForeignKey("OCPUsageReportPeriod", on_delete=models.CASCADE, null=True) cluster_id = models.CharField(max_length=50, null=True) cluster_alias = models.CharField(max_length=256, null=True) # Kubernetes objects by convention have a max name length of 253 chars namespace = models.CharField(max_length=253, null=False) pod = models.CharField(max_length=253, null=False) node = models.CharField(max_length=253, null=False) # Another node identifier used to tie the node to an EC2 instance resource_id = models.CharField(max_length=253, null=True) usage_start = models.DateField(null=False) usage_end = models.DateField(null=False) pod_usage_cpu_core_seconds = models.DecimalField(max_digits=73, decimal_places=9, null=True) pod_request_cpu_core_seconds = models.DecimalField(max_digits=73, decimal_places=9, null=True) pod_limit_cpu_core_seconds = models.DecimalField(max_digits=73, decimal_places=9, null=True) pod_usage_memory_byte_seconds = models.DecimalField(max_digits=73, decimal_places=9, null=True) pod_request_memory_byte_seconds = models.DecimalField(max_digits=73, decimal_places=9, null=True) pod_limit_memory_byte_seconds = models.DecimalField(max_digits=73, decimal_places=9, null=True) node_capacity_cpu_cores = models.DecimalField(max_digits=73, decimal_places=9, null=True) node_capacity_cpu_core_seconds = models.DecimalField(max_digits=73, decimal_places=9, null=True) node_capacity_memory_bytes = models.DecimalField(max_digits=73, decimal_places=9, null=True) node_capacity_memory_byte_seconds = models.DecimalField(max_digits=73, decimal_places=9, null=True) cluster_capacity_cpu_core_seconds = models.DecimalField(max_digits=73, decimal_places=9, null=True) cluster_capacity_memory_byte_seconds = models.DecimalField( max_digits=73, decimal_places=9, null=True) total_seconds = models.IntegerField() pod_labels = JSONField(null=True)
class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Album', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=50)), ('release_date', models.DateField()), ('recording_start', models.DateField(blank=True, null=True)), ('recording_end', models.DateField(blank=True, null=True)), ('picture', models.CharField(blank=True, max_length=10000)), ], ), migrations.CreateModel( name='Band', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=1000)), ('creation_date', models.DateField(blank=True, null=True)), ('disbanding_date', models.DateField(blank=True, null=True)), ], ), migrations.CreateModel( name='Instrument', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=200)), ('creation_date', models.DateField(blank=True, null=True)), ('creation_year', models.IntegerField(blank=True, null=True)), ], ), migrations.CreateModel( name='Musician', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=1000)), ('birth_date', models.DateField(blank=True, null=True)), ], ), migrations.CreateModel( name='Profile', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('birth_date', models.DateField(null=True)), ('user', models.OneToOneField( on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( name='AlbumReview', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('content', models.TextField()), ('publication_date', models.DateTimeField()), ('album', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='music.album')), ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], ), migrations.AddField( model_name='album', name='bands', field=models.ManyToManyField(to='music.Band'), ), migrations.AddField( model_name='album', name='musicians', field=models.ManyToManyField(to='music.Musician'), ), ]
class OCPStorageLineItemDaily(models.Model): """A daily aggregation of storage line items. This table is aggregated by OCP resource. """ class Meta: """Meta for OCPUStorageLineItemDaily.""" db_table = "reporting_ocpstoragelineitem_daily" indexes = [ models.Index(fields=["namespace"], name="ocp_storage_li_namespace_idx", opclasses=["varchar_pattern_ops"]), models.Index(fields=["node"], name="ocp_storage_li_node_idx", opclasses=["varchar_pattern_ops"]), ] id = models.BigAutoField(primary_key=True) report_period = models.ForeignKey("OCPUsageReportPeriod", on_delete=models.CASCADE, null=True) cluster_id = models.CharField(max_length=50, null=True) cluster_alias = models.CharField(max_length=256, null=True) # Kubernetes objects by convention have a max name length of 253 chars namespace = models.CharField(max_length=253, null=False) pod = models.CharField(max_length=253, null=True) node = models.CharField(max_length=253, null=True) persistentvolumeclaim = models.CharField(max_length=253) persistentvolume = models.CharField(max_length=253) storageclass = models.CharField(max_length=253, null=True) usage_start = models.DateField(null=False) usage_end = models.DateField(null=False) persistentvolumeclaim_capacity_bytes = models.DecimalField( max_digits=73, decimal_places=9, null=True) persistentvolumeclaim_capacity_byte_seconds = models.DecimalField( max_digits=73, decimal_places=9, null=True) volume_request_storage_byte_seconds = models.DecimalField(max_digits=73, decimal_places=9, null=True) persistentvolumeclaim_usage_byte_seconds = models.DecimalField( max_digits=73, decimal_places=9, null=True) total_seconds = models.IntegerField() persistentvolume_labels = JSONField(null=True) persistentvolumeclaim_labels = JSONField(null=True)
class UserActivityAlbum(models.Model): user_activity_album_id = models.BigAutoField(primary_key=True) user_activity = models.ForeignKey(UserActivity, on_delete=models.CASCADE) photo = CloudinaryField('image')
class OCPUsageLineItem(models.Model): """Raw report data for OpenShift pods.""" class Meta: """Meta for OCPUsageLineItem.""" unique_together = ("report", "namespace", "pod", "node") id = models.BigAutoField(primary_key=True) report_period = models.ForeignKey("OCPUsageReportPeriod", on_delete=models.CASCADE, db_constraint=False) report = models.ForeignKey("OCPUsageReport", on_delete=models.CASCADE, db_constraint=False) # Kubernetes objects by convention have a max name length of 253 chars namespace = models.CharField(max_length=253, null=False) pod = models.CharField(max_length=253, null=False) node = models.CharField(max_length=253, null=False) # Another node identifier used to tie the node to an EC2 instance resource_id = models.CharField(max_length=253, null=True) pod_usage_cpu_core_seconds = models.DecimalField(max_digits=73, decimal_places=9, null=True) pod_request_cpu_core_seconds = models.DecimalField(max_digits=73, decimal_places=9, null=True) pod_limit_cpu_core_seconds = models.DecimalField(max_digits=73, decimal_places=9, null=True) pod_usage_memory_byte_seconds = models.DecimalField(max_digits=73, decimal_places=9, null=True) pod_request_memory_byte_seconds = models.DecimalField(max_digits=73, decimal_places=9, null=True) pod_limit_memory_byte_seconds = models.DecimalField(max_digits=73, decimal_places=9, null=True) node_capacity_cpu_cores = models.DecimalField(max_digits=73, decimal_places=9, null=True) node_capacity_cpu_core_seconds = models.DecimalField(max_digits=73, decimal_places=9, null=True) node_capacity_memory_bytes = models.DecimalField(max_digits=73, decimal_places=9, null=True) node_capacity_memory_byte_seconds = models.DecimalField(max_digits=73, decimal_places=9, null=True) pod_labels = JSONField(null=True)
class Migration(migrations.Migration): initial = True dependencies = [ ('auth', '0012_alter_user_first_name_max_length'), ] operations = [ migrations.CreateModel( name='User', fields=[ ('password', models.CharField(max_length=128, verbose_name='password')), ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')), ('is_superuser', models.BooleanField( default=False, help_text= 'Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')), ('created_at', models.DateTimeField(default=datetime.datetime.now)), ('updated_at', models.DateTimeField(auto_now=True)), ('id', models.BigAutoField(primary_key=True, serialize=False)), ('email', models.EmailField(max_length=255, unique=True, verbose_name='email')), ('name', models.CharField(max_length=255, verbose_name='name')), ('is_admin', models.BooleanField(default=False)), ('is_staff', models.BooleanField(default=False)), ('groups', models.ManyToManyField( blank=True, help_text= 'The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')), ('user_permissions', models.ManyToManyField( blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')), ], options={ 'verbose_name': 'user', 'db_table': 'users', }, managers=[ ('objects', blog.modules.user.manager.BlogUserManager()), ], ), ]
class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateModel( name='About', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('heading', models.CharField(max_length=50)), ('career', models.CharField(max_length=20)), ('description', models.TextField()), ('profile_img', models.ImageField(upload_to='profile/')), ('updated', models.DateTimeField(auto_now=True)), ], ), migrations.CreateModel( name='Category', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=20)), ('updated', models.DateTimeField(auto_now=True)), ], options={ 'verbose_name': 'Skill', 'verbose_name_plural': 'Skills', }, ), migrations.CreateModel( name='Home', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=20)), ('greeting_1', models.CharField(max_length=5)), ('greeting_2', models.CharField(max_length=5)), ('picture', models.ImageField(upload_to='picture/')), ('updated', models.DateTimeField(auto_now=True)), ], ), migrations.CreateModel( name='Portfolio', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('image', models.ImageField(upload_to='portfolio/')), ('link', models.URLField()), ], ), migrations.CreateModel( name='Skills', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('skill_name', models.CharField(max_length=20)), ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='om.category')), ], ), migrations.CreateModel( name='Profile', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('social_name', models.CharField(max_length=10)), ('link', models.URLField()), ('about', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='om.about')), ], ), ]
class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateModel( name='AuthGroup', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=150, unique=True)), ], options={ 'db_table': 'auth_group', 'managed': False, }, ), migrations.CreateModel( name='AuthGroupPermissions', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ], options={ 'db_table': 'auth_group_permissions', 'managed': False, }, ), migrations.CreateModel( name='AuthPermission', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=255)), ('codename', models.CharField(max_length=100)), ], options={ 'db_table': 'auth_permission', 'managed': False, }, ), migrations.CreateModel( name='AuthUser', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('password', models.CharField(max_length=128)), ('last_login', models.DateTimeField(blank=True, null=True)), ('is_superuser', models.IntegerField()), ('username', models.CharField(max_length=150, unique=True)), ('first_name', models.CharField(max_length=150)), ('last_name', models.CharField(max_length=150)), ('email', models.CharField(max_length=254)), ('is_staff', models.IntegerField()), ('is_active', models.IntegerField()), ('date_joined', models.DateTimeField()), ], options={ 'db_table': 'auth_user', 'managed': False, }, ), migrations.CreateModel( name='AuthUserGroups', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ], options={ 'db_table': 'auth_user_groups', 'managed': False, }, ), migrations.CreateModel( name='AuthUserUserPermissions', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ], options={ 'db_table': 'auth_user_user_permissions', 'managed': False, }, ), migrations.CreateModel( name='Bicicletas', fields=[ ('idbicicletas', models.AutoField(db_column='idBicicletas', primary_key=True, serialize=False)), ('color', models.CharField(db_column='Color', max_length=50)), ('material', models.TextField(db_column='Material')), ('precioalquiler', models.DecimalField(db_column='PrecioAlquiler', decimal_places=3, max_digits=6)), ('foto', models.CharField(db_column='Foto', max_length=50)), ], options={ 'db_table': 'bicicletas', 'managed': False, }, ), migrations.CreateModel( name='Catalogo', fields=[ ('idcatalogo', models.AutoField(db_column='idCatalogo', primary_key=True, serialize=False)), ('fechahorasubida', models.DateTimeField(db_column='fechaHoraSubida')), ], options={ 'db_table': 'catalogo', 'managed': False, }, ), migrations.CreateModel( name='Categoria', fields=[ ('idmodelo', models.AutoField(db_column='idModelo', primary_key=True, serialize=False)), ('nombre', models.CharField(db_column='Nombre', max_length=45)), ], options={ 'db_table': 'categoria', 'managed': False, }, ), migrations.CreateModel( name='Contrato', fields=[ ('idcontrato', models.AutoField(db_column='idContrato', primary_key=True, serialize=False)), ('cantidadbicicletas', models.IntegerField(db_column='CantidadBicicletas')), ('fechainicio', models.DateField(db_column='FechaInicio')), ('fechafin', models.DateField(db_column='FechaFin')), ('tiempo', models.TimeField(db_column='Tiempo')), ('observaciones', models.CharField(db_column='Observaciones', max_length=100)), ], options={ 'db_table': 'contrato', 'managed': False, }, ), migrations.CreateModel( name='DjangoAdminLog', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('action_time', models.DateTimeField()), ('object_id', models.TextField(blank=True, null=True)), ('object_repr', models.CharField(max_length=200)), ('action_flag', models.PositiveSmallIntegerField()), ('change_message', models.TextField()), ], options={ 'db_table': 'django_admin_log', 'managed': False, }, ), migrations.CreateModel( name='DjangoContentType', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('app_label', models.CharField(max_length=100)), ('model', models.CharField(max_length=100)), ], options={ 'db_table': 'django_content_type', 'managed': False, }, ), migrations.CreateModel( name='DjangoMigrations', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ('app', models.CharField(max_length=255)), ('name', models.CharField(max_length=255)), ('applied', models.DateTimeField()), ], options={ 'db_table': 'django_migrations', 'managed': False, }, ), migrations.CreateModel( name='DjangoSession', fields=[ ('session_key', models.CharField(max_length=40, primary_key=True, serialize=False)), ('session_data', models.TextField()), ('expire_date', models.DateTimeField()), ], options={ 'db_table': 'django_session', 'managed': False, }, ), migrations.CreateModel( name='Modulo', fields=[ ('idmodulo', models.AutoField(db_column='idModulo', primary_key=True, serialize=False)), ('nombre', models.CharField(db_column='Nombre', max_length=45)), ], options={ 'db_table': 'modulo', 'managed': False, }, ), migrations.CreateModel( name='Pagos', fields=[ ('idpago', models.AutoField(db_column='idPago', primary_key=True, serialize=False)), ('fechapago', models.DateTimeField(db_column='FechaPago')), ('totalalquiler', models.DecimalField(db_column='TotalAlquiler', decimal_places=3, max_digits=6)), ('fechamora', models.DateTimeField(blank=True, db_column='FechaMora', null=True)), ], options={ 'db_table': 'pagos', 'managed': False, }, ), migrations.CreateModel( name='Perfilusuario', fields=[ ('idroles', models.AutoField(db_column='idRoles', primary_key=True, serialize=False)), ('nombre', models.CharField(db_column='Nombre', max_length=45)), ('descripcionrol', models.TextField(blank=True, db_column='descripcionRol', null=True)), ], options={ 'db_table': 'perfilusuario', 'managed': False, }, ), migrations.CreateModel( name='Persona', fields=[ ('idpersona', models.AutoField(db_column='idPersona', primary_key=True, serialize=False)), ('nombres', models.CharField(db_column='Nombres', max_length=50)), ('apellidos', models.CharField(db_column='Apellidos', max_length=50)), ('numidentificacion', models.BigIntegerField(db_column='NumIdentificacion')), ('numcelular', models.BigIntegerField(db_column='NumCelular')), ('numtelefono', models.BigIntegerField(blank=True, db_column='NumTelefono', null=True)), ('correoelectronico', models.CharField(db_column='CorreoElectronico', max_length=45)), ], options={ 'db_table': 'persona', 'managed': False, }, ), migrations.CreateModel( name='Privilegios', fields=[ ('idprivilegios', models.AutoField(db_column='idPrivilegios', primary_key=True, serialize=False)), ('privilegio', models.IntegerField()), ], options={ 'db_table': 'privilegios', 'managed': False, }, ), migrations.CreateModel( name='Reserva', fields=[ ('idreserva', models.AutoField(db_column='idReserva', primary_key=True, serialize=False)), ('disponibleen', models.TimeField(blank=True, db_column='DisponibleEn', null=True)), ('disponible', models.CharField(db_column='Disponible', max_length=2)), ], options={ 'db_table': 'reserva', 'managed': False, }, ), migrations.CreateModel( name='Tiempoprestamo', fields=[ ('idtiempodisponibilidad', models.IntegerField(db_column='idTiempoDisponibilidad', primary_key=True, serialize=False)), ('tiempoinicio', models.CharField(blank=True, db_column='tiempoInicio', max_length=45, null=True)), ], options={ 'db_table': 'tiempoprestamo', 'managed': False, }, ), migrations.CreateModel( name='Tipocontrato', fields=[ ('idtipocontrato', models.IntegerField(db_column='idTipocontrato', primary_key=True, serialize=False)), ('nombre', models.CharField(db_column='Nombre', max_length=45)), ('descripcion', models.CharField(blank=True, db_column='Descripcion', max_length=45, null=True)), ], options={ 'db_table': 'tipocontrato', 'managed': False, }, ), migrations.CreateModel( name='Tipopersona', fields=[ ('idtipopersona', models.AutoField(db_column='idtipoPersona', primary_key=True, serialize=False)), ('nombre', models.CharField(db_column='Nombre', max_length=55)), ('descripcion', models.CharField(blank=True, db_column='Descripcion', max_length=45, null=True)), ], options={ 'db_table': 'tipopersona', 'managed': False, }, ), migrations.CreateModel( name='Usuario', fields=[ ('idusuario', models.AutoField(db_column='idUsuario', primary_key=True, serialize=False)), ('usuario', models.CharField(db_column='Usuario', max_length=20)), ('password', models.CharField(db_column='Password', max_length=100)), ], options={ 'db_table': 'usuario', 'managed': False, }, ), ]
class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateModel( name='TermsPolicyRepo', fields=[ ('term_id', models.BigAutoField(primary_key=True, serialize=False)), ('term_type', models.CharField(max_length=50)), ('term_version', models.CharField(max_length=15)), ('term_html', models.TextField()), ('term_text', models.TextField()), ('term_status', models.CharField(max_length=255)), ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True, null=True)), ], ), migrations.CreateModel( name='TokenOrders', fields=[ ('token_order_id', models.BigAutoField(primary_key=True, serialize=False)), ('token_order_external_id', models.CharField(max_length=64)), ('customer_external_id', models.CharField(max_length=64)), ('usd_value', models.DecimalField(decimal_places=2, max_digits=12)), ('token_value', models.DecimalField(decimal_places=18, max_digits=28)), ('payment_currency', models.CharField(max_length=10)), ('payment_currency_value', models.DecimalField(decimal_places=18, max_digits=28, null=True)), ('payment_address', models.CharField(max_length=255, null=True)), ('payment_destination_tag', models.CharField(max_length=25, null=True)), ('txn_id', models.CharField(max_length=255, null=True)), ('confirms_needed', models.IntegerField(null=True)), ('timeout', models.IntegerField(null=True)), ('status_url', models.CharField(max_length=255, null=True)), ('qrcode_url', models.CharField(max_length=255, null=True)), ('payment_status', models.IntegerField(null=True)), ('payment_status_text', models.CharField(max_length=255, null=True)), ('payment_received', models.BooleanField(default=False)), ('tokens_credited', models.BooleanField(default=False)), ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True, null=True)), ], options={ 'ordering': ['-token_order_id'], }, ), migrations.CreateModel( name='TokenTransactions', fields=[ ('token_transaction_id', models.BigAutoField(primary_key=True, serialize=False)), ('token_transaction_external_id', models.CharField(max_length=64)), ('customer_external_id', models.CharField(max_length=64)), ('transaction_type', models.CharField(max_length=25)), ('token_value', models.DecimalField(decimal_places=18, max_digits=28)), ('withdrawal_address', models.CharField(max_length=255, null=True)), ('txn_id', models.CharField(max_length=255, null=True)), ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True, null=True)), ], options={ 'ordering': ['-token_transaction_id'], }, ), migrations.CreateModel( name='UserEligibilityRegistry', fields=[ ('user_eligibility_id', models.BigAutoField(primary_key=True, serialize=False)), ('customer_external_id', models.CharField(max_length=64)), ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True, null=True)), ], ), migrations.CreateModel( name='UserTermsRegistry', fields=[ ('user_term_id', models.BigAutoField(primary_key=True, serialize=False)), ('customer_external_id', models.CharField(max_length=64)), ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True, null=True)), ('term', models.ForeignKey(db_column='term_id', on_delete=django.db.models.deletion.PROTECT, to='launchpad.TermsPolicyRepo')), ], ), ]
class Category(models.Model): id = models.BigAutoField(primary_key=True) name = models.CharField(max_length=20, unique=True)
class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('costumer', '0001_initial'), ] operations = [ migrations.CreateModel( name='Category', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('content', models.CharField(max_length=70)), ('slug', models.SlugField(blank=True, unique=True)), ], ), migrations.CreateModel( name='Product', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('title', models.CharField(max_length=80)), ('desc', models.TextField(blank=True, max_length=300, null=True)), ('is_active', models.BooleanField(default=True)), ('create_at', models.DateTimeField(auto_now_add=True)), ('update', models.DateTimeField(auto_now=True)), ('slug', models.SlugField(blank=True, null=True)), ('sold', models.IntegerField(default=0, verbose_name='terjual ')), ('price', models.IntegerField(default=0, verbose_name='harga dalam Rupiah ')), ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='product', to='store.category')), ('penjual', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='product', to='costumer.store')), ], options={ 'ordering': ['-create_at'], }, ), migrations.CreateModel( name='Varian', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=50)), ('stock', models.PositiveIntegerField(default=0)), ('is_active', models.BooleanField(default=True)), ('price', models.IntegerField(validators=[ django.core.validators.MaxValueValidator(99999999), django.core.validators.MinValueValidator(0) ], verbose_name=' price in IDR')), ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='varian', to='store.product')), ], ), migrations.CreateModel( name='Rating', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('rating', models.PositiveIntegerField(validators=[ django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(10) ], verbose_name=' rating')), ('ulasan', models.TextField(max_length=200, verbose_name=' review')), ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rating', to='store.product')), ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rating', to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( name='Image', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('image', models.ImageField(height_field='height_field', upload_to='product', width_field='width_field')), ('height_field', models.PositiveIntegerField(default=0)), ('width_field', models.PositiveIntegerField(default=0)), ('is_thumb', models.BooleanField(default=False)), ('product', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='images', to='store.product')), ('varian', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='image_varian', to='store.varian')), ], ), migrations.CreateModel( name='Bookmark', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='bookmark', to='store.product')), ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='bookmark', to=settings.AUTH_USER_MODEL)), ], ), migrations.AddConstraint( model_name='product', constraint=models.UniqueConstraint( fields=('penjual', 'title'), name='you already have this title'), ), ]
class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateModel( name='API_case_tree', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ('text', models.CharField(max_length=50)), ('state', models.CharField(max_length=10)), ('parent_id', models.IntegerField()), ('iconCls', models.CharField(max_length=20)), ('attributes', models.CharField(max_length=100)), ('order', models.IntegerField()), ], ), migrations.CreateModel( name='API_case_tree_test_plan', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ('plan_id', models.IntegerField()), ('node_name', models.CharField(max_length=50)), ('node_path', models.CharField(max_length=5000)), ('sub_node_num', models.IntegerField()), ('order', models.IntegerField(default=0)), ('node', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='website.API_case_tree')), ], ), migrations.CreateModel( name='API_project_setting', fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), ('project_name', models.CharField(max_length=50)), ('protocol', models.CharField(max_length=10)), ('host', models.CharField(max_length=30)), ('port', models.IntegerField()), ('environment', models.CharField(max_length=20)), ('valid_flag', models.CharField(max_length=5)), ('order', models.IntegerField()), ], ), migrations.CreateModel( name='API_test_case_step', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ('order', models.IntegerField()), ('step_type', models.CharField(max_length=10)), ('op_object', models.CharField(max_length=5000)), ('object_id', models.BigIntegerField()), ('exec_operation', models.CharField(max_length=50)), ('request_header', models.CharField(max_length=2000)), ('request_method', models.CharField(max_length=10)), ('url_or_sql', models.CharField(max_length=2000)), ('input_params', models.CharField(max_length=3000)), ('response_to_check', models.CharField(max_length=10)), ('check_rule', models.CharField(max_length=20)), ('check_pattern', models.CharField(max_length=3000)), ('output_params', models.TextField(max_length=6000)), ('protocol', models.CharField(max_length=10)), ('host', models.CharField(max_length=30)), ('port', models.CharField(max_length=6)), ('status', models.CharField(max_length=5)), ('case', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='website.API_case_tree')), ], ), migrations.CreateModel( name='API_test_plan', fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), ('project_name', models.CharField(max_length=100)), ('plan_name', models.CharField(max_length=50)), ('plan_desc', models.CharField(max_length=200)), ('valid_flag', models.CharField(max_length=5)), ('order', models.IntegerField()), ('project', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='website.API_project_setting')), ], ), migrations.CreateModel( name='API_test_report_for_case', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ('execution_num', models.CharField(max_length=30)), ('plan_id', models.IntegerField()), ('case_id', models.IntegerField()), ('case_path', models.CharField(max_length=1000)), ('case_name', models.CharField(max_length=100)), ('run_result', models.CharField(max_length=10)), ('run_time', models.CharField(max_length=30)), ('remark', models.CharField(max_length=3000)), ('time_took', models.CharField(max_length=20)), ], ), migrations.CreateModel( name='API_test_report_for_case_step', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ('execution_num', models.CharField(max_length=30)), ('plan_id', models.IntegerField()), ('case_id', models.IntegerField()), ('step_id', models.IntegerField()), ('order', models.IntegerField()), ('step_type', models.CharField(max_length=10)), ('op_object', models.CharField(max_length=5000)), ('object_id', models.BigIntegerField()), ('exec_operation', models.CharField(max_length=50)), ('protocol', models.CharField(max_length=10)), ('host', models.CharField(max_length=30)), ('port', models.CharField(max_length=6)), ('request_header', models.CharField(max_length=2000)), ('request_method', models.CharField(max_length=10)), ('url_or_sql', models.CharField(max_length=2000)), ('input_params', models.CharField(max_length=3000)), ('response_to_check', models.CharField(max_length=10)), ('check_rule', models.CharField(max_length=20)), ('check_pattern', models.CharField(max_length=3000)), ('output_params', models.TextField(max_length=7000)), ('run_result', models.CharField(max_length=10)), ('remark', models.CharField(max_length=3000)), ('run_time', models.CharField(max_length=30)), ('run_id', models.BigIntegerField()), ], ), migrations.CreateModel( name='API_test_report_for_summary', fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), ('execution_num', models.CharField(max_length=30)), ('project_id', models.IntegerField()), ('plan_id', models.IntegerField()), ('project_name', models.CharField(max_length=100)), ('plan_name', models.CharField(max_length=50)), ('start_time', models.CharField(max_length=30)), ('end_time', models.CharField(max_length=30)), ('time_took', models.CharField(max_length=20)), ('case_total_num', models.IntegerField()), ('case_pass_num', models.IntegerField()), ('case_fail_num', models.IntegerField()), ('case_block_num', models.IntegerField()), ('remark', models.CharField(max_length=3000)), ], ), migrations.CreateModel( name='Assertion_type_setting', fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), ('op_type', models.CharField(max_length=10)), ('assertion_type', models.CharField(max_length=50)), ('assertion_pattern', models.CharField(max_length=2000)), ('order', models.IntegerField()), ], ), migrations.CreateModel( name='Browser_setting', fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), ('browser', models.CharField(max_length=20)), ('order', models.IntegerField()), ], ), migrations.CreateModel( name='Database_setting', fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), ('db_type', models.CharField(max_length=10)), ('db_alias', models.CharField(max_length=20)), ('db_name', models.CharField(max_length=20)), ('db_host', models.CharField(max_length=20)), ('db_port', models.IntegerField()), ('db_user', models.CharField(max_length=20)), ('db_passwd', models.CharField(max_length=20)), ('environment', models.CharField(max_length=20)), ('project_type', models.CharField(max_length=10)), ('project_name', models.CharField(max_length=50)), ('project_id', models.IntegerField()), ('order', models.IntegerField()), ], ), migrations.CreateModel( name='Function_setting', fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), ('function_name', models.CharField(max_length=20)), ('param_style', models.CharField(max_length=100)), ('order', models.IntegerField()), ], ), migrations.CreateModel( name='Global_variable_setting', fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), ('name', models.CharField(max_length=50)), ('value', models.CharField(max_length=3000)), ('environment', models.CharField(max_length=20)), ('project_type', models.CharField(max_length=10)), ('project_name', models.CharField(max_length=50)), ('project_id', models.IntegerField()), ('order', models.IntegerField()), ], ), migrations.CreateModel( name='Navigation', fields=[ ('id', models.IntegerField(primary_key=True, serialize=False)), ('menu_name', models.CharField(max_length=20)), ('parent_id', models.IntegerField()), ('url', models.CharField(max_length=500)), ('icon', models.CharField(max_length=15)), ('order', models.IntegerField()), ], ), migrations.CreateModel( name='Operation_for_object', fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), ('object_type', models.CharField(max_length=10)), ('operation', models.CharField(max_length=50)), ('order', models.IntegerField()), ], ), migrations.CreateModel( name='Page_element', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ('element_name', models.CharField(max_length=100)), ('selector1', models.CharField(max_length=150)), ('selector2', models.CharField(max_length=150)), ('order', models.IntegerField()), ], ), migrations.CreateModel( name='Page_tree', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ('text', models.CharField(max_length=50)), ('state', models.CharField(max_length=10)), ('parent_id', models.IntegerField()), ('iconCls', models.CharField(max_length=20)), ('attributes', models.CharField(max_length=100)), ('order', models.IntegerField()), ], ), migrations.CreateModel( name='Project_chosen', fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), ('project_id', models.IntegerField()), ('project_name', models.CharField(max_length=50)), ('tree_type', models.CharField(max_length=20)), ], ), migrations.CreateModel( name='Promble_feedback', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ('desc', models.CharField(max_length=300)), ('status', models.CharField(max_length=10)), ('issuer', models.CharField(max_length=10)), ('tracer', models.CharField(max_length=10)), ('handler', models.CharField(max_length=10)), ('record_time', models.CharField(max_length=20)), ('start_trace_time', models.CharField(max_length=20)), ('solved_time', models.CharField(max_length=20)), ('mark', models.CharField(max_length=100)), ('order', models.IntegerField()), ], ), migrations.CreateModel( name='Running_plan', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ('running_plan_num', models.BigIntegerField()), ('running_plan_name', models.CharField(max_length=50)), ('project_type', models.CharField(max_length=10)), ('project_id', models.IntegerField()), ('project_name', models.CharField(max_length=50)), ('plan_name', models.CharField(max_length=50)), ('plan_id', models.CharField(max_length=500)), ('script_dirpath', models.CharField(max_length=200)), ('python_path', models.CharField(max_length=200)), ('valid_flag', models.CharField(max_length=5)), ('running_status', models.CharField(max_length=10)), ('remark', models.CharField(max_length=1000)), ('order', models.IntegerField()), ], ), migrations.CreateModel( name='Sprint_tree', fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), ('text', models.CharField(max_length=50)), ('state', models.CharField(max_length=10)), ('parent_id', models.IntegerField()), ('iconCls', models.CharField(max_length=20)), ('attributes', models.CharField(max_length=100)), ('order', models.IntegerField()), ], ), migrations.CreateModel( name='Test_project_setting', fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), ('project_name', models.CharField(max_length=50)), ('valid_flag', models.CharField(max_length=5)), ('order', models.IntegerField()), ], ), migrations.CreateModel( name='Test_task_detail', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ('module', models.CharField(max_length=100)), ('requirement', models.CharField(max_length=100)), ('person_in_charge', models.CharField(max_length=20)), ('sub_task', models.CharField(max_length=100)), ('progress', models.CharField(max_length=10)), ('time_took', models.CharField(max_length=10)), ('deadline', models.CharField(max_length=20)), ('finish_time', models.CharField(max_length=20)), ('if_delay', models.CharField(max_length=4)), ('history_progress', models.CharField(max_length=400)), ('remark', models.CharField(max_length=200)), ('order', models.IntegerField()), ('page', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='website.Sprint_tree')), ], ), migrations.CreateModel( name='Test_task_overview', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ('module', models.CharField(max_length=100)), ('progress', models.CharField(max_length=10)), ('requirement', models.CharField(max_length=100)), ('sub_task', models.CharField(max_length=100)), ('time_for_test', models.CharField(max_length=20)), ('real_time_for_test', models.CharField(max_length=20)), ('if_delay', models.CharField(max_length=2)), ('developer_in_charge', models.CharField(max_length=50)), ('tester_in_charge', models.CharField(max_length=20)), ('pm_in_charge', models.CharField(max_length=10)), ('mark', models.CharField(max_length=100)), ('order', models.IntegerField()), ('page', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='website.Sprint_tree')), ], ), migrations.CreateModel( name='UI_case_tree', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ('text', models.CharField(max_length=50)), ('state', models.CharField(max_length=10)), ('parent_id', models.IntegerField()), ('iconCls', models.CharField(max_length=20)), ('attributes', models.CharField(max_length=100)), ('order', models.IntegerField()), ], ), migrations.CreateModel( name='UI_case_tree_test_plan', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ('plan_id', models.IntegerField()), ('node_name', models.CharField(max_length=50)), ('node_path', models.CharField(max_length=1000)), ('sub_node_num', models.IntegerField()), ('order', models.IntegerField(default=0)), ('node', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='website.UI_case_tree')), ], ), migrations.CreateModel( name='UI_project_setting', fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), ('project_name', models.CharField(max_length=50)), ('home_page', models.CharField(max_length=500)), ('environment', models.CharField(max_length=20)), ('valid_flag', models.CharField(max_length=5)), ('order', models.IntegerField()), ], ), migrations.CreateModel( name='UI_test_case_step', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ('order', models.IntegerField()), ('object_type', models.CharField(max_length=10)), ('page_name', models.CharField(max_length=1000)), ('object', models.CharField(max_length=50)), ('exec_operation', models.CharField(max_length=50)), ('input_params', models.CharField(max_length=500)), ('output_params', models.CharField(max_length=100)), ('assert_type', models.CharField(max_length=20)), ('assert_pattern', models.CharField(max_length=1000)), ('run_times', models.IntegerField()), ('try_for_failure', models.IntegerField()), ('status', models.CharField(max_length=5)), ('object_id', models.IntegerField()), ('case', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='website.UI_case_tree')), ], ), migrations.CreateModel( name='UI_test_plan', fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), ('project_name', models.CharField(max_length=100)), ('plan_name', models.CharField(max_length=50)), ('plan_desc', models.CharField(max_length=200)), ('browsers', models.CharField(max_length=20)), ('valid_flag', models.CharField(max_length=5)), ('order', models.IntegerField()), ('project', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='website.UI_project_setting')), ], ), migrations.CreateModel( name='UI_test_report_for_case', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ('execution_num', models.CharField(max_length=30)), ('plan_id', models.IntegerField()), ('case_id', models.IntegerField()), ('case_path', models.CharField(max_length=1000)), ('case_name', models.CharField(max_length=100)), ('run_result', models.CharField(max_length=10)), ('run_time', models.CharField(max_length=30)), ('remark', models.CharField(max_length=3000)), ('time_took', models.CharField(max_length=20)), ], ), migrations.CreateModel( name='UI_test_report_for_case_step', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ('execution_num', models.CharField(max_length=30)), ('plan_id', models.IntegerField()), ('case_id', models.IntegerField()), ('step_id', models.IntegerField()), ('order', models.IntegerField()), ('page', models.CharField(max_length=1000)), ('object', models.CharField(max_length=200)), ('exec_operation', models.CharField(max_length=10)), ('input_params', models.CharField(max_length=500)), ('output_params', models.CharField(max_length=500)), ('assert_type', models.CharField(max_length=100)), ('check_pattern', models.CharField(max_length=500)), ('run_times', models.IntegerField()), ('try_for_failure', models.IntegerField()), ('run_result', models.CharField(max_length=10)), ('remark', models.CharField(max_length=500)), ('run_time', models.CharField(max_length=30)), ('run_id', models.BigIntegerField()), ], ), migrations.CreateModel( name='UI_test_report_for_summary', fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), ('execution_num', models.CharField(max_length=30)), ('project_id', models.IntegerField()), ('plan_id', models.IntegerField()), ('project_name', models.CharField(max_length=100)), ('plan_name', models.CharField(max_length=50)), ('browser', models.CharField(max_length=20)), ('start_time', models.CharField(max_length=30)), ('end_time', models.CharField(max_length=30)), ('time_took', models.CharField(max_length=20)), ('case_total_num', models.IntegerField()), ('case_pass_num', models.IntegerField()), ('case_fail_num', models.IntegerField()), ('case_block_num', models.IntegerField()), ('remark', models.CharField(max_length=3000)), ], ), migrations.AddField( model_name='ui_case_tree', name='project', field=models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, to='website.UI_project_setting'), ), migrations.AddField( model_name='sprint_tree', name='project', field=models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, to='website.Test_project_setting'), ), migrations.AddField( model_name='page_tree', name='project', field=models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, to='website.UI_project_setting'), ), migrations.AddField( model_name='page_element', name='page', field=models.ForeignKey( on_delete=django.db.models.deletion.PROTECT, to='website.Page_tree'), ), migrations.AddField( model_name='api_case_tree', name='project', field=models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, to='website.API_project_setting'), ), ]
class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateModel( name='Druh', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('oznaceni_druhu', models.CharField( help_text= 'Zadejte text o maximální délce 50 znaků; text musí být jedinečný', max_length=50, unique=True, verbose_name='Označení druhu nábytku')), ('oblast', models.CharField(blank=True, choices=[('postele', 'Postele'), ('pohovky', 'Pohovky'), ('knihovny a policové díly', 'Knihovny a policové díly'), ('stoly', 'Stoly'), ('skříňky a příborníky', 'Skříňky a příborníky')], default='postele', help_text='Vyberte označení oblasti', max_length=50, verbose_name='Oblast')), ], options={ 'verbose_name': 'Druh nábytku', 'verbose_name_plural': 'Druh nábytku', 'ordering': ['oznaceni_druhu'], }, ), migrations.CreateModel( name='Nabytek', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('nazev', models.CharField( help_text='Zadejte text o maximální délce 100 znaků', max_length=100, verbose_name='Název nábytku')), ('popis', models.TextField(blank=True, null=True, verbose_name='Popis nábytku')), ('cena', models.FloatField( help_text='Zadejte nezáp**né desetinné číslo', null=True, validators=[ django.core.validators.MinValueValidator(0.0) ], verbose_name='Cena')), ('foto', models.ImageField(blank=True, null=True, upload_to='zbozi/%Y/%m/%d/', verbose_name='Fotka nábytku')), ('druh', models.ForeignKey( on_delete=django.db.models.deletion.RESTRICT, to='ikea.druh')), ], options={ 'verbose_name': 'Nábytek', 'verbose_name_plural': 'Nábytek', 'ordering': ['-cena', 'nazev'], }, ), ]
class Message(models.Model): mescode = models.BigAutoField(primary_key=True) mescontent = models.TextField('Message') mescontentoriginal = models.TextField('MessageOriginal', null=True, blank=True) mesdatetime = models.DateTimeField('Datetime to send message', default=timezone.now, db_index=True) mesread = models.BooleanField(default=False) roocode = models.ForeignKey(Room, models.DO_NOTHING, db_column='roocode', related_name='messages_room') clicodesent = models.ForeignKey(Client, models.DO_NOTHING, db_column='clicodesent', related_name='message_clientsent') clicoderecieved = models.ForeignKey(Client, models.DO_NOTHING, db_column='clicoderecieved', related_name='message_clientrecieved') clicodemanager = models.ForeignKey(Client, models.DO_NOTHING, db_column='clicodemanager', blank=True, null=True, related_name='message_clientmanager') def __unicode__(self): return ('[{mesdatetime}] {clicodesent} {clicoderecieved}:' '{mescontent}').format(**self.as_dict()) @property def formatted_mesdatetime(self): return self.mesdatetime.strftime('%Y-%m-%d %H:%M:%S') @property def mescontentshort(self): original = self.mescontent messhortcontent = '' i = 0 inicio = [] fin = [] while (original.find("<img", i) > -1): i = original.find("<img", i) f = original.find(">", i) + 1 inicio.append(i) fin.append(f) i = f lon = len(inicio) if (lon > 0): arr = [] if (inicio[0] != 0): # es texto arr.append(original[0:inicio[0]]) for i in range(lon): if i > 0: indexfin = fin[i - 1] indexinicio = inicio[i] if (indexfin != indexinicio): # es texto arr.append(original[indexfin:indexinicio]) arr.append(original[inicio[i]:fin[i]]) # es imagen indexend = len(original) - 1 if (fin[lon - 1] < indexend): # es texto arr.append(original[fin[lon - 1]:]) meslon = 0 for i in range(len(arr)): if (arr[i][0] == "<"): lonnewtext = 5 img = True else: lonnewtext = len(arr[i]) img = False if ((meslon + lonnewtext) > 30): if (img is False): quedan = 30 - meslon messhortcontent = messhortcontent + arr[i][:quedan] break else: meslon = meslon + lonnewtext messhortcontent = messhortcontent + arr[i] else: messhortcontent = original[0:40] return messhortcontent def set_message(content): position = content.find("@") if position >= 0: content = content.partition("@")[0] + "*********" arr = content.split(" ") lista = [ 'arroba', 'arrova', 'aroba', 'arova', 'give money', 'give me money', 'tarjeta', 'credit card', 'money', 'email', 'mail', 'email address', 'facebook', 'fb', 'instagram', 'phone', 'cc', 'phone number', 'twitter', 'tw', 'western union', 'money gram', 'http', 'gmail', 'hotmail', '.com', 'doctor', 'payment', 'medical', 'target', 'mastercard', 'visa', 'dollar', 'dolar', 'card', 'credit', 'yahoo', 'bitcoins', 'gift', 'cellphone' ] lista_temp = [] for a in arr: encontrado = False for x in lista: if a.lower() == x: encontrado = True arr.remove(a) break if encontrado is True: lista_temp.append("**") else: lista_temp.append(a) content = "" for a in lista_temp: if content == "": content = a else: content = "%s %s" % (content, a) return content def quantityNotRead(clicode): total = Message.objects.filter(clicoderecieved=clicode, mesread=False).count() return total def as_dict(self): return { 'mescode': self.mescode, 'clicodesent': self.clicodesent.clicode, 'clicoderecieved': self.clicoderecieved.clicode, 'mescontent': self.mescontent, 'mesdatetime': self.formatted_mesdatetime, 'mescontentshort': self.mescontentshort, } def as_list(self, clicode=0): msg_list = { 'sentcode': self.clicodesent.clicode, 'sentprofilepicture': self.clicodesent.profile_picture, 'sentusername': self.clicodesent.cliusername, 'sentage': self.clicodesent.age, 'mescontent': self.mescontentshort, 'recievedcode': self.clicoderecieved.clicode, 'recievedprofilepicture': self.clicoderecieved.profile_picture, 'recievedusername': self.clicoderecieved.cliusername, 'recievedage': self.clicoderecieved.age, } if int(clicode) > 0: msg_list['msg_qty'] = Message.objects.filter( clicoderecieved=clicode, mesread=False, roocode=self.roocode.roocode).count() else: msg_list['msg_qty'] = 0 return msg_list class Meta: db_table = 'message'
class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateModel( name='Resume', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=50)), ('dob', models.DateField()), ('gender', models.CharField(max_length=50)), ('locality', models.CharField(max_length=100)), ('city', models.CharField(max_length=100)), ('pin', models.PositiveIntegerField()), ('state', models.CharField(choices=[ ('Andhra Pradesh', 'Andhra Pradesh'), ('Arunachal Pradesh ', 'Arunachal Pradesh '), ('Assam', 'Assam'), ('Bihar', 'Bihar'), ('Chhattisgarh', 'Chhattisgarh'), ('Goa', 'Goa'), ('Gujarat', 'Gujarat'), ('Haryana', 'Haryana'), ('Himachal Pradesh', 'Himachal Pradesh'), ('Jammu and Kashmir ', 'Jammu and Kashmir '), ('Jharkhand', 'Jharkhand'), ('Karnataka', 'Karnataka'), ('Kerala', 'Kerala'), ('Madhya Pradesh', 'Madhya Pradesh'), ('Maharashtra', 'Maharashtra'), ('Manipur', 'Manipur'), ('Meghalaya', 'Meghalaya'), ('Mizoram', 'Mizoram'), ('Nagaland', 'Nagaland'), ('Odisha', 'Odisha'), ('Punjab', 'Punjab'), ('Rajasthan', 'Rajasthan'), ('Sikkim', 'Sikkim'), ('Tamil Nadu', 'Tamil Nadu'), ('Telangana', 'Telangana'), ('Tripura', 'Tripura'), ('Uttar Pradesh', 'Uttar Pradesh'), ('Uttarakhand', 'Uttarakhand'), ('West Bengal', 'West Bengal'), ('Andaman and Nicobar Islands', 'Andaman and Nicobar Islands'), ('Chandigarh', 'Chandigarh'), ('Dadra and Nagar Haveli', 'Dadra and Nagar Haveli'), ('Daman and Diu', 'Daman and Diu'), ('Lakshadweep', 'Lakshadweep'), ('National Capital Territory of Delhi', 'National Capital Territory of Delhi'), ('Puducherry', 'Puducherry') ], max_length=100)), ('mobile', models.PositiveIntegerField()), ('email', models.EmailField(max_length=254)), ('job_city', models.CharField(max_length=20)), ('profile_image', models.ImageField(upload_to='profile_images')), ('my_file', models.FileField(upload_to='document-file')), ], ), ]