mewlo.mpacks.core.database.mdbfield module

mdbfield.py The MewloDbField class handles one column of a model.

The approach we take is that each model in the system (MewloDbModel in mdbmodel.py) defined a list of MewloDbFields. The MewloDbFields roughly map to columns in a database table, but may also define relationships with other tables (absent a column). The MewloDbField should define all information needed for not just database storage but also visual display, sorting, searching, etc. That is, we are aiming for a DRY approach to model data by storing information in MewloDbFields. They also serve as a layer of abstraction on top of the SqlAlchemy library, which does the heavy lifting.

ATTN: THIS CODE NEEDS REVIEW/REWRITING – especially the relations code

class mewlo.mpacks.core.database.mdbfield.Dbf1to1_Left(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.Dbf1toN_Left

Relationship field.

class mewlo.mpacks.core.database.mdbfield.Dbf1to1_OneWay(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Relationship field.

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

create_sqlalchemy_mapperproperties(modelclass, modeltable)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.Dbf1to1_Right(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.Dbf1toN_Right

Relationship field.

class mewlo.mpacks.core.database.mdbfield.Dbf1toN_Left(id, properties={}, flag_to1=False)[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Relationship field.

create_sqlalchemy_mapperproperties(modelclass, modeltable)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.Dbf1toN_Right(id, properties={}, flag_to1=False)[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Relationship field.

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.DbfBigInteger(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

BigInteger field.

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.DbfBoolean(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Integer field.

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.DbfCryptoHash(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Ip of an accessing computer.

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.DbfEmail(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Limited length text field.

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.DbfEnum(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Enumerated field.

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.DbfFloat(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Float field.

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.DbfForeignKey(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Foreign Key.

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.DbfForeignKeyFromClassId(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.DbfForeignKey

Foreign Key to a class id.

class mewlo.mpacks.core.database.mdbfield.DbfForeignPrimaryKey(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Integer field.

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.DbfForeignUserId(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.DbfForeignKeyFromClassId

Foreign Key to User class id.

class mewlo.mpacks.core.database.mdbfield.DbfHashedPassword(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Limited length text field.

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.DbfInteger(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Integer field.

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.DbfLabelString(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Limited length text field.

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.DbfNtoM_SimpleRelation(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Relationship field.

create_sqlalchemy_mapperproperties(modelclass, modeltable)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.DbfPrimaryId(id='id', properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Standard numeric autoinc unique primary id field.

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.DbfSerialized(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Unlimited length text field used to serialize/unserialized arbitrary primitive types (dictionaries, etc.)

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.DbfServerIp(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Ip of an accessing computer.

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.DbfSqla(id, properties, sqlacolumns)[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

A dbf field that is passed a prebuilt sql alchemy column.

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.DbfString(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Limited length text field.

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.DbfText(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Unlimited length text field.

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.DbfTimestamp(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Timestamp field.

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.DbfTypeString(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Limited length text field.

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.DbfUniqueKeyname(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Short unique indexed key.

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.DbfUsername(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Limited length text field.

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.DbfVarname(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Limited length text field.

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.Dbf_SelfSelfRelation(id, properties={})[source]

Bases: mewlo.mpacks.core.database.mdbfield.MewloDbField

Relationship field.

create_sqlalchemy_mapperproperties(modelclass, modeltable)[source]

Convert field to sqlalchemy column.

class mewlo.mpacks.core.database.mdbfield.MewloDbField(id, properties)[source]

Bases: object

The DbField object represents a column in a database and contains ancillary information for gui stuff.

create_sqlalchemy_columns(modelclass)[source]

Convert field to sqlalchemy column.

create_sqlalchemy_mapperproperties(modelclass, modeltable)[source]

Convert field to sqlalchemy column.

get_sqlacolumn()[source]
get_sqlacolumns()[source]
set_sqlacolumns(sqlacolumns)[source]

Table Of Contents

Previous topic

mewlo.mpacks.core.database package

Next topic

mewlo.mpacks.core.database.mdbmanager module

This Page