The model pakcage represents all data, that is stored either in database or in objects.
before using the model, you have to use, you have to set the Engine with dbdefer.setEngine() and set the Threadpool with dbdefer.setPool() (see iro.main.runReactor() for initalizing this module).
Bases: object
a twisted sqlalchemy connector.
This is used as a Decorator class. It adds a session parameter to the function with a valid session. If the session parmaeter is used in calling this function only calls a commit after running the function, instead of createing a new session.
Parameters: |
|
---|
the decorator to use. Use setEngine() to set a valid engine after program has started.
All decorators, that are created by this package.
Imports:
a validator to test a valid route. use with iro.validate.validate().
Parameters: |
|
---|---|
Returns: | value, if value is a valid route for a given typ. |
Raises : |
a validator to test a valid typ. use with iro.validate.validate().
Parameters: |
|
---|---|
Returns: | value, if value is a valid typ. |
Raises : |
A ExJob object represents a message to multiple recipients over multiple offers to send.
One single message to one recipient is handeld in iro.controller.task.Task. This class holds connections to all tasks. This class is responsiple to update the status in database of one job and updating the bill.
Constructor of ExJob.
Parameters: |
|
---|
adding a task to tasks dict - key is the recipient.
Parameters: | task (iro.controller.task.Task) – a task |
---|
errback for one task.
This function updates the database object.
callback of one task.
This function updates the database object and the bill.
Bases: dict, _abcoll.MutableMapping
a dict to handle all jobs.
creates on new Job.
Parameters: |
|
---|---|
Returns: | the new job |
the dict of all available jobs.
All available message typs to send send.
Baseclass for all different message typs.
Constructor of Message class.
Parameters: |
|
---|
Bases: iro.model.message.Message
A representation of one SMS
Constructor of SMS class.
Parameters: |
|
---|
Bases: iro.model.message.Message
A representation of one fax.
Constructor of one fax.
Parameters: |
|
---|
Bases: iro.model.message.Message
A representation of one Mail
Constructor of one mail.
Parameters: |
|
---|
extend and reduce the offer list to allowed routes for user.
Parameters: |
|
---|---|
Returns: | a extended an reduced offer list |
loading Offers from database and configuration file and store them in offers and providers.
Parameters: | session – a valid session ( created by decorator iro.model.dbdefer.dbdefer()) |
---|
A dict of all available offers – key is the offer name
A dict of all available providers – key is the provider name
A very simple class to save the thread pool for database requests
holds connection to the actual thread pool for the database requests
Bases: sqlalchemy.ext.declarative.Base
A complete Job.
string representation of the Job class.
Returns: | <Job('id' ,'info', 'status', 'user_id')> |
---|
returns the connected iro.model.job.ExJob
job id
job info, for billing porpuse
status of a job
connected user id
Bases: sqlalchemy.ext.declarative.Base
A message that has created costs.
isBilled is False since the bill is paid.
Count of sended messages
date of sending the message
external API id
primary key of the message
is bill paid?
id of the connected job
sended message over this offer woth ithe offer.name
price of sending the message
string representation of the recipient
Bases: sqlalchemy.ext.declarative.Base
All possible Offers over a Message can be sended. provider, typ and route are used to get the data form configuration file.
name of the offer
provider name
returns a list of all possible providers.
Parameters: | typ (string) – get all providers that support this typ |
---|
route of the provider
returns a query object of all possible offers.
Parameters: | typ (string) – get all offers that support this typ |
---|
typ of message
Bases: sqlalchemy.ext.declarative.Base
An user in iro.
Constructor of User class.
Parameters: |
|
---|
apikey only [0-9a-f]
if a user has the right to use a offer, provider e. al. (arguments are and connected).
Parameters: |
|
---|---|
Returns: | offer_name or None (not allwoed) |
Raises : | sqlalchemy.orm.exc.MultipleResultsFound if not a single offer match |
returns a job object.
Parameters: | id (integer) – id of a Job |
---|---|
Returns: | Job |
Raises : | iro.error.JobNotFound |
Username
Connection to the netzguerilla userdatabase
return a query object for all possible providers for a given typ
Parameters: |
|
---|
all allowed offers to send with.
Bases: sqlalchemy.ext.declarative.Base
Allowed offers for one user. Default routes are sorted by default value.
Constructor of Userright class.
Parameters: |
|
---|
sorting defaults routes with this value
offername
username
status object – the resulat of one iro.controller.task.Task.
Parameters: |
|
---|
Returns a valid user object.
Parameters: |
|
---|---|
Returns: | a iro.model.schema.User object |
Raises : |
A Decorator to verify the apikey and execute the function with a valid iro.model.schema.User instead of the apikey.
The decorator expect the apikey in the user parameter.
Returns: | a defer |
---|
Bases: object
a with statement for a database session connection.
Parameters: |
|
---|