示例#1
0
class Client(DbNispd.orm()):
    __tablename__ = "clients"
    __table_args__ = (PrimaryKeyConstraint('id'), {
        'schema': 'billing',
        'autoload': True
    })

    @staticmethod
    def connection():
        return DbNispd.connection()

    def __init__(self,
                 id,
                 voip_limit_month=-1,
                 voip_limit_day=-1,
                 voip_disabled=False,
                 credit=-1,
                 balance=0,
                 amount_date=None,
                 last_payed_month=None):
        super(Client, self).__init__(id=id,
                                     voip_limit_month=voip_limit_month,
                                     voip_limit_day=voip_limit_day,
                                     voip_disabled=voip_disabled,
                                     credit=credit,
                                     balance=balance,
                                     amount_date=amount_date,
                                     last_payed_month=last_payed_month)
示例#2
0
文件: Sync.py 项目: kkrotov/voipbill
class Sync(DbNispd.orm()):
    __tablename__ = "sync"
    __table_args__ = {'schema': 'billing', 'autoload': True}

    @staticmethod
    def connection():
        return DbNispd.connection()
示例#3
0
class LocalNetwork(DbNispd.orm()):
    __tablename__ = "network_prefix"
    __table_args__ = {'schema': 'billing', 'autoload': True}

    @staticmethod
    def connection():
        return DbNispd.connection()

    def __init__(self,
                 network_type_id,
                 prefix,
                 instance_id,
                 operator_id,
                 date_from=None,
                 date_to=None,
                 deleted=None):
        if deleted is None:
            deleted = False

        if date_from is None:
            date_from = '2014-01-01'

        if date_to is None:
            date_to = '4000-01-01'

        super(LocalNetwork, self).__init__(network_type_id=network_type_id,
                                           prefix=prefix,
                                           instance_id=instance_id,
                                           operator_id=operator_id,
                                           date_from=date_from,
                                           date_to=date_to,
                                           deleted=deleted)
示例#4
0
class Tariff(DbNispd.orm()):
    __tablename__ = "tarif"
    __table_args__ = {'schema': 'billing', 'autoload': True}

    @staticmethod
    def connection():
        return DbNispd.connection()

    def __init__(self,
                 id,
                 pricelist_id,
                 freemin=0,
                 freemin_for_number=True,
                 paid_redirect=True,
                 tariffication_by_minutes=False,
                 tariffication_full_first_minute=False,
                 tariffication_free_first_seconds=True):
        super(Tariff, self).__init__(
            id=id,
            pricelist_id=pricelist_id,
            freemin=freemin,
            freemin_for_number=freemin_for_number,
            paid_redirect=paid_redirect,
            tariffication_by_minutes=tariffication_by_minutes,
            tariffication_full_first_minute=tariffication_full_first_minute,
            tariffication_free_first_seconds=tariffication_free_first_seconds,
            name='Test tariff',
            currency_id=1,
            status='public')
示例#5
0
文件: Price.py 项目: kkrotov/voipbill
class Price(DbNispd.orm()):
    __tablename__ = "defs"
    __table_args__ = {'schema': 'billing', 'autoload': True}

    @staticmethod
    def connection(): return DbNispd.connection()

    def __init__(self, ndef, pricelist_id, price,
                 date_from = None, date_to = None, deleted = None):
        if deleted is None:
            deleted = False

        if date_from is None:
            date_from = '2014-01-01'

        if date_to is None:
            date_to = '4000-01-01'

        super(Price, self).__init__(
            ndef = ndef,
            pricelist_id = pricelist_id,
            price = price,
            date_from = date_from,
            date_to = date_to,
            deleted= deleted
        )
示例#6
0
class ClientCounter(DbNispd.orm()):
    __tablename__ = "clients_counters"
    __table_args__ = {'schema': 'billing', 'autoload': True}

    @staticmethod
    def connection():
        return DbNispd.connection()
示例#7
0
class OperatorGroup(DbNispd.orm()):
    __tablename__ = "operator_group"
    __table_args__ = {'schema': 'voip', 'autoload': True}

    @staticmethod
    def connection():
        return DbNispd.connection()

    def __init__(self, id=1, name='Test operator group'):
        super(OperatorGroup, self).__init__(
            id=id,
            name=name,
        )
示例#8
0
class Operator(DbNispd.orm()):
    __tablename__ = "operator"
    __table_args__ = {'schema': 'voip', 'autoload': True}

    @staticmethod
    def connection():
        return DbNispd.connection()

    def __init__(self, id, name='Test operator', region=99):
        super(Operator, self).__init__(region=region,
                                       id=id,
                                       name=name,
                                       term_in_cost=0)
示例#9
0
class Server(DbNispd.orm()):
    __tablename__ = "instance_settings"
    __table_args__ = {'schema': 'billing', 'autoload': True}

    @staticmethod
    def connection():
        return DbNispd.connection()

    def __init__(self, id, region_id, city_prefix, city_geo_id, active=True):
        super(Server, self).__init__(id=id,
                                     region_id=region_id,
                                     city_prefix=city_prefix,
                                     city_geo_id=city_geo_id,
                                     active=active)
示例#10
0
class Pricelist(DbNispd.orm()):
    __tablename__ = "pricelist"
    __table_args__ = {'schema': 'voip', 'autoload': True}

    @staticmethod
    def connection(): return DbNispd.connection()

    def __init__(self, id, type, region = 99, operator_id = 2, name = 'Test pricelist'):
        super(Pricelist, self).__init__(
            id = id,
            type = type,
            region = region,
            operator_id = operator_id,
            name = name,
            initiate_mgmn_cost = 0,
            initiate_zona_cost = 0
        )
示例#11
0
class GeoPrefix(DbNispd.orm()):
    __tablename__ = "prefix"
    __table_args__ = {'schema': 'geo', 'autoload': True}

    @staticmethod
    def connection():
        return DbNispd.connection()

    def __init__(self,
                 prefix,
                 geo_id=0,
                 mob=False,
                 dest=7,
                 region=0,
                 operator_id=0):
        super(GeoPrefix, self).__init__(prefix=prefix,
                                        geo_id=geo_id,
                                        mob=mob,
                                        dest=dest,
                                        region=region,
                                        operator_id=operator_id)
示例#12
0
class Usage(DbNispd.orm()):
    __tablename__ = "usage"
    __table_args__ = {'schema': 'billing', 'autoload': True}

    @staticmethod
    def connection():
        return DbNispd.connection()

    def __init__(self,
                 id,
                 client_id,
                 phone_num,
                 region=99,
                 no_of_lines=1,
                 actual_from='2014-01-01',
                 actual_to='4000-01-01'):
        super(Usage, self).__init__(id=id,
                                    client_id=client_id,
                                    region=region,
                                    phone_num=phone_num,
                                    no_of_lines=no_of_lines,
                                    actual_from=actual_from,
                                    actual_to=actual_to)
示例#13
0
 def connection():
     return DbNispd.connection()
示例#14
0
    def connection(): return DbNispd.connection()

    def __init__(self, id, type, region = 99, operator_id = 2, name = 'Test pricelist'):
示例#15
0
文件: Price.py 项目: kkrotov/voipbill
    def connection(): return DbNispd.connection()

    def __init__(self, ndef, pricelist_id, price,
示例#16
0
class Call(DbNispd.orm()):
    __tablename__ = "calls"
    __table_args__ = {'schema': 'calls', 'autoload': True}

    @staticmethod
    def connection(): return DbNispd.connection()