Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More

The lino_xl.lib.shopping plugin

Adds database models for the shopping cart, delivery methods and the shopping addresses of a user.

This document assumes you have read The shopping plugin.

This document contains code snippets (lines starting with >>>) that get tested as part of our development workflow.

>>> import lino
>>> lino.startup('lino_book.projects.min9.settings')
>>> from django.utils import translation
>>> from lino.api.doctest import *
>>> from django.db.models import Q

Demo data

The plugin does not yet add much demo data.

>>> rt.show('shopping.Addresses')
No data to display
>>> rt.show('shopping.DeliveryMethods')
==== ================ ================== ================== ================
 ID   Designation      Designation (de)   Designation (fr)   Product
---- ---------------- ------------------ ------------------ ----------------
 1    Parcel center    Parcel center      Parcel center      Parcel center
 2    Home using UPS   Home using UPS     Home using UPS     Home using UPS
 3    Take away        Take away          Take away          Take away
==== ================ ================== ================== ================

Reference

class lino_xl.lib.shopping.DeliveryMethod

Django model used to represent a delivery method.

product

The product to invoice when using this delivery method.

class lino_xl.lib.shopping.Cart

Django model used to represent a shopping cart.

Inherits from lino.modlib.users.UserPlan.

user

The end user who created this cart.

date

The date of last modification.

delivery_address

The delivery address. A pointer to a shopping address of this user.

invoicing_address

The invoicing address. A pointer to a shopping address of this user.

delivery_method
invoice

The invoice that has been created from this shopping cart. This field is empty as long as the user didn’t yet run start_order.

class lino_xl.lib.shopping.CartItem

Django model used to represent an item of a shopping cart.

product
qty
class lino_xl.lib.shopping.StartOrder

Action to create an order from a shopping cart.

class lino_xl.lib.shopping.Address

Django model used to represent a shopping address.

class lino_xl.lib.shopping.DeliverMethod

Django model used to represent a delivery method.