shop.skeletons.order

Attributes

Classes

Functions

Module Contents

shop.skeletons.order.logger
shop.skeletons.order.get_payment_providers()
Return type:

dict[str, str | viur.core.translate]

class shop.skeletons.order.OrderSkel

Bases: viur.core.skeleton.Skeleton

kindName = '{{viur_shop_modulename}}_order'
billing_address
customer

The user who placed this order.

Uses SetNull consistency: deleting a user account clears the relation instead of leaving a dangling reference. The order itself and its billing/shipping data stay untouched.

cart
total

Kopie der total vom gesamten Warenkorb

order_uid

Bestellnummer

payment_provider
is_ordered
is_paid
is_rts
is_checkout_in_progress
state
email

Deprecated since version 0.1.0.dev36: Use shop.skeleton.AddressSkel.email instead.

phone

Deprecated since version 0.1.0.dev36: Use shop.skeleton.AddressSkel.phone instead.

project_data

Zusätzliche Daten vom Projekt für eine Bestellung. Ggf. überlegen ob einzelne Bones durch Skeleton Modifizierung besser sind.

payment
classmethod refresh_cart(skel)

Shorthand to refresh the cart of an OrderSkel Due to race-condition and timing issues, the dest values are not always set correctly. This refresh fixes this.

Parameters:

skel (viur.core.skeleton.SkeletonInstance)

Return type:

viur.core.skeleton.SkeletonInstance

classmethod refresh_billing_address(skel)

Shorthand to refresh the billing_address of an OrderSkel Due to race-condition and timing issues, the dest values are not always set correctly. This refresh fixes this.

Parameters:

skel (viur.core.skeleton.SkeletonInstance)

Return type:

viur.core.skeleton.SkeletonInstance

classmethod read(skel, *args, **kwargs)

Read the order skeleton.

For open orders the cart relation is refreshed to work around race-condition and timing issues with its dest values. Completed orders (is_ordered) are exempt: their cart is frozen and the relation must keep the values from order time – refreshing it would overwrite them and let the order change retroactively.

Parameters:

skel (viur.core.skeleton.SkeletonInstance)

Return type:

viur.shop.types.t.Optional[viur.core.skeleton.SkeletonInstance]