Exemplo n.º 1
0
class Payment(models.Model):
    '''
        Payment structure
    '''
    uuid = types.UUIDType(default=uuid.uuid4)

    account = types.StringType(required=True)
    credit_card_type = types.StringType(required=False)

    merchant = types.StringType()

    address = types.StringType()

    phone = types.StringType()

    email = types.EmailType()
    
    card_name = types.StringType()

    amount_funds = types.StringType() 
    
    credit_card_number = types.StringType()
    credit_card_cvc = types.StringType()

    exp_month = types.StringType()
    exp_year = types.StringType()

    CustomerToken = types.StringType(default='None')

    Status = compound.ModelType(Status)
    Transaction = compound.ModelType(Transaction)
    AuthorizationNum = types.IntType(default=__None_Id__)

    created = types.DateTimeType(default=arrow.utcnow().naive)
Exemplo n.º 2
0
class BaseAccount(models.Model):
    '''
        Base account
    '''
    uuid = types.UUIDType(default=uuid.uuid4)

    passwords = compound.ListType(compound.ModelType(Password))

    # api samples, remove after finish work on passwords or otherwise secret keys.
    api_key = types.StringType(required=False)
    # api_keys = compound.ListType(compound.ModelType(Mon))

    # system admin account
    is_admin = types.BooleanType(default=False)

    active = types.BooleanType(default=True)
    account = types.StringType(required=True)
    name = types.StringType(required=False)
    email = types.EmailType(required=True)
    phone_number = types.StringType()
    country_code = types.StringType()
    timezone = types.StringType()
    location = types.StringType()
    resources = compound.ModelType(Resource)
    
    routes = compound.ListType(compound.ModelType(Route))

    uri = types.StringType(required=False)
    url = types.URLType()

    # move this to howler and spider?
    max_channels = types.IntType()
Exemplo n.º 3
0
class RequiredBase(models.Model):
    '''
        Very self explanatory
    '''
    status = types.StringType(required=False)
    account = types.StringType(required=True)
    role = types.StringType(required=False)
    email = types.EmailType(required=True)
    phone_number = types.StringType()
    extension = types.StringType()
    country_code = types.StringType()
    timezone = types.StringType()
    affiliation = types.StringType()
    location = types.StringType()
    phones = compound.ListType(compound.ModelType(Phone))
    emails = compound.ListType(compound.ModelType(Email))
    labels = types.DictType(types.StringType)
    history = compound.ListType(types.StringType())
    checked = types.BooleanType(default=False)
    checked_by = types.StringType()
    checked_at = types.TimestampType()
    created_by = types.StringType(required=True)
    created_at = types.TimestampType(default=arrow.utcnow().timestamp)
    last_update_by = types.StringType()
    last_update_at = types.TimestampType()
Exemplo n.º 4
0
class CapuchinORG(models.Model):
	'''
		CapuchinORG schematics
		----------------------

		hablada de mierda.

		bosques, squirrels, capuchinos, hawks, peccaries, howlers, scourges

		el ultimo comodin, howlers communicacion, peccary databases, 
		hawks supervisor overlords, capuchin standard legionary, 
		squirrels are slaves, all live in the forest.

		La legion romana tenia 10 cohorts, 6 centurias por cohort, 
		480 cores por humano, divididos en nodes de 8 unidades c/u. 
		80 unidades por centuria.

		El tropical cloud forest 4800 cores por cloud divididos en 10 cohorts, 
		6 clusters por cohort, 10 nodos de 8 cores en cada cluster.

	'''
	cebus = compound.ModelType(Cebus)
	hawks = compound.ModelType(Hawk)
	capuchins = compound.ModelType(Capuchin)
	squirrels = compound.ModelType(Squirrel)
Exemplo n.º 5
0
class Resource(models.Model):
    ''' 
        Resource
    '''
    queues = compound.ModelType(SimpleResource)
    records = compound.ModelType(SimpleResource)

    total = types.IntType()
Exemplo n.º 6
0
class Resource(models.Model):
    ''' 
        Resource
    '''
    calls = compound.ModelType(SimpleResource)
    contacts = compound.ModelType(SimpleResource)
    directories = compound.ModelType(SimpleResource)

    total = types.IntType()
