コード例 #1
0
ファイル: models.py プロジェクト: Lucas-Armand/pyGovBR
class Licitacao(models.Model):

    # atomic Fields
    numero_aviso_licitacao
    identificador_licitacao
    tipo_pregao
    situacao_aviso
    objeto
    numero_processo
    tipo_recurso
    endereco_entrega
    numero_itens_licitacao
    nome_responsavel
    funcao_responsavel
    data_entrega_edital
    endereco_entrega_edital
    data_abertura_proposta
    data_entrega_proposta
    data_publicacao

    # embeedded Fields one-to-one
    uasg = models.EmbeddedModelField(model_container=Uasg)
    pregao = models.EmbeddedModelField(model_container=Pregao)

    # list Fields one-to-many
    itens = models.ListField()

    # choices Fields
    modalidade_licitacao = models.CharField(blank=True,
                                            null=True,
                                            choices=MODALIDADE_LICITACAO_LIST)

    class Meta:
        abstract = True
コード例 #2
0
ファイル: models.py プロジェクト: Lucas-Armand/pyGovBR
class Fornecedor(models.Model):

    _id = models.ObjectIdField()

    # atomic Fields
    cnpj = models.CharField(max_length=20, blank=True, null=True)
    cpf = models.CharField(max_length=20, blank=True, null=True)
    nome = models.CharField(max_length=200, blank=True, null=True)
    ativo = models.BooleanField(default=False)
    recadastrado = models.BooleanField(default=False)
    habilitado_licitar = models.BooleanField(default=False)

    # embeedded Fields one-to-one
    municipio = models.EmbeddedModelField(
        model_container=Municipio)  # Atributo origem id_municipio
    cnae = models.EmbeddedModelField(
        model_container=Cnae)  # Atributo origem id_cnae
    unidade_cadastradora = models.EmbeddedModelField(
        model_container=UnidadeCadastradora
    )  # Atributo origem id_unidade_cadastradora

    # choices Fields
    uf = models.CharField(max_length=3, choices=UF_LIST)
    natureza_juridica = models.IntegerField(choices=NATUREZA_JURIDICA_LIST)
    porte_empresa = models.CharField(choices=PORTE_EMPRESA_LIST)
    ramo_negocio = models.CharField(max_length=4, choices=RAMO_NEGOCIO_LIST)

    class Meta:
        abstract = True
コード例 #3
0
class History(models.Model):
    MaTem = models.CharField(max_length=100, null=True, blank=True)
    MaSP = models.CharField(max_length=100, null=True, blank=True)
    SMS = models.EmbeddedModelField(model_container=SMSHistory)
    App = models.EmbeddedModelField(model_container=AppHistory)
    Web = models.EmbeddedModelField(model_container=WebHistory)
    Call = models.EmbeddedModelField(model_container=CallHistory)
コード例 #4
0
class family(models.Model):
    family_id = models.CharField(primary_key=True, max_length=10)

    profile = models.EmbeddedModelField(model_container=family_profile)
    amenities = models.EmbeddedModelField(model_container=basic_amenities)
    other = models.EmbeddedModelField(model_container=other_service_provision)

    def __str__(self):
        return self.family_id
コード例 #5
0
ファイル: models.py プロジェクト: jwu2020/myData
class SummaryStats(models.Model):
    timestamp = models.DateTimeField(auto_now_add=False, null=True, blank=True)
    fb = models.EmbeddedModelField(model_container=FacebookEntry)
    yt = models.EmbeddedModelField(model_container=YTEntry)
    netflix = models.EmbeddedModelField(model_container=GoogleEntry)
    google = models.EmbeddedModelField(model_container=NetflixEntry)

    class Meta:
        abstract = True

    def __str__(self):
        return str(self.timestamp)
コード例 #6
0
class Product(models.Model):
    symbol = models.CharField(max_length=100)
    product_name = models.CharField(max_length=100)
    amount = models.EmbeddedModelField(
        model_container=Amount
    )
    prices = models.EmbeddedModelField(
        model_container=Prices
    )
    additional_info = models.EmbeddedModelField(
        model_container=AdditionalInfo
    )
    upload_date = models.DateTimeField()
