Esempio n. 1
0
class Status(JsonObject):
    """ Status model for issue fields """
    description = StringProperty()
    iconUrl = StringProperty()
    name = StringProperty()
    id_ = StringProperty(name='id')
    statusCategory = ObjectProperty(StatusCategory)
Esempio n. 2
0
class Usage(JsonObject):
    """An Urjanet "Usage" object.

    From Urjanet's documentation:
      | The Usage table stores commodity-specific consumption data.
      | Here, you will find information such as consumption amounts,
      | read types, present and previous meter readings, and units
      | of measure.
    """

    # The primary key of the Usage object in the Urjanet database
    PK = IntegerProperty(required=True)

    # A string description of the usage measurement
    UsageActualName = StringProperty()

    # The measured amount of usage
    UsageAmount = DecimalProperty()

    # The rate component, e.g. "on peak", "off peak", etc.
    RateComponent = StringProperty()

    # The measurement type, "general_consumption", "demand", or "reactive_consumption"
    MeasurementType = StringProperty()

    # Unit of measure, typically kW or kWh
    EnergyUnit = StringProperty()

    # The start date for the usage measurement
    IntervalStart = DateProperty()

    # The end date for the usage measurement
    IntervalEnd = DateProperty()
Esempio n. 3
0
class PrimerOutput(JsonObject):
    direction = StringProperty(required=True)
    normal_order_sequence = StringProperty(required=True)
    normal_order_start = IntegerProperty(required=True)
    three_end_temperature = FloatProperty(required=True)
    gc_content = FloatProperty(required=True)
    parameters_in_range = BooleanProperty(required=True)
Esempio n. 4
0
class Project(JsonObject):
    key = StringProperty()
    id_ = IntegerProperty(name='id')
    name = StringProperty()
    public = BooleanProperty()
    type_ = StringProperty(name='type')
    description = StringProperty(default="")
Esempio n. 5
0
class MeterSummary(JsonObject):
    address = StringProperty()
    service_id = StringProperty()
    service_uuid = (
        StringProperty()
    )  # This is the usage-point identifier in SMD green button.
    service_type = StringProperty()
Esempio n. 6
0
class User(JsonObject):
    """ Represent a user account """
    username = StringProperty()
    url = StringProperty()
    createdAt = DateTimeProperty()
    updatedAt = DateTimeProperty()
    default = BooleanProperty(default=False)

    @property
    def model_id(self):
        """ Use as a unique identifier """
        return "{}@{}".format(self.username, self.url)

    @property
    def password(self):
        """ Read password directly in a OS based secured area """
        return keyring.get_password(SERVICE_IDENTIFIER, self.model_id)

    @password.setter
    def password(self, value):
        """ Store password directly in a OS based secured area """
        if value:
            keyring.set_password(SERVICE_IDENTIFIER, self.model_id, value)
        else:
            if keyring.get_password(SERVICE_IDENTIFIER, self.model_id):
                keyring.delete_password(SERVICE_IDENTIFIER, self.model_id)

    def __eq__(self, other):
        return (self.url == other.url and
                self.username == other.username)

    def __str__(self):
        return '{}@{}'.format(self.username, self.url)
Esempio n. 7
0
class Component(JsonObject):
    """ Component model for issue fields """
    id_ = StringProperty(name='id')
    name = StringProperty()
    description = StringProperty()
    def __str__(self):
        return self.name