Exemplo n.º 7
0
class Node(Unit):
    '''
        Node basic data structure
    '''
    minions = compound.ModelType(Unit)
    servants = compound.ModelType(Unit)

    cores = types.IntType(default=8)
    # D:
    total = types.IntType()
Exemplo n.º 8
0
class TropicalNode(Node):
    '''
        Node basic data structure
    '''
    # minion centurion
    cebus = types.URLType(default=False)
    # minion overlord
    hawks = types.URLType(default=True)
    # minion units
    capuchins = compound.ModelType(Unit)
    # minion squirrel servants
    squirrels = compound.ModelType(Unit)
Exemplo n.º 9
0
class Comment(models.Model):
    ''' 
        Comment
    '''
    comments = compound.ListType(compound.ModelType(SimpleEntry))

    total = types.IntType()
Exemplo n.º 10
0
class Unit(models.Model):
    '''
        Cebus base unit model
    '''
    name = types.StringType(required=False)
    uuid = types.UUIDType(default=uuid.uuid4)

    contacts = compound.ModelType(ContactsContainer)

    url = types.URLType()
    urls = compound.ListType(types.StringType())

    resources = compound.ModelType(Resource)

    cores = types.IntType(default=1)
    total = types.IntType()
Exemplo n.º 11
0
class ContactsContainer(models.Model):
    '''
        Contacts addresses container
    '''
    addresses = compound.ModelType(ResourceContainer)

    total = types.IntType()
Exemplo n.º 12
0
class RegisterCustomer(models.Model):
    '''
        Cuallix Register Customer
    '''
    Culture = types.StringType()
    ApplicationId = types.StringType()
    Customer = compound.ModelType(User)
Exemplo n.º 13
0
class Resource(models.Model):
    ''' 
        Resource
    '''
    payments = compound.ModelType(SimpleResource)

    total = types.IntType()
Exemplo n.º 14
0
class MinionCluster(Unit):
    '''
        Minion cluster schematics
    '''
    nodes = compound.ModelType(TropicalNode)

    cores = types.IntType(default=80)
    total = types.IntType()
Exemplo n.º 15
0
    class TestCollection(ResourceCollection):
        foo = types.StringType(required=True)
        bar = types.StringType(required=True)
        baz = types.IntType(required=True)
        c1 = compound.ModelType(C1, required=True)

        def create_resources(self):
            pass
Exemplo n.º 16
0
class Cluster(Unit):
    '''
        Cluster data structure
    '''
    nodes = compound.ModelType(Node)

    cores = types.IntType(default=80)
    # ojo este total esta mamando.
    total = types.IntType()
Exemplo n.º 17
0
class Cohort(Unit):
    '''
        Cohort data structure
    '''
    clusters = compound.ModelType(Cluster)

    cores = types.IntType(default=480)
    # alchile?
    total = types.IntType()
Exemplo n.º 18
0
class Org(BaseAccount):
    '''
        Org account
    '''
    account_type = types.StringType(default='org')
    
    # tests for members and teams.
    members = compound.ListType(types.StringType())
    teams = compound.ListType(compound.ModelType(Team))
    description = types.StringType()
Exemplo n.º 19
0
class Team(models.Model):
    '''
        Org team
    '''
    name = types.StringType(required=True)
    permission = types.StringType(choices=['read',
                                           'write',
                                           'admin'], required=True)
    members = compound.ListType(types.StringType())
    resources = compound.ModelType(Resource)
Exemplo n.º 20
0
class CapuchinImmunes(Unit):
	'''
		Capuching immune units
		----------------------
	
		The inmune concept born again from the roman legion
		just go a little back in time you!

		Special duty stuff; Immunes are units who possessed 
		specialized skills, qualifying them for better pay 
		and excusing them for labour and guard work.

		On the old empire, enginners, musicians, educators,
		carpenters, hunters, medical, etc. Are all inmune units.

		types of stuff: small, medium, high
	'''

	# Inmunes unit skills
	# the hole inmmune concept born again from legionary organization 
	# just a few milenium back in time, you! ;)

	# Special duty stuff
	#
	# Immunes are units who possessed specialized skills, 
	# qualifying them fro better pay and excusing them 
	# for labour and guard work.

	# Engineers, Musicians, spscientists, educators, carpenters, 
	# hunters, medical are all inmune units.

	# Immunes worker basic contructor advanced constructor 

	# http web spiders
	spiders = compound.ModelType(Spider)
	# sip real-time communication howlers
	howlers = compound.ModelType(Howler)
	# data peccaries
	peccaries = compound.ModelType(Peccary)

	# here you have a clean canvas.
	scourges = compound.ModelType(Scourge)
