예제 #1
0
class TenantSingleSerializer(ZopsBaseSerializer):
    organizationName = StringField("organization name",
                                   source='organization_name')
    address = StringField("physical address")
    phone = StringField("phone number, length must be 11 character.",
                        validators=[phone_validator])
    email = StringField("email for tenant")
예제 #2
0
class LoginSerializer(ZopsBaseSerializer):
    token = StringField("Access token.", read_only=True)
    email = StringField("Email for user.Max length 70 Character",
                        write_only=True,
                        validators=[email_validator])
    password = StringField("Password for user.Max length 128 Character",
                           write_only=True)
예제 #3
0
파일: server.py 프로젝트: vrct/ab-2018
class SubscriptionSerializer(BaseSerializer):
    # todo add validators to the fields.
    email = StringField("Email to send repository reports", allow_null=False)
    subscriptions = ListOfStringsField("List of subscribed github ids",
                                       allow_null=False)
    period = StringField("Notification period e.g. daily, or weekly",
                         allow_null=False)
예제 #4
0
class SubscriptionSerializer(BaseSerializer):
    #TODO: ADD VALIDATORS
    email = StringField("Email to send repository reports")
    subscriptions = JsonField("List of subscribed github ids")
    period = StringField("Notification period e.g. daily, or weekly")
    telegramID = StringField("Telegram ID")
    repoCount = IntField("Number of suggestions each time")
예제 #5
0
class ProjectResourceSerializer(ZopsBaseSerializer):
    name = StringField("Project name.Max length 70 Character")
    description = StringField("Project description.Max length 200 Character")
    id = StringField("ID", read_only=True)
    userLimit = IntField("User limit of service.", read_only=True, source='user_limit')
    userUsed = IntField("User used of service.", read_only=True, source='user_used')
    services = ZopsListOfStringsField("Project's active services", read_only=True)
예제 #6
0
class RegisterSerializer(ZopsBaseSerializer):
    organizationName = StringField(
        "Organization name.Max length 100 Character",
        source='organization_name')
    email = StringField("Email for account.Max length 70 Character")
    registrationId = StringField("Registered account id.",
                                 read_only=True,
                                 source='id')
예제 #7
0
def test_string_field():
    field = StringField("test str field")

    assert field.to_representation("foo") == "foo"
    assert field.to_representation(123) == "123"

    assert field.from_representation("foo") == "foo"
    assert field.from_representation(123) == "123"
예제 #8
0
class AccountSerializer(ZopsBaseSerializer):
    organizationName = StringField(
        "Organization Name.Max Organization Name length 100 Character",
        source='organization_name')
    address = StringField("Address. Max Address length 200 Character")
    phone = StringField("Phone Number, length must be 11 character.",
                        validators=[phone_validator])
    email = StringField("Email for Account.Max Email length 70 Character")
예제 #9
0
    class TestSerializer(BaseSerializer):
        one = StringField("one different than two")
        two = StringField("two different than one")

        def validate(self, object_dict, partial=False):
            super().validate(object_dict, partial)
            # possible use case: kind of uniqueness relationship
            if object_dict['one'] == object_dict['two']:
                raise ValidationError("one must be different than two")
예제 #10
0
파일: me.py 프로젝트: snowsky/zops-platform
class UserSerializer(ZopsBaseSerializer):
    id = StringField("ID", read_only=True)
    email = StringField("Email for user.Max length 70 Character",
                        read_only=True)
    role = StringField("Role of user.", read_only=True)
    firstName = StringField("Name of user.Max length 32 Character",
                            source='first_name',
                            read_only=True)
    lastName = StringField("Last Name of user.Max length 32 Character",
                           source='last_name',
                           read_only=True)
예제 #11
0
class ServiceSerializer(ZopsBaseSerializer):
    id = StringField("ID", read_only=True)
    itemLimit = IntField("Item limit of service.",
                         read_only=True,
                         source='item_limit')
    itemUsed = IntField("Item used of service.",
                        read_only=True,
                        source='item_used')
    name = StringField("Service name.Max length 70 Character")
    description = StringField("Service description.Max length 200 Character")
    serviceCatalogCode = StringField("Code name of the service.",
                                     validators=[is_service_code],
                                     source="service_catalog_code")
예제 #12
0
 class ExampleSerializer(BaseSerializer):
     up = StringField(
         details='multiple values field',
         many=True,
         validators=[is_upper],
         allow_null=True,
     )
예제 #13
0
class TenantSerializer(ZopsBaseSerializer):
    email = StringField("email for user", validators=[email_validator])
    password = StringField("password for user")
    organizationName = StringField("organization name",
                                   source='organization_name')
    address = StringField("physical address")
    phone = StringField("phone number, length must be 11 character.",
                        validators=[phone_validator])
    tenantEmail = StringField("email for tenant", source='tenant_email')
    tenantId = StringField("ID for tenant", read_only=True, source='tenant_id')
    managerToken = StringField("auth token of tenant manager",
                               read_only=True,
                               source='manager_token')
