class GraphObject(models.Model): connections = models.ArrayModelField(model_container=GraphConnection) nodes = models.ArrayModelField(model_container=GraphNode) date_created = models.DateTimeField(auto_now_add=True) def share_url(self): return f'http://127.0.0.1:8000/vis-shared-graph/{self.id}'
class RoomReservationView(models.Model): reservation_id = models.AutoField(primary_key=True) hotel_id = models.ForeignKey(Hotel, on_delete=models.CASCADE) customer_id = models.ForeignKey(Customer, on_delete=models.CASCADE) room_id = models.ForeignKey(Room, on_delete=models.CASCADE) reservation_description = models.CharField(max_length=60) from_date = models.DateField() to_date = models.DateField() number_of_adults = models.IntegerField() number_of_children = models.IntegerField() payment_no = models.CharField(max_length=120, blank=True, null=True) hotel = models.ArrayModelField(model_container=Hotel, ) customer = models.ArrayModelField(model_container=Customer, ) room = models.ArrayModelField(model_container=Room, ) def get_absolute_url(self): return reverse('HotelsAppCRUD:rooms_reservation_index') def __str__(self): return "(%s) %s (%s) (%s)" % (self.reservation_id, self.reservation_description, self.from_date, self.to_date) class Meta: managed = False db_table = 'HotelsAppCRUD_roomreservation_view'
class User(models.Model): username = models.CharField(max_length=200) password = models.CharField(max_length=200) first_name = models.CharField(max_length=20) last_name = models.CharField(max_length=20) uid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) account_creation_date = models.DateTimeField(auto_now_add=True, null=True, blank=True, editable=True) linked_platforms = models.ArrayModelField(model_container=LinkedPlatform, null=True) notifications = models.ArrayModelField(model_container=Notification, null=True) summary_stats = models.ArrayModelField(model_container=SummaryStats, null=True) def __str__(self): return "UID: " + str( self.uid ) + ", Username: "******", Password: " + self.password
class Teacher(models.Model): year_choices = (('N/A', 'N/A'), ('F.E', 'F.E'), ('S.E', 'S.E'), ('T.E', 'T.E'), ('B.E', 'B.E')) dept_choices = ( ('comp', 'Computer Engineering'), ('civil', 'Civil Engineering'), ('mech', 'Mechanical Engineering'), ('it', 'Information Technology Engineering'), ('e&tc', 'E&TC Engineering'), ('inst', 'Instrumental Engineering'), ('prod', 'Production Engineering'), ) name = models.CharField(max_length=80, unique=True) user = models.OneToOneField(User, on_delete=models.CASCADE) username = models.CharField(max_length=50, primary_key=True) email_id = models.CharField(max_length=50) primary_phone_no = models.CharField(max_length=10) secondary_phone_no = models.CharField(max_length=10) cc = models.CharField(max_length=3, choices=year_choices, default='None') department = models.CharField(max_length=50, choices=dept_choices) subjects = models.ArrayModelField(model_container=Subjects) labs = models.ArrayModelField(model_container=Labs) def __str__(self): return self.name
class SourceContent(models.Model): tool_name = models.CharField(max_length=30) source = models.CharField(max_length=30) references = models.ArrayModelField(Reference) publishLnks = models.ArrayModelField(PublishUrls) rotationPeriod = models.IntegerField objects = models.DjongoManager()
class Recipe(models.Model): title = models.CharField(max_length=200) ingredients = models.ArrayModelField(model_container=Ingredient) nutritions = models.ArrayModelField(model_container=Nutrition) instructions = models.TextField() def __str__(self): return self.title
class episodic_memory(models.Model): _clack = models.BooleanField(default=False) _index_ready_to_learn = models.IntegerField() group_list = models.ArrayModelField( model_container=CulturalGroup ) _recognized_indexes = models.ArrayModelField( model_container= models.IntegerField(), default=-1 )
class Evaluation(models.Model): source = models.CharField(max_length=10) model_name = models.CharField(max_length=20) model_version = models.CharField(max_length=6) sentence = models.CharField(max_length=200) status = models.CharField(max_length=10) auto_tag = models.ArrayModelField(model_container=WordTag) verify_tag = models.ArrayModelField(model_container=UserTag) objects = models.DjongoManager()
class Stock(models.Model): C_ID = models.CharField(max_length=8, primary_key=True) C_Name = models.CharField(max_length=20) C_Current = models.FloatField(default=0) D_Input = models.ArrayModelField(model_container=InputEntry) D_Record = models.ArrayModelField(model_container=Record) def __str__(self): return self.C_ID class Meta: app_label = 'Distributor'
class UserProfile(models.Model): uid = models.IntegerField( unique=True, primary_key=True) #unique=True,primary_key = True degree = models.CharField('user degree', max_length=50) # store tags as json interests = models.ArrayModelField(model_container=Interests, ) paper_collections = models.ArrayModelField(model_container=StringField, ) news_collections = models.ArrayModelField(model_container=StringField, ) github_collections = models.ArrayModelField(model_container=StringField, ) def __str__(self): return self.interests.__str__()
class Hand(models.Model): _id = models.ObjectIdField() players = models.ArrayModelField(model_container=PlayerById, ) turn_player_scores = models.ArrayModelField(model_container=PlayerScore, ) flop_player_scores = models.ArrayModelField(model_container=PlayerScore, ) river_player_scores = models.ArrayModelField(model_container=PlayerScore, ) board = models.EmbeddedModelField(model_container=Board) objects = models.DjongoManager()
class Story(models.Model): story_Name = models.CharField(max_length=100) as_Data = models.CharField(max_length=100) iWant = models.CharField(max_length=100) sothat = models.CharField(max_length=100) testcases = models.ArrayModelField( model_container=TestCase, model_form_class=TestCaseForm ) criterias = models.ArrayModelField( model_container=Criteria, model_form_class=CriteriaForm ) objects = models.DjongoManager()
class UserTag(models.Model): user_id = models.CharField(max_length=20) created_at = models.DateTimeField() tag = models.ArrayModelField(model_container=WordTag) class Meta: abstract = True
class am_net(models.Model): _clack = models.BooleanField(default=False) _index_ready_to_learn = models.IntegerField() group_list = models.ArrayModelField( model_container= CulturalGroup #,model_form_class= )
class Institution(models.Model): institution_Name = models.CharField(max_length=50) institution_Number = models.IntegerField(default=0) class_name = models.ArrayModelField(model_container=Class, ) objects = InstitutionManager() def __str__(self): return self.institution_Name def find(self, classname, type=None): if type is None: return [ obj for obj in self.class_name if obj.class_name == classname ][0] else: return [ obj for obj in self.class_name if obj.class_name == classname ] def app(self, new): newclass = [obj for obj in self.class_name] newclass.append(new) return newclass
class ArrayEntry(models.Model): headline = models.CharField(max_length=255) authors = models.ArrayModelField(model_container=ArrayAuthor) _id = models.ObjectIdField() def __str__(self): return self.headline
class Standard(models.Model): """root node of the data""" _id = models.ObjectIdField() name = models.TextField(max_length=100) tags = models.ArrayModelField(model_container=Tag) """list of child nodes"""
class Overview(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) stock_list = models.ArrayModelField(model_container=Record, ) # category_groups = models.ArrayField(models.CharField(max_length=15), null=True, blank=True) def add_stock(self, _stock_id: str): record = Record(stock_id=_stock_id) self.stock_list.append(record) self.save() def remove_stock(self, stock_id: str): idx = self.get_stock(stock_id) if idx == -1: return False else: del self.stock_list[idx] self.save() return True def get_stock(self, stock_id: str): find = -1 for i in range(0, len(self.stock_list)): if self.stock_list[i].stock_id == stock_id: find = i break return find def has_stock(self, stock_id: str): return self.get_stock(stock_id) != -1 def __str__(self): return "user:{0}, list: {1}".format( self.user.username, ','.join(str(x) for x in self.stock_list))
class usertag(models.Model): user = models.EmbeddedModelField( model_container=User, ) tags = models.ArrayModelField( model_container=Tag, ) watched_news = models.ArrayModelField( model_container=news, ) clicked_news = models.ArrayModelField( model_container=news, )
class CategoryCourse(models.Model): _id = models.ObjectIdField(primary_key=True) namecourse = models.CharField(max_length=400) subcourse = models.ArrayModelField(model_container=SubCateCourse, model_form_class=SubCateCourseForm, blank=True) createdate = models.DateField(default=timezone.now, editable=True) status = models.BooleanField(default=True) def __str__(self): return self.namecourse def __iter__(self): return self def getall(self): return { "id": str(self.pk), "namecourse": self.namecourse, "subcourse": [{ "namesubcourse": val.namesubcourse, "subcoursecode": str(val.subcoursecode) } for val in self.subcourse], "createdate": str(self.createdate), "status": self.status }
class LogDay(models.Model): day = models.IntegerField() #Day of the month (1-31 typically) month = models.IntegerField() #Month represented by integer 1-12 year = models.IntegerField() #Year (i.e. 2019) entries = models.ArrayModelField( model_container=LogEntry, #names of exercises/routines )
class Stream(models.Model): stream_name = models.CharField(max_length=30) classteacher = models.CharField(max_length=40) exam = models.ArrayModelField(model_container=Exam, ) def __str__(self): return self.stream_name def find(self, examname, type=None): if type is None: return [obj for obj in self.exam if obj.exam_name == examname][0] else: return [obj for obj in self.exam if obj.exam_name == examname] def find_ordinal(self, examname, type=None): if type is None: return [ self.exam.index(obj) for obj in self.exam if obj.exam_name == examname ][0] else: return [ self.exam.index(obj) for obj in self.exam if obj.exam_name == examname ] def app(self, new): newexam = [obj for obj in self.exam] newexam.append(new) return newexam
class Capture(djongo_models.Model): LOCAL = 'local' DRIVE = 'drive' REMOTE = 'remote' FILE_LOCATION = ((LOCAL, 'Local'), (DRIVE, 'Drive'), (REMOTE, 'Remote')) SCHEDULED = "S" MANUAL = "M" source_type = djongo_models.CharField(max_length=10, choices=FILE_LOCATION, default=LOCAL) file_source = djongo_models.CharField(max_length=10) document_type = djongo_models.ArrayModelField( model_container=DocTypeFields) target_type = djongo_models.CharField(max_length=10, choices=FILE_LOCATION, default=DRIVE) file_target = djongo_models.CharField(max_length=10) created = djongo_models.DateTimeField(auto_now_add=True) last_update = djongo_models.DateTimeField(auto_now=True) status = djongo_models.CharField(max_length=1, editable=False, default=MANUAL) trigger = djongo_models.EmbeddedModelField(model_container=CaptureTrigger, blank=True) def __str__(self): return f'CaptureID {self.id}'
class DeviceTypes(models.Model): device_type = models.CharField(max_length=100) device_handler = models.CharField(max_length=100) commands = models.ArrayModelField(model_container=CommandModel, model_form_class=CommandForm) def __str__(self): return self.device_type
class MultipleBlogPosts(models.Model): h1 = models.CharField(max_length=100) content = models.ArrayModelField( model_container=BlogContentSimple, model_form_class=BlogContentForm ) objects = models.DjongoManager()
class AttendanceLab(models.Model): date = models.DateField() from_time = models.TimeField() to_time = models.TimeField() lab = models.CharField(max_length=10) batch = models.CharField(max_length=5) year = models.CharField(max_length=3) attendance = models.ArrayModelField(model_container=Attendance)
class FoodItem(models.Model): name = models.CharField(max_length=100) food_group = models.CharField(max_length=100) #data should be an array of nutrients data = models.ArrayModelField(model_container=Data, ) def __str__(self): return self.name
class RbfNeuron_s(models.Model): Snb_s = models.ForeignKey(snb_s, on_delete=models.CASCADE) _has_knowledge = models.BooleanField(default= False) _radius = models.FloatField(default=24) _degraded = models.BooleanField(default= False) _index_recognize = models.ArrayModelField( model_container= models.IntegerField() )
class Complain(models.Model): Ration_id = models.CharField(max_length=15) Date = models.DateField(auto_now=True) status = models.CharField(max_length=20) comp = models.ArrayModelField(model_container=Multicomplain) class Meta: app_label = 'Distributor'
class Restaurant_Reviews(noSQLModels.Model): def __str__(self): return self.restaurant_name restaurant_name = noSQLModels.CharField(max_length=50) location = noSQLModels.CharField(max_length=50) avg_rating = noSQLModels.DecimalField(max_digits=2, decimal_places=1) review_list = noSQLModels.ArrayModelField( model_container=Reviews, model_form_class=ReviewForm, ) tag_list = noSQLModels.ArrayModelField( model_container=Cuisine_Tags, model_form_class=CuisineForm, ) review_count = noSQLModels.IntegerField(default=0) rating_sum = noSQLModels.IntegerField(default=0)