Exemplo n.º 21
0
class ModifyTask(models.Model):
    '''
        Modify task

        This model is similar to Task.

        It lacks of require and default values on it's fields.

        The reason of it existence is that we need to validate
        every input data that came from outside the system, with 
        this we prevent users from using PATCH to create fields 
        outside the scope of the resource.
    '''
    uuid = types.UUIDType()
    title = types.StringType()
    first_name = types.StringType()
    last_name = types.StringType()
    description = types.StringType()
    label = types.StringType()
    category = types.StringType()
    email = types.StringType()
    account = types.StringType()
    accountcode = types.StringType()
    userfield = types.StringType()
    assigned = types.BooleanType()
    checked = types.BooleanType()
    public = types.BooleanType()
    source = types.StringType()
    destination = types.StringType()
    channel = types.StringType()
    source_channel = types.StringType()
    context = types.StringType()
    destination_context = types.StringType()
    destination_number = types.StringType()
    destination_channel = types.StringType()
    start = types.DateTimeType()
    answer = types.DateTimeType()
    end = types.DateTimeType()
    duration = types.IntType()
    billsec = types.IntType()
    billing = types.IntType()
    rate = types.IntType()
    disposition = types.StringType()
    status = types.StringType()
    priority = types.StringType()
    severity = types.StringType()
    checked = types.BooleanType()
    checked_by = types.StringType()
    created = types.DateTimeType()
    comments = compound.ModelType(Comment)
    last_modified = types.DateTimeType()
    updated_by = types.StringType()
    updated_at = types.DateTimeType()
    uri = types.StringType()
Exemplo n.º 22
0
class ZergORG(models.Model):
	'''
		ZergORG schematics
		------------------

		The ZergORG do not use technology; Instead, they assimilate
		other species' traits by directed mutation in order to match
		such technology.

		ZergORG units are designed to be cheap and fast to produce,
		encouraging players to overwhelm their opponents with sheer
		numbers.

		Who has control over hordes of "minions"



		The Queen controls the Swarm through secondary agents called cerebrates. 

		Cerebrates command an individual cohort of ZergORG, 
		each with a distinct tactical role within the hierarchy. 

		Cerebrates further delegate power through the use of overlords 
		for battlefield direction and queens for hive watch.


		###Some notes about the species

		the ZergORG do not use technology; 

		Instead, they assimilate other species traits by directed mutation
		in order to match such technology.

		ZergORG units are designed to be cheap and fast to produce,
		encouraging players to overwhelm their opponents with sheer numbers.
	'''
	queens = compound.ModelType(Queen)
	cerebrates = compound.ModelType(Cerebrate)
	overlords = compound.ModelType(Overlord)
	lings = compound.ModelType(Ling)
	drones = compound.ModelType(Drone)
Exemplo n.º 23
0
class SchematicsFieldsModel(BaseModel):
    # base fields
    type_string = types.StringType()
    type_int = types.IntType()
    type_uuid = types.UUIDType()
    type_IPv4 = types.IPv4Type()
    type_url = types.URLType()
    type_email = types.EmailType()
    type_number = types.NumberType(int, "integer")
    type_int = types.IntType()
    type_long = types.LongType()
    type_float = types.FloatType()
    type_decimal = types.DecimalType()
    type_md5 = types.MD5Type()
    type_sha1 = types.SHA1Type()
    type_boolean = types.BooleanType()
    type_date = types.DateType()
    type_datetime = types.DateTimeType()
    type_geopoint = types.GeoPointType()
    # type_multilingualstring = types.MultilingualStringType(default_locale='localized_value')

    # compound fields
    type_list = compound.ListType(types.StringType)
    type_dict = compound.DictType(
        types.IntType)  # dict values can be only integers
    type_list_of_dict = compound.ListType(compound.DictType,
                                          compound_field=types.StringType)
    type_dict_of_list = compound.DictType(compound.ListType,
                                          compound_field=types.IntType)
    type_model = compound.ModelType(NestedModel)
    type_list_model = compound.ListType(compound.ModelType(NestedModel))

    # reference fields
    type_ref_simplemodel = ModelReferenceType(SimpleModel)
    type_ref_usermodel = ModelReferenceType(User)

    class Options:
        # namespace = 'st'
        collection = 'st'
        serialize_when_none = False