コード例 #7
0
class TF(models.Model):
    tf_name = models.CharField(max_length=100)
    tf_description = models.CharField(max_length=300)
    tf_owner_orga = djongomodels.EmbeddedModelField(model_container=Orga)
    tf_application = djongomodels.EmbeddedModelField(
        model_container=TF_Application)
    criticality = models.CharField(choices=CHOICES, max_length=1)
    highest_criticality_in_AF = models.CharField(choices=CHOICES, max_length=1)

    objects = djongomodels.DjongoManager()

    def __str__(self):
        return self.tf_name
コード例 #8
0
ファイル: models.py プロジェクト: mdamiraaa/DjangoProject
class Testt(model.Model):
    _id = model.ObjectIdField(default='5c4827ae923dac16a72a9d61')
    num_id = model.IntegerField(default="1")
    lang_id = model.IntegerField(default="1")
    lang_name = model.CharField(max_length=200, default="")
    cost = model.IntegerField(default=200)
    subject_1 = model.EmbeddedModelField(model_container=Subject)
    subject_2 = model.EmbeddedModelField(model_container=SubjectWithTexts)
    subject_3 = model.EmbeddedModelField(model_container=Subject)
    subject_12 = model.EmbeddedModelField(
        model_container=SubjectWithEightAnswer)
    subject_13 = model.EmbeddedModelField(
        model_container=SubjectWithEightAnswer)
コード例 #9
0
class Reading(models.Model):
    timestamp = models.DateTimeField()
    ambient_reading = models.EmbeddedModelField(
        model_container=AmbientReading, )
    device_params = models.EmbeddedModelField(model_container=DeviceParams, )
    soil_readings = models.ArrayModelField(model_container=SoilReadings, )
    weight = models.EmbeddedModelField(model_container=Weight, )

    def __str__(self):
        return 'Device Id: %s' % (self.device_params.lysimeter)

    class Meta:
        verbose_name = "Lysimeter"
        verbose_name_plural = "Lysimeters"
コード例 #10
0
class Platforms(models.Model):
    facebook = models.EmbeddedModelField(model_container=FBInstaAdSet)

    instagram = models.EmbeddedModelField(model_container=FBInstaAdSet)

    google = models.EmbeddedModelField(model_container=GoogleAdSet)

    def __init__(self, facebook={}, instagram={}, google={}):
        super().__init__()

        self.instagram = instagram
        self.facebook = facebook
        self.google = google

    class Meta:
        abstract = True
コード例 #11
0
ファイル: utter.py プロジェクト: mfmatos/BotFlowAPI
class Utter(models.Model):
    name = models.TextField()
    alternatives = models.ListField(default=[])
    multiple_alternatives = models.BooleanField(blank=False, default=False)
    project = models.EmbeddedModelField(model_container=Project)

    objects = models.DjongoManager()
コード例 #12
0
class FBInstaAdSet(models.Model):
    status = models.CharField(max_length=32)
    total_budget = models.IntegerField()
    remaining_budget = models.IntegerField()
    start_date = models.IntegerField()
    end_date = models.IntegerField()

    target_audience = models.EmbeddedModelField(
        model_container=FBInstaTargetAudience)

    creatives = models.EmbeddedModelField(model_container=FBInstaCreatives)

    insights = models.EmbeddedModelField(model_container=Insights)

    class Meta:
        abstract = True
コード例 #13
0
ファイル: embedded_models.py プロジェクト: vaimdev/djongo
class EmbeddedEntry(models.Model):
    blog = models.EmbeddedModelField(model_container=EmbeddedBlog)
    headline = models.CharField(max_length=255)
    _id = models.ObjectIdField()

    def __str__(self):
        return self.headline
