squaresdb.money.models module

class squaresdb.money.models.CybersourceLineItem(id, transaction, amount, account_name, label, notes, lineitem_ptr, receipt_post, decision, ref_number, card_number, card_type)[source]

Bases: LineItem

Parameters:

Relationship fields:

Parameters:
exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: NotUpdated

card_number

Type: CharField

Card number

card_type

Type: CharField

Card type

decision

Type: CharField

Decision

lineitem_ptr

Type: OneToOneField to LineItem

Primary key: Lineitem ptr (related name: cybersourcelineitem)

lineitem_ptr_id

Internal field, use lineitem_ptr instead.

receipt_post

Type: JSONField

Receipt post

ref_number

Type: CharField

Ref number

class squaresdb.money.models.LineItem(id, transaction, amount, account_name, label, notes)[source]

Bases: Model

Parameters:

Relationship fields:

Parameters:

transaction (ForeignKey to Transaction) – Transaction (related name: lineitem)

Reverse relationships:

Parameters:
exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: ObjectNotUpdated, DatabaseError

account_name

Type: CharField

Account name

amount

Type: DecimalField

Amount

cybersourcelineitem

Type: Reverse OneToOneField from CybersourceLineItem

The cybersource line item of this line item (related name of lineitem_ptr)

id

Type: BigAutoField

Primary key: ID

label

Type: CharField

Label

notes

Type: TextField

Notes

objects = <django.db.models.Manager object>
productlineitem

Type: Reverse OneToOneField from ProductLineItem

The product line item of this line item (related name of lineitem_ptr)

subscriptionlineitem

Type: Reverse OneToOneField from SubscriptionLineItem

The subscription line item of this line item (related name of lineitem_ptr)

transaction

Type: ForeignKey to Transaction

Transaction (related name: lineitem)

transaction_id

Internal field, use transaction instead.

class squaresdb.money.models.Product(slug, label, category, order, active, account_name, description, admin_notes, low, high)[source]

Bases: Model

Parameters:

Relationship fields:

Parameters:

category (ForeignKey to ProductCategory) – Category (related name: product)

Reverse relationships:

Parameters:

productlineitem (Reverse ForeignKey from ProductLineItem) – All product line items of this product (related name of product)

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: ObjectNotUpdated, DatabaseError

account_name

Type: CharField

Account name

active

Type: BooleanField

Active

admin_notes

Type: TextField

Admin notes. internal item notes

category

Type: ForeignKey to ProductCategory

Category (related name: product)

category_id

Internal field, use category instead.

description

Type: TextField

Description. displayed to users

high

Type: DecimalField

High. Use 9999 for unlimited

label

Type: CharField

Label

low

Type: DecimalField

Low

objects = <django.db.models.Manager object>
order

Type: IntegerField

Order

price()[source]

Returns the price if low==high, else None

productlineitem_set

Type: Reverse ForeignKey from ProductLineItem

All product line items of this product (related name of product)

slug

Type: SlugField

Primary key: Slug

class squaresdb.money.models.ProductCategory(slug, name, order)[source]

Bases: Model

Parameters:

Reverse relationships:

Parameters:

product (Reverse ForeignKey from Product) – All products of this product category (related name of category)

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: ObjectNotUpdated, DatabaseError

name

Type: CharField

Name

objects = <django.db.models.Manager object>
order

Type: IntegerField

Order

product_set

Type: Reverse ForeignKey from Product

All products of this product category (related name of category)

slug

Type: SlugField

Primary key: Slug

class squaresdb.money.models.ProductLineItem(id, transaction, amount, account_name, label, notes, lineitem_ptr, product, count, price_each)[source]

Bases: LineItem

Parameters:

Relationship fields:

Parameters:
exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: NotUpdated

count

Type: IntegerField

Count

lineitem_ptr

Type: OneToOneField to LineItem

Primary key: Lineitem ptr (related name: productlineitem)

lineitem_ptr_id

Internal field, use lineitem_ptr instead.

price_each

Type: DecimalField

Price each

product

Type: ForeignKey to Product

Product (related name: productlineitem)

product_id

Internal field, use product instead.

class squaresdb.money.models.Transaction(id, nonce, time, user, person_name, email, notes, admin_notes, stage)[source]

Bases: Model

Parameters:

Relationship fields:

Parameters:

user (ForeignKey to User) – User (related name: transaction)

Reverse relationships:

Parameters:

lineitem (Reverse ForeignKey from LineItem) – All line items of this transaction (related name of transaction)

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: ObjectNotUpdated, DatabaseError

class Stage(*values)[source]

Bases: IntegerChoices

CANCEL = 60
CART = 10
PAID = 50
REVIEW = 40
admin_notes

Type: TextField

Admin notes

email

Type: EmailField

Email

first_name()[source]
get_next_by_time(*, field=<django.db.models.DateTimeField: time>, is_next=True, **kwargs)

Finds next instance based on time. See get_next_by_FOO() for more information.

get_previous_by_time(*, field=<django.db.models.DateTimeField: time>, is_next=False, **kwargs)

Finds previous instance based on time. See get_previous_by_FOO() for more information.

get_stage_display(*, field=<django.db.models.IntegerField: stage>)

Shows the label of the stage. See get_FOO_display() for more information.

id

Type: BigAutoField

Primary key: ID

last_name()[source]
lineitem_set

Type: Reverse ForeignKey from LineItem

All line items of this transaction (related name of transaction)

net_amount()[source]
nonce

Type: CharField

Nonce

notes

Type: TextField

Notes

objects = <django.db.models.Manager object>
person_name

Type: CharField

Person name

stage

Type: IntegerField

Stage

Choices:

  • 10

  • 40

  • 50

  • 60

stage_label()[source]
time

Type: DateTimeField

Time

user

Type: ForeignKey to User

User (related name: transaction)

user_id

Internal field, use user instead.

squaresdb.money.models.default_nonce()[source]