Exemplo n.º 24
0
class Cloud(Unit):
    '''
        Cloud data structure
    '''
    cohorts = compound.ModelType(Cohort)

    cores = types.IntType(default=4800)
    # it looks like it.
    total = types.IntType()


# NOTA: el problema es con repetir una y otra vez el mismo total vacio, no es necesario ya que la shit se hereda de Unit.
# testear esta hablada de mierda.
Exemplo n.º 25
0
class LegionaryORG(models.Model):
	'''
		LegionaryORG schematics
		-----------------------

		The Legion comprised ten cohorts, known simply as "the first cohort",
		"the second cohort" etc.

		The first cohort was considered to be the most senior and prestigious,
		and the tenth the least.

		A cohort consisted of approximately 480 men and commanded by one man.

		It consisted of six centuriae of 80 men, each commanded by a centurion 
		assisted by junior officers.

		The most senior centurion of the six command the entire cohort.
	'''
	centurion = compound.ModelType(Centurion)
	decanus = compound.ModelType(Decanus)
	legionary = compound.ModelType(Legionary)
	servant = compound.ModelType(Servant)
Exemplo n.º 26
0
class Record(models.Model):
    '''
        Record Object Data Structure
    '''
    uuid = types.UUIDType(default=uuid.uuid4)
    uniqueid = types.StringType()

    callerid = types.StringType()

    account = types.StringType()
    accountcode = types.StringType()
    userfield = types.StringType()

    queue = compound.ModelType(FromQueue)

    assigned = types.BooleanType(default=False)
    checked = types.BooleanType(default=False)

    public = types.BooleanType(default=False)

    source = types.StringType()
    destination = types.StringType()

    channel = types.StringType()
    source_channel = types.StringType()

    context = types.StringType()

    destination_context = types.StringType()

    destination_number = types.StringType()

    destination_channel = types.StringType()

    strdate = types.StringType()

    start = types.DateTimeType()
    answer = types.DateTimeType()
    end = types.DateTimeType()

    duration = types.IntType()
    seconds = types.IntType()
    minutes = types.IntType()
    billsec = types.IntType()
    billing = types.IntType()

    disposition = types.StringType()
    status = types.StringType()

    amaflags = types.StringType()

    lastapp = types.StringType()
    lastdata = types.StringType()

    recorded = types.BooleanType(default=False)
    record_uri = types.StringType()

    checked = types.BooleanType(default=False)
    checked_by = types.StringType()

    #details = compound.ModelType(Log)
    #comments = compound.ModelType(Comment)

    created = types.DateTimeType(default=arrow.utcnow().naive)
    #created_at = types.DateTimeType()
    last_modified = types.DateTimeType()
    updated_by = types.DateTimeType()
    updated_at = types.DateTimeType()

    uri = types.StringType()
Exemplo n.º 27
0
class Question(models.Model):
    question = types.StringType()
    choices = compound.ListType(compound.ModelType(MultipleChoice), default=[])
    selected_choice = compound.ModelType(MultipleChoice)
Exemplo n.º 28
0
class TasksResult(BaseResult):
    '''
        List result
    '''
    results = compound.ListType(compound.ModelType(tasks.Task))
Exemplo n.º 29
0
    class C2(ResourceCollection):
        c1 = compound.ModelType(C1, required=True)

        def create_resources(self):
            pass
Exemplo n.º 30
0
class BaseResult(models.Model):
    '''
        base result
    '''
    results = compound.ListType(compound.ModelType(Payment))