rattail.classes - Rattail data classes
All classes defined in this module are imported to the root rattail namespace during rattail.init(). Others might also be available though, depending on which extensions are active in the current database. See Rattail Extensions for documentation on those.
Helper function, useful for sqlalchemy.ext.associationproxy.association_proxy() configuration.
Base class from which all other Rattail data classes inherit.
This class does provide some functionality; most of what it does is concerned with filtering (searching) and sorting. Applications may use this information to dynamically construct user interfaces.
Returns a rattail.filters.SearchFilter instance, initialized with values in kwargs.
Returns a list of rattail.filters.SearchFilter instances, one for each entry in the class’ filter_map.
Returns a sqlalchemy.orm.Query instance which is configured to query the class and is joined to any extra classes referred to by the class’ filter_map.
The plural display name for the class, e.g. “Products”.
The singular display name for the class, e.g. “Product”.
Returns a copy of query, sorted by key and direction.
Represents an organizational department.
The name of the department.
A reference to a rattail.TaxRate for the department.
Represents an employee within the organization.
An integer field which may contain a human-friendly ID for the employee.
Reference to a rattail.Person. It is assumed that an employee “is” a person.
The employee’s “PIN number”; used for quick logins.
Represents a type of measuring unit to be applied to a rattail.Product (e.g. “EA” or “LB”).
The human-friendly (singular) name of the measure, e.g. “Unit” or “Pound”.
Represents a grantable permission within the access control system.
A reference to the rattail.PermissionGroup to which this permission belongs.
The “permission” part of the permission’s name, i.e. without the “group” part of the name.
The name of the permission as displayed in user interfaces.
Represents a logical grouping of permissions.
The group’s canonical name. This is used in combination with Permission.name to interpret “fully-qualified” permission names.
The name of the group as displayed in user interfaces.
The list of rattail.Permission instances belonging to this group.
Represents an actual human being.
The person’s first name.
The person’s middle name.
The person’s last name.
The suffix of the person’s name.
The person’s name as it should be displayed in the user interface.
The year in which the person was born.
The month in which the person was born.
The day (of the month) in which the person was born.
Represents a product which is to be bought and/or sold by the organization.
A 16-character string field which may contain a PLU for the product.
The description of the product. Note that by default, this field is only 25 characters long so that it may easily fit on a receipt.
A reference to the rattail.Department to which the product belongs.
A reference to a rattail.TaxRate for the product.
A reference to a rattail.Brand for the product.
A string field which may contain size information for the product. The meaning of this field is left to each organization to determine.
A reference to a rattail.Measure for the product.
A reference to a rattail.BaseProduct, where self is defined as a secondary demonination to the base_product.
Multiplier to use when translating values between self and base_product.
A list of (20-char) barcode strings for the product.
Returns the first barcode in Product.barcodes, or None.
Boolean determining whether or not any discounts may be applied to the product when selling.
Represents a user role for managing permissions.
The name of the role.
The list of rattail.Permission instances which are allowed for the role.
Represents a physical store (or other location?) within the organization.
An integer field which may contain a human-friendly ID for the store.
A descriptive name for the store.
Represents a percentage tax rate, to be applied at the point of sale.
A descriptive name for the tax rate.
The actual tax rate percentage in decimal, e.g. 4.20 (%).
Represents a user of the Rattail system.
The username with which the user may log in.
The user’s password. Note that the actual format of data in this field will depend on the “authenticator” in use.
The salt to be used when hashing the user’s password, if the authenticator in use requires it.
Reference to a rattail.Person. It is mostly assumed that a user “is” a person, although some jobs (e.g. ETL) might require automation under a non-human user.
A list of rattail.Role instances to which the user belongs.