コード例 #14
0
class Court(models.Model):
    id = models.CharField(primary_key=True,
                          default=uuid.uuid4(),
                          max_length=50,
                          editable=True,
                          unique=True)
    name = models.CharField(max_length=100, blank=False)
    description = models.CharField(max_length=100, blank=True)

    # Address Information
    house_number = models.CharField(max_length=10, blank=True)
    road = models.CharField(max_length=100, blank=False)
    city = models.CharField(max_length=30, blank=False)
    state = models.CharField(max_length=30, blank=False)
    zip_code = models.CharField(max_length=10, blank=False)
    county = models.CharField(max_length=30, blank=True)
    country = models.CharField(max_length=20, blank=False)

    # Rating Information
    likes = models.IntegerField(default=0)
    dislikes = models.IntegerField(default=0)
    court_logo = models.ImageField(max_length=1000, blank=True)
    location = models.EmbeddedModelField(Point)

    objects = MongoDBManager()

    def __str__(self):
        return self.name + " " + self.description
コード例 #15
0
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}'
コード例 #16
0
class PlayerById(models.Model):
    player = models.EmbeddedModelField(model_container=Player)
    hand = ArrayField(models.CharField(max_length=2), size=2)
    scores = ArrayField(models.IntegerField(), size=2)

    class Meta:
        abstract = True
コード例 #17
0
class Disaster(models.Model):

    DANGER_LEVELS = (('E', 'Easy'), ('M', 'Medium'), ('D', 'Danger'),
                     ('ED', 'Extra Danger'))

    #required
    diameter = models.FloatField(default=0.5)
    center_point = models.EmbeddedModelField(model_container=GeoJSON)
    level_of_danger = models.CharField(max_length=2,
                                       default='M',
                                       choices=DANGER_LEVELS)
    added = models.DateTimeField(auto_now_add=True)
    updated = models.DateTimeField(auto_now=True)
    owner = models.ForeignKey('auth.User',
                              related_name='posts',
                              on_delete=models.CASCADE)
    lat = models.FloatField()
    lang = models.FloatField()

    #optional
    title = models.CharField(max_length=200, blank=True)
    description = models.CharField(max_length=500, blank=True)


# class Disaster(Document):
#     #required
#     diameter = IntField(default = 0.5)
#     center = PointField()
#     level_of_danger = IntField(default = 0.5, choices = DANGER_LEVELS)
#     date_added = DateTimeField(default=datetime.now)

#     #optional
#     title = StringField()
#     description = StringField()
#     text = StringField(required=True)
コード例 #18
0
ファイル: models.py プロジェクト: bpovea/DAW
class Usuario(models.Model):
    nombre_completo = models.CharField(max_length=75)
    ciudad = models.CharField(max_length=75)
    servicios = models.EmbeddedModelField(model_container=Servicio)

    def __str__(self):
        return 'Usuario: {}:{}'.format(self.nombre_completo, self.ciudad)
コード例 #19
0
ファイル: models.py プロジェクト: kaggrwal/djongo
class BlogContent(models.Model):
    comment = models.CharField(max_length=100)
    author = models.EmbeddedModelField(model_container=Author,
                                       model_form_class=AuthorForm)

    class Meta:
        abstract = True
コード例 #20
0
class daum_blog(models.Model):
    keyword = models.CharField(max_length=100, null=True)
    nickname = models.CharField(max_length=100, null=True)
    sub_body = models.EmbeddedModelField(model_container=title,
                                         model_form_class=titleForm)
    tag = models.CharField(max_length=100, null=True)
    comment = models.CharField(max_length=10000, null=True)
コード例 #21
0
ファイル: models.py プロジェクト: tonyvu2014/djongo
class BlogPost(models.Model):
    h1 = models.CharField(max_length=100)
    content = models.EmbeddedModelField(
        model_container=BlogContentSimple,
        model_form_class=BlogContentForm
    )

    objects = models.DjongoManager()
コード例 #22
0
class Entry(models.Model, ModelSerializeMixin):
    author = models.ForeignKey(User,
                               on_delete=models.DO_NOTHING,
                               related_name='user_entries')
    blog = models.EmbeddedModelField(model_container=Blog)

    headline = models.CharField(max_length=255)
    objects = models.DjongoManager()
