Changeset - cbecbf9a4102
[Not reviewed]
0 3 0
Christopher Neugebauer - 8 years ago 2016-04-25 08:50:09
chrisjrn@gmail.com
Tidies up some docs
3 files changed with 6 insertions and 2 deletions:
0 comments (0 inline, 0 general)
docs/integration.rst
Show inline comments
 
Integrating Registrasion
 
========================
 

	
 
Registrasion is a Django app. It does not provide any templates -- you'll need to develop these yourself. You can use the ``registrasion-demo`` project as a starting point.
 
Registrasion is a Django app. It does not provide any templates -- you'll need to develop these yourself. You can use the `registrasion-demo <https://github.com/chrisjrn/registrasion-demo>`_ project as a starting point.
 

	
 
To use Registrasion for your own conference, you'll need to do a small amount of development work, usually in your own Django App.
 

	
 
The first is to define a model and form for your attendee profile, and the second is to implement a payment app.
 

	
 

	
 
Attendee profile
 
----------------
 

	
 
.. automodule:: registrasion.models.people
 

	
 
Attendee profiles are where you ask for information such as what your attendee wants on their badge, and what the attendee's dietary and accessibility requirements are.
 

	
 
Because every conference is different, Registrasion lets you define your own attendee profile model, and your own form for requesting this information. The only requirement is that you derive your model from ``AttendeeProfileBase``.
 

	
 
.. autoclass :: AttendeeProfileBase
 
    :members: name_field, invoice_recipient
 

	
 
Once you've subclassed ``AttendeeProfileBase``, you'll need to implement a form that lets attendees fill out their profile.
 

	
 
You specify how to find that form in your Django ``settings.py`` file::
 

	
 
    ATTENDEE_PROFILE_FORM = "democon.forms.AttendeeProfileForm"
 

	
docs/inventory.rst
Show inline comments
 

	
 
Inventory Management
 
====================
 

	
 
Registrasion uses an inventory model to keep track of tickets, and the other various products that attendees of your conference might want to have, such as t-shirts and dinner tickets.
 

	
 
All of the classes described herein are available through the Django Admin interface.
 

	
 
Overview
 
--------
 

	
 
The inventory model is split up into Categories and Products. Categories are used to group Products.
 

	
 
Registrasion uses conditionals to build up complex tickets, or enable/disable specific items to specific users:
 

	
 
Often, you will want to offer free items, such as t-shirts or dinner tickets to your attendees. Registrasion has a Discounts facility that lets you automatically offer free items to your attendees as part of their tickets. You can also automatically offer promotional discounts, such as Early Bird discounts.
 

	
 
Sometimes, you may want to restrict parts of the conference to specific attendees, for example, you might have a Speakers Dinner to only speakers. Or you might want to restrict certain Products to attendees who have purchased other items, for example, you might want to sell Comfy Chairs to people who've bought VIP tickets. You can control showing and hiding specific products using Flags.
 

	
 

	
 
.. automodule:: registrasion.models.inventory
 

	
 
Categories
 
----------
 

	
 
Categories are logical groups of Products. Generally, you should keep like products in the same category, and use as many categories as you need.
 

	
 
You will need at least one Category to be able to sell tickets to your attendees.
 

	
 
Each category has the following attributes:
 

	
 
.. autoclass :: Category
 

	
 

	
 
Products
registrasion/controllers/cart.py
Show inline comments
...
 
@@ -257,49 +257,48 @@ class CartController(object):
 
        or others). '''
 

	
 
        required = set(inventory.Category.objects.filter(required=True))
 

	
 
        items = commerce.ProductItem.objects.filter(
 
            product__category__required=True,
 
            cart__user=self.cart.user,
 
        ).exclude(
 
            cart__status=commerce.Cart.STATUS_RELEASED,
 
        )
 

	
 
        for item in items:
 
            required.remove(item.product.category)
 

	
 
        errors = []
 
        for category in required:
 
            msg = "You must have at least one item from: %s" % category
 
            errors.append((None, msg))
 

	
 
        if errors:
 
            raise ValidationError(errors)
 

	
 
    def _append_errors(self, errors, ve):
 
        for error in ve.error_list:
 
            print error.message
 
            errors.append(error.message[1])
 

	
 
    def validate_cart(self):
 
        ''' Determines whether the status of the current cart is valid;
 
        this is normally called before generating or paying an invoice '''
 

	
 
        cart = self.cart
 
        user = self.cart.user
 
        errors = []
 

	
 
        try:
 
            self._test_vouchers(self.cart.vouchers.all())
 
        except ValidationError as ve:
 
            errors.append(ve)
 

	
 
        items = commerce.ProductItem.objects.filter(cart=cart)
 

	
 
        product_quantities = list((i.product, i.quantity) for i in items)
 
        try:
 
            self._test_limits(product_quantities)
 
        except ValidationError as ve:
 
            self._append_errors(errors, ve)
 

	
 
        try:
0 comments (0 inline, 0 general)