Esempio n. 8
0
class PASSequences(JsonObject):
    gene_of_interest = StringProperty(required=True)
    five_end_flanking_sequence = StringProperty(default="")
    three_end_flanking_sequence = StringProperty(default="")

    def get_full_sequence_with_offset(self) -> Tuple[str, int]:
        return self.get_full_sequence(), self.get_goi_offset()

    def translate_goi_sequences(self, translator: Translator):
        if self.five_end_flanking_sequence is None:
            self.five_end_flanking_sequence = ""
        if self.three_end_flanking_sequence is None:
            self.three_end_flanking_sequence = ""

        self.gene_of_interest = translator(self.gene_of_interest)

    def get_goi_offset(self):
        if self.five_end_flanking_sequence is None:
            self.five_end_flanking_sequence = ""
        return len(self.five_end_flanking_sequence)

    def get_full_sequence(self):
        if self.five_end_flanking_sequence is None:
            self.five_end_flanking_sequence = ""
        if self.three_end_flanking_sequence is None:
            self.three_end_flanking_sequence = ""
        full_sequence = \
            self.five_end_flanking_sequence + \
            self.gene_of_interest + \
            self.three_end_flanking_sequence
        return full_sequence
Esempio n. 9
0
class Customer(JsonObject):
    ownId = StringProperty(required=True)
    fullname = StringProperty(required=True)
    email = StringProperty(required=True)
    birthDate = StringProperty(required=True)
    taxDocument = ObjectProperty(TaxDocument, required=True)
    phone = ObjectProperty(Phone, required=True)
    shippingAddress = ObjectProperty(ShippingAddress, required=True)
Esempio n. 10
0
class PASMutationFormatted(JsonObject):
    position = IntegerProperty(required=True)
    mutated_amino = StringProperty(required=True)
    wild_type_amino = StringProperty(required=False)
    wild_type_codon = StringProperty(required=False)
    mutated_codon = StringProperty(required=True)
    frequency = FloatProperty(required=True)
    wild_type = BooleanProperty(required=True)
Esempio n. 11
0
class User(JsonObject):
    name = StringProperty()
    emailAddress = StringProperty()
    id_ = IntegerProperty(name='id')
    displayName = StringProperty()
    active = BooleanProperty()
    slug = StringProperty()
    type_ = StringProperty(name="type")
Esempio n. 12
0
class Version(JsonObject):
    """ Version model """
    id_ = IntegerProperty(name='id')
    project_id = IntegerProperty(name='projectId')
    name = StringProperty()
    description = StringProperty()
    archived = BooleanProperty()
    released = BooleanProperty()
    release_date = DateTimeProperty(name='releaseDate')
Esempio n. 13
0
class _ModuleMetadata(JsonObject):
    unique_id = StringProperty()
    name = DictProperty()
    short_comment = StringProperty()
    module_type = StringProperty()
    is_surveys = BooleanProperty()
    module_filter = StringProperty()
    forms = ListProperty(_FormMetadata)
    changes = ObjectProperty(_ModuleDiff)
Esempio n. 14
0
class Repo(JsonObject):
    slug = StringProperty()
    id_ = IntegerProperty(name='id')
    name = StringProperty()
    smcId = StringProperty()
    state = StringProperty()
    statusMessage = StringProperty()
    forkable = BooleanProperty()
    public = BooleanProperty()
Esempio n. 15
0
class Sprint(JsonObject):
    """ Spring model """
    id_ = IntegerProperty(name='id')
    state = StringProperty(name='state')
    name = StringProperty(name='name')
    start_date = DateTimeProperty(name='startDate')
    end_date = DateTimeProperty(name='endDate')
    complete_date = DateTimeProperty(name='completeDate')
    origin_board_id = IntegerProperty(name='originBoardId')
Esempio n. 16
0
class _FormMetadata(JsonObject):
    unique_id = StringProperty()
    name = DictProperty()
    short_comment = StringProperty()
    action_type = StringProperty()
    form_filter = StringProperty()
    questions = ListProperty(_FormMetadataQuestion)
    error = DictProperty()
    changes = ObjectProperty(_FormDiff)
Esempio n. 17
0
class ReportsForm(JsonObject):
    time = DateTimeProperty()
    completion_time = DateTimeProperty()
    start_time = DateTimeProperty()
    duration = IntegerProperty()
    submission_time = DateTimeProperty()
    xmlns = StringProperty()
    app_id = StringProperty()
    user_id = StringProperty()
    username = StringProperty()