コード例 #23
0
class Ingredient(models.Model):
    name = models.EmbeddedModelField(model_container=FoodItem)
    units = models.CharField(max_length=10)
    amount = models.IntegerField()
    recipe = models.ForeignKey(Recipe, on_delete=models.CASCADE)

    def __str__(self):
        return f'{self.name}'
コード例 #24
0
ファイル: models.py プロジェクト: andrey484/mongoTestDjango
class Beer(models.Model):
    _id = models.ObjectIdField()
    name = models.CharField(max_length=255, blank=False)
    value = models.EmbeddedModelField(model_container=Water)
    objects = models.DjongoManager()

    class Meta:
        app_label = 'admin_page'
コード例 #25
0
class EthnicityData(models.Model):
    ethnicity = models.CharField(max_length = 50)
    total = total = models.EmbeddedModelField(
        model_container=GenderData,
    )

    def __str__(self):
        return "Ethnicity: {0}, Total: {1}".format(str(self.ethnicity), str(self.total))
コード例 #26
0
class AdSet(models.Model):
    id = models.IntegerField(primary_key=True)
    name = models.CharField(max_length=256)
    goal = models.CharField(max_length=128)
    total_budget = models.IntegerField()
    status = models.CharField(max_length=32)
    platforms = models.EmbeddedModelField(model_container=Platforms)
    objects = models.DjongoManager()
コード例 #27
0
class Book(models.Model):
    title = models.CharField(max_length=100, null=False, blank=False)
    content = models.EmbeddedModelField(
        model_container=BookContent,
    )
    authors = models.ManyToManyField(Author)

    def __str__(self):
        return self.title
コード例 #28
0
class Item(models.Model):
    id = models.CharField(primary_key=True, max_length=50)
    # content = models.FileField()
    username = models.CharField(max_length=50)
    property = models.EmbeddedModelField(
        model_container=ItemProperty
    )
    retweeted = models.IntegerField(default=0)
    content = models.CharField(max_length=280)
    # timestamp = models.DateTimeField(auto_now_add=True, blank=True)
    timestamp = models.FloatField(default=time.time)
コード例 #29
0
ファイル: models.py プロジェクト: Lucas-Armand/pyGovBR
class Uasg(models.Model):

    _id = models.ObjectIdField()

    # atomic Fields
    nome = models.CharField(max_length=200)
    cep = models.CharField(max_length=20)
    total_fornecedores_cadastrados = models.IntegerField(blank=True, null=True)
    total_fornecedores_cadastrados = models.IntegerField(blank=True, null=True)
    unidade_cadastradora = models.BooleanField(default=False)
    ativo = models.BooleanField(default=False)

    # embeedded Fields one-to-one
    orgao = models.EmbeddedModelField(
        model_container=Orgao)  # Atributo origem id_orgao
    municipio = models.EmbeddedModelField(
        model_container=Municipio)  # Atributo origem id_municipio

    class Meta:
        abstract = True
コード例 #30
0
class Plans(models.Model):
    _id = models.ObjectIdField()
    plans_name = models.CharField(max_length=250)
    plans_price = models.IntegerField()
    plan_type = models.CharField(max_length=50)
    plan_description = models.CharField(max_length=50)
    full_talktime = models.BooleanField()
    validity = models.EmbeddedModelField(model_container=Validity,
                                         model_form_class=validityForm)
    costtocompany = models.EmbeddedModelField(
        model_container=CostToCompany, model_form_class=CosttoCompanyForm)
    topup_delivered = models.CharField(max_length=50)
    value_delivered = models.EmbeddedModelField(model_container=Costing,
                                                model_form_class=CostingForm)
    local = models.EmbeddedModelField(model_container=Costing,
                                      model_form_class=CostingForm)
    roaming = models.EmbeddedModelField(model_container=Costing,
                                        model_form_class=CostingForm)
    international = models.EmbeddedModelField(model_container=Costing,
                                              model_form_class=CostingForm)

    # different_service_costing= models.EmbeddedModelField(model_container = ClassCosting, model_form_class=ClassCostingForm)

    def __str__(self):
        return self.plans_name