예제 #14
0
class EmailSerializer(ZopsBaseSerializer):
    accountId = StringField("Account id", read_only=True, source="account_id")
    providerMailId = StringField("Provider mail id",
                                 read_only=True,
                                 source="provider_mail_id")
    receiver = StringField("Email address.", read_only=True)
    subject = StringField("Email subject", read_only=True)
    text = StringField("Email text", read_only=True)
    provider = StringField("Email provider", read_only=True)
    category = StringField("Email category", read_only=True)
예제 #15
0
def test_string_field():
    field = StringField("test str field")

    assert field.to_representation("foo") == "foo"
    assert field.to_representation(123) == "123"

    assert field.from_representation("foo") == "foo"
    assert field.from_representation(123) == "123"
예제 #16
0
class UserSerializer(ZopsBaseSerializer):
    id = StringField("ID", read_only=True)
    token = StringField("Access token", read_only=True)
    email = StringField("Email for user.Max length 70 Character",
                        validators=[email_validator])
    password = StringField("Password for user.Max length 128 Character",
                           write_only=True)
    role = StringField("Role of user.", read_only=True)
    firstName = StringField("Name of user.Max length 32 Character",
                            source='first_name')
    lastName = StringField("Last Name of user.Max length 32 Character",
                           source='last_name')
예제 #17
0
class RegisterSingleSerializer(ZopsBaseSerializer):
    id = StringField("ID", read_only=True)
    email = StringField("Email for user.Max length 70 Character",
                        validators=[email_validator])
    password = StringField("Password for user.Max length 128 Character",
                           write_only=True)
    approveCode = StringField("Approve code to activate the account.",
                              write_only=True,
                              source='approve_code')
    firstName = StringField("Name of user.Max length 32 Character",
                            source='first_name')
    lastName = StringField("Last Name of user.Max length 32 Character",
                           source='last_name')
    token = StringField("User token", read_only=True)
예제 #18
0
class LogTrackingSerializer(ZopsBaseSerializer):
    id = StringField("ID", read_only=True)
    description = StringField("Log Message", read_only=True)
    levelName = StringField("Log Level Name",
                            read_only=True,
                            source="level_name")
    functionName = StringField("Log Function Name",
                               read_only=True,
                               source="function_name")
    pathName = StringField("Log path name", read_only=True, source="path_name")
    lineNumber = StringField("Log line number",
                             read_only=True,
                             source="line_number")
    creationTime = ZopsDatetimeField("Log Creation Time",
                                     read_only=True,
                                     source="creation_time")
예제 #19
0
class ProjectServicesAdminTokenSerializer(ZopsBaseSerializer):
    projectServicesAdminToken = StringField("Project Services Admin Token",
                                            source='project_services_admin_token', read_only=True)
예제 #20
0
class ConsumerSerializer(ZopsBaseSerializer):
    id = StringField("ID of consumer.", read_only=True)
예제 #21
0
class ResetPasswordSerializer(ZopsBaseSerializer):
    resetToken = StringField("Forgot Password Token",
                             write_only=True,
                             source="reset_token")
    password = StringField("New password for user. Max length 128 Character",
                           write_only=True)
예제 #22
0
class ForgotPasswordSerializer(ZopsBaseSerializer):
    email = StringField("Email for user.Max length 70 Character",
                        write_only=True,
                        validators=[email_validator])
예제 #23
0
class LogoutSerializer(ZopsBaseSerializer):
    token = StringField("Access token", read_only=True)
예제 #24
0
class ServiceCatalogSerializer(ZopsBaseSerializer):
    name = StringField("Service Catalog name")
    description = StringField("Service Catalog description")
    codeName = StringField("Code name of the service.", source='code_name')
예제 #25
0
class ConsumerTokenSerializer(ZopsBaseSerializer):
    consumerId = StringField("Consumer ID", source='consumer_id')
    projectId = StringField("Project ID", source='project_id')
    serviceCatalogCode = StringField("Service Code",
                                     source='service_catalog_code')
    token = StringField("Refresh Token", read_only=True)
예제 #26
0
class ApproveCodeSerializer(ZopsBaseSerializer):
    email = StringField("Email for account.Max length 70 Character",
                        write_only=True)
예제 #27
0
class ProjectSecretSerializer(ZopsBaseSerializer):
    fcmApiKeys = StringField("Fcm API Key", source='fcm_api_key')
    fcmProjectNumber = StringField("Fcm Project Number", source='fcm_project_number')
    apnsCert = StringField("Apns Cert", source='apns_cert')
    id = StringField("ID", read_only=True)
예제 #28
0
class CatSerializer(BaseSerializer):
    id = IntField("cat identification number", read_only=True)
    name = StringField("cat name", validators=[is_lower_case])
    breed = StringField("official breed name")
예제 #29
0
class ProjectConsumerSerializer(ZopsBaseSerializer):
    consumerId = StringField("List of consumer_id's", source='consumer_id')