Esempio n. 18
0
class Version(JsonObject):
    """ Version model """
    id_ = IntegerProperty(name='id')
    projectId = IntegerProperty()
    name = StringProperty()
    description = StringProperty()
    archived = BooleanProperty()
    released = BooleanProperty()
    releaseDate = CustomDateTimeProperty(
        datetime_format="%Y-%m-%d %H:%M:%S.%z")
    startDate = CustomDateTimeProperty(datetime_format="%Y-%m-%d %H:%M:%S.%z")
Esempio n. 19
0
class PASResult(JsonObject):
    fragment = StringProperty(required=True)
    start = IntegerProperty(required=True)
    end = IntegerProperty(required=True)
    length = IntegerProperty(required=True)
    overlap = StringProperty(required=False)
    overlap_Tm = FloatProperty(required=False)
    overlap_GC = FloatProperty(required=False)
    overlap_length = IntegerProperty(required=False)
    mutations = ListProperty(PASMutationFormatted, required=False)
    oligos = ListProperty(PASOligoOutput, required=True)
Esempio n. 20
0
class QCLMSequences(JsonObject):
    gene_of_interest = StringProperty(required=True)
    five_end_flanking_sequence = StringProperty(default="")
    three_end_flanking_sequence = StringProperty(default="")

    def get_full_sequence_with_offset(self) -> Tuple[str, int]:
        full_sequence = \
            self.five_end_flanking_sequence + \
            self.gene_of_interest + \
            self.three_end_flanking_sequence
        offset = len(self.five_end_flanking_sequence)
        return full_sequence, offset
Esempio n. 21
0
class ListOrdersFilters(JsonObject):
    """
    status_choices = ['WAITING', 'NOT_PAID', 'PAID', 'REVERTED']
    paymentMethod = ['DEBIT_CARD', 'BOLETO', 'ONLINE_BANK_FINANCING',
                     'ONLINE_BANK_DEBIT', 'WALLET']
    """
    createdAt = DateProperty(exclude_if_none=True)
    paymentMethod = StringProperty(exclude_if_none=True)
    value = StringProperty(exclude_if_none=True)
    status = StringProperty(exclude_if_none=True)
    limit = IntegerProperty(exclude_if_none=True)
    offset = IntegerProperty(exclude_if_none=True)
Esempio n. 22
0
class Command(JsonObject):
    operation = StringProperty(
        choices=['create', 'delete', 'select', 'list', 'current'],
        required=True)
    subject = StringProperty(choices=['file', 'sheet', 'topic'], required=True)
    name = StringProperty()
    virtual_id = IntegerProperty()
    user_id = IntegerProperty()
    chat_id = IntegerProperty()

    def __eq__(self, other):
        return self.operation == other.operation and self.subject == other.subject and self.name == other.name and self.virtual_id == other.virtual_id and self.user_id == other.user_id and self.chat_id == other.chat_id
Esempio n. 23
0
class StatusCategory(JsonObject):
    """ StatusCategory model for Status """
    id_ = IntegerProperty(name='id')
    key = StringProperty()
    colorName = StringProperty()
    name = StringProperty()

    def color(self):
        """ Convert to termcolor """
        if self.colorName == 'blue-gray':
            return 'blue'
        return self.colorName
Esempio n. 24
0
class TaxJarLineItem(JsonObject):
    # NB: SmartCalcs can return either string or integer
    # `id` is a valid property, but isn't enforced here
    # id = StringProperty()

    product_identifier = StringProperty()
    description = StringProperty()

    quantity = IntegerProperty()

    unit_price = TaxJarFloatProperty()
    discount = TaxJarFloatProperty()
    sales_tax = TaxJarFloatProperty()
