コード例 #1
0
ファイル: test_pyxact_fields.py プロジェクト: jhumphry/pyxact
 class Holder:
     int_field=fields.IntField(nullable=False)
     int_field_nullable=fields.IntField(nullable=True)
     int_field_sqlname=fields.IntField(sql_name='not_int_field_sqlname')
     smallint_field=fields.SmallIntField()
     bigint_field=fields.BigIntField()
     context_int_field=fields.IntField(context_used='int_context')
     sequence_int_field=sequences.SequenceIntField(sequence=field_test_seq)
     row_enum_int_field=fields.RowEnumIntField(context_used='row_context')
     numeric_field=fields.NumericField(precision=6, scale=2)
     numeric_field_from_floats=fields.NumericField(precision=6, scale=2, allow_floats=True)
     numeric_field_inexact_quantize=fields.NumericField(precision=6, scale=2, inexact_quantize=True)
     real_field=fields.RealField()
     boolean_field=fields.BooleanField()
     text_field=fields.TextField()
     varchar_field=fields.VarCharField(max_length=5)
     varchar_field_truncate=fields.VarCharField(max_length=5, silent_truncate=True)
     char_field=fields.CharField(max_length=3)
     timestamp_field=fields.TimestampField(tz=True)
     timestamp_notz_field=fields.TimestampField(tz=False)
     utcnowtimestamp_field=fields.UTCNowTimestampField()
     time_field=fields.TimeField()
     utcnowtime_field=fields.UTCNowTimeField()
     date_field=fields.DateField()
     todaydate_field=fields.TodayDateField()
     blob_field=fields.BlobField()
コード例 #2
0
class TransactionTable(tables.SQLTable,
                       table_name='transactions',
                       version='2',
                       schema=accounting):
    tid = fields.IntField(context_used='tid')
    creator = fields.CharField(max_length=3)
    creation_ts = fields.TimestampField(tz=False, context_used='creation_ts')
    t_rev = fields.BooleanField(sql_name='t_rev')
    narrative = fields.TextField()
    transactions_cons_pk = constraints.PrimaryKeyConstraint(
        column_names=('tid'))
コード例 #3
0
class SimpleTransactionView(views.SQLView,
                            view_name='simple_view',
                            version='0.0.1',
                            query=SIMPLEVIEW_QUERY,
                            schema=accounting):
    tid = fields.IntField(context_used='tid')
    creator = fields.CharField(max_length=3)
    creation_ts = fields.TimestampField(tz=False)
    t_rev = fields.BooleanField()
    narrative = fields.TextField()
    row_id = fields.IntField()
    account = fields.IntField()
    amount = fields.NumericField(precision=8, scale=2, allow_floats=True)
コード例 #4
0
 class SampleRecord(records.SQLRecord):
     trans_id = fields.IntField(context_used='trans_id')
     flag = fields.BooleanField()
     amount = fields.NumericField(precision=6, scale=2, allow_floats=True)
     narrative = fields.TextField()
コード例 #5
0
ファイル: conftest.py プロジェクト: jhumphry/pyxact
 class SampleTable(tables.SQLTable, table_name='sample_table'):
     trans_id = fields.IntField(context_used='trans_id')
     flag = fields.BooleanField()
     amount = fields.NumericField(precision=6, scale=2, allow_floats=True)
     narrative = fields.TextField()
     pk = constraints.PrimaryKeyConstraint(column_names=('trans_id'))