Esempio n. 1
0
class TENANT(MongoModel):
    name = CharField()
    logo = ObjectIdField()
    remark = CharField()
    resources = ListField(blank=True)
    delete = BooleanField()
    activated = BooleanField()
    namespace = CharField()
    createdAt = DateTimeField()
    updatedAt = DateTimeField()

    class Meta:
        collection_name = 'tenant'
        final = True
Esempio n. 2
0
class CERTIFICATION(MongoModel):
    certification = CharField()
    delete = BooleanField()

    class Meta:
        collection_name = 'certification'
        final = True
Esempio n. 3
0
class CATEGORY(MongoModel):
    name = CharField()
    delete = BooleanField()

    class Meta:
        collection_name = 'category'
        final = True
Esempio n. 4
0
class State(MongoModel):
    state_name = CharField(verbose_name="Name of State",
                           primary_key=True,
                           required=True)

    class Meta:
        write_concern = WriteConcern(j=True)
        connection_alias = LOCAL_DB_ALIAS
Esempio n. 5
0
class TYPE(MongoModel):
    name = CharField()
    category = ReferenceField(CATEGORY)
    delete = BooleanField()

    class Meta:
        collection_name = 'type'
        final = True
Esempio n. 6
0
class CUSTOM(MongoModel):
    tenant = ReferenceError(TENANT)
    name = CharField()
    logo = ListField()
    background = CharField()
    remark = CharField()
    description = CharField()
    characteristic = ListField()
    introduction = ListField()
    tags = ListField()
    connect = DictField()
    createdAt = DateTimeField()
    updatedAt = DateTimeField()
    delete = BooleanField()

    class Meta:
        collection_name = 'custom'
        final = True
Esempio n. 7
0
class County(MongoModel):
    county_name = CharField(verbose_name="Name of county", primary_key=True)
    parent_state = ReferenceField(State,
                                  verbose_name="States county belongs to",
                                  required=True)
    election_office = EmbeddedDocumentField(
        ElectionOffice, verbose_name="County election office information")

    class Meta:
        write_concern = WriteConcern(j=True)
        connection_alias = LOCAL_DB_ALIAS
Esempio n. 8
0
class City(MongoModel):
    city_name = CharField(verbose_name="Name of city",
                          primary_key=True,
                          required=True)
    parent_county = ReferenceField(County,
                                   verbose_name="County city belongs to",
                                   required=True)
    election_office = ReferenceField(
        ElectionOffice, verbose_name="City election office information")

    class Meta:
        write_concern = WriteConcern(j=True)
        connection_alias = LOCAL_DB_ALIAS
Esempio n. 9
0
class PhysicalAddress(EmbeddedMongoModel):
    state = CharField(verbose_name="Name of state", required=True)
    city = CharField(verbose_name="Name of city", required=True)
    zip_code = CharField(verbose_name="Name of zip code",
                         min_length=5,
                         max_length=5,
                         required=True)
    location_name = CharField(verbose_name="Name of election office",
                              required=True)
    street = CharField(verbose_name="Name of street", required=True)
    apt_unit = CharField(verbose_name="Apartment or unit number")
    po_box = CharField(verbose_name="Name of PO Box")
Esempio n. 10
0
class ZipCode(MongoModel):
    zip_code = CharField(
        verbose_name="Zip Code",
        primary_key=True,
        min_length=5,
        max_length=5,
        required=True,
    )
    parent_city = ReferenceField(City,
                                 verbose_name="City zip code belongs to",
                                 required=True)

    class Meta:
        write_concern = WriteConcern(j=True)
        connection_alias = LOCAL_DB_ALIAS
Esempio n. 11
0
class PROJECT(MongoModel):
    creator = ObjectIdField()
    title = CharField()
    description = CharField()
    requirement = CharField()
    material = CharField()
    reference = CharField()
    tag = ReferenceField(TYPE)
    image = CharField()
    labs = ListField()
    timeConsume = CharField()
    base = ReferenceField('PROJECT', blank=True)
    # base = ReferenceField('PROJECT')
    spec = CharField()
    delete = BooleanField()
    createdAt = DateTimeField()
    updatedAt = DateTimeField()

    class Meta:
        collection_name = 'project'
        final = True
Esempio n. 12
0
class ElectionOffice(EmbeddedMongoModel):
    county_name = CharField(verbose_name="Name of county")
    city_name = CharField(verbose_name="Name of city")
    physical_address = EmbeddedDocumentField(
        PhysicalAddress, verbose_name="Phyiscal address information")
    mailing_address = EmbeddedDocumentField(
        MailingAddress, verbose_name="Mailing address information")
    phone_number = CharField(verbose_name="Office phone number", required=True)
    email_address = EmailField(verbose_name="Office email address")
    office_supervisor = CharField(verbose_name="Name of office supervisor")
    supervisor_title = CharField(verbose_name="Job title of office supervisor")
    website = CharField(verbose_name="Website data was fetched from",
                        required=True)

    class Meta:
        write_concern = WriteConcern(j=True)
        connection_alias = LOCAL_DB_ALIAS
Esempio n. 13
0
class USER(MongoModel):
    name = CharField()
    key = CharField()
    role = IntegerField()
    mobile = CharField()
    email = CharField()
    remark = CharField()
    thumb = ObjectIdField()
    certification = ObjectIdField(blank=True)
    token = CharField()
    tenant = ObjectIdField(blank=True)
    delete = BooleanField()
    createdAt = DateTimeField()
    updatedAt = DateTimeField()
    lastLogin = DateTimeField()

    class Meta:
        collection_name = 'user'
        final = True
Esempio n. 14
0
 class SameMongoName(MongoModel):
     field = CharField()
     new_field = CharField(mongo_name='field')
Esempio n. 15
0
 class Document(MongoModel):
     name = CharField()
Esempio n. 16
0
        class Document(MongoModel):
            name = CharField()

            class Meta:
                ignore_unknown_fields = True
Esempio n. 17
0
class MailingAddress(PhysicalAddress):
    street = CharField(verbose_name="Name of street")
Esempio n. 18
0
 class ModelWithBlankField(MongoModel):
     field = CharField(blank=True)
Esempio n. 19
0
 class Document(MongoModel):
     name = CharField()
     age = IntegerField()
Esempio n. 20
0
 class SameMongoNameAsParent(Parent):
     child_field = CharField()
Esempio n. 21
0
        class Article(MongoModel):
            title = CharField()

            class Meta:
                connection_alias = 'foo-connection'
Esempio n. 22
0
        class Article(MongoModel):
            title = CharField()

            class Meta:
                connection_alias = 'foo-connection'
                indexes = [IndexModel([('title', 1)])]
Esempio n. 23
0
 class Parent(MongoModel):
     field = CharField(mongo_name='child_field')