Esempio n. 25
0
class _QuestionDiff(JsonObject):
    question = StringProperty(choices=(ADDED, REMOVED))
    label = StringProperty(choices=DIFF_STATES)
    type = StringProperty(choices=DIFF_STATES)
    value = StringProperty(choices=DIFF_STATES)
    calculate = StringProperty(choices=DIFF_STATES)
    relevant = StringProperty(choices=DIFF_STATES)
    required = StringProperty(choices=DIFF_STATES)
    comment = StringProperty(choices=DIFF_STATES)
    setvalue = StringProperty(choices=DIFF_STATES)
    constraint = StringProperty(choices=DIFF_STATES)
    options = DictProperty()  # {option: state}
    load_properties = DictProperty()  # {case_type: {property: state}}
    save_properties = DictProperty()  # {case_type: {property: state}}
Esempio n. 26
0
class Fields(JsonObject):
    """ Fields model for issue"""
    status = ObjectProperty(Status)
    components = ListProperty(Component, default=None)
    labels = ListProperty(StringProperty, default=None)
    summary = StringProperty(default='')
    assignee = ObjectProperty(User)
    closed_sprints = ListProperty(Sprint, default=None, name='closedSprints')
    reporter = ObjectProperty(User)
    issue_type = ObjectProperty(IssueType)
    parent_ = DefaultProperty(default=None, name='parent')
    subtasks_ = DefaultProperty(default=None, name='subtasks')

    @property
    def parent(self):
        """ Getter for parent issue """
        if self.parent_:
            return Issue(self.parent_)
        return None

    @property
    def subtasks(self):
        """ Getter for subtasks """
        if self.subtasks_:
            return list(map(Issue, self.subtasks_))
        return None
Esempio n. 27
0
class AcceptedMessage(JsonObject):

    message_id = IntegerProperty(required=True)
    from_field = ObjectProperty(User, name='from', required=True)
    date = IntegerProperty()
    chat = ObjectProperty(Chat, required=True)
    text = StringProperty(required=True)
Esempio n. 28
0
class Epic(JsonObject):
    """ Epic model """
    id_ = IntegerProperty(name='id')
    done = BooleanProperty()
    key = IntegerProperty()
    name = StringProperty()
    color = ObjectProperty(EpicColor)
Esempio n. 29
0
class Charge(JsonObject):
    """An Urjanet "Charge" object.

    From the Urjanet documentation:
      | The Charge table includes information related to the
      | line-item charges on your utility bill. Here, you can
      | find details such as charges names, rates, and currencies.
      | If a charge is associated with more than one meter, Urjanet
      | will prorate the charge based on the usage amount.

    Note especially the description of proration, which can
    manifest in some somewhat difficult to interpret data.
    """

    # The primary key of the Charge object in the Urjanet database
    PK = IntegerProperty(required=True)

    # The line item name
    ChargeActualName = StringProperty()

    # The charge amount in dollars
    ChargeAmount = DecimalProperty()

    # The usage associated with this charge, if any
    ChargeUnitsUsed = DecimalProperty()

    # The units on the usage associated with this charge
    UsageUnit = StringProperty()

    # The rate associated with this charge (e.g. price per unit of usage)
    ChargeRatePerUnit = DecimalProperty()

    # The name of any third party provider (e.g. a CCA entity)
    # This is useful for identifying CCA charges
    ThirdPartyProvider = StringProperty()

    # TODO: Explain this flag in more detail. It may be a somewhat
    # misleading field. For now, avoid using it.
    IsAdjustmentCharge = BooleanProperty()

    # The start date for the period the charge applies to
    IntervalStart = DateProperty()

    # The end date for the period the charge applies to
    IntervalEnd = DateProperty()

    ChargeId = StringProperty()
Esempio n. 30
0
class ProtectedSaleOrder(JsonObject):
    ownId = StringProperty(required=True)
    amount = ObjectProperty(Amount, exclude_if_none=True)
    items = ListProperty(Item, required=True)
    customer = ObjectProperty(Customer, required=True)
    checkoutPreferences = ObjectProperty(CheckoutPreferences,
                                         exclude_if_none=True,
                                         default=None)