Writes the integration guide

This commit is contained in:
Christopher Neugebauer 2016-04-25 09:49:19 +10:00
parent 9e215d1575
commit b0d1f69f1a
4 changed files with 52 additions and 4 deletions

View file

@ -19,6 +19,7 @@ Contents:
:maxdepth: 2
overview
integration
inventory
payments
for-zookeepr-users

37
docs/integration.rst Normal file
View file

@ -0,0 +1,37 @@
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.
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"
The only contract is that this form creates an instance of ``AttendeeProfileBase`` when saved, and that it can take an instance of your subclass on creation (so that your attendees can edit their profile).
Payments
--------
Registrasion does not implement its own credit card processing. You'll need to do that yourself. Registrasion *does* provide a mechanism for recording cheques and direct deposits, if you do end up taking registrations that way.
See :ref:`payments_and_refunds` for a guide on how to correctly implement payments.

View file

@ -1,4 +1,5 @@
.. automodule:: registrasion.models.commerce
.. _payments_and_refunds:
Payments and Refunds
====================

View file

@ -59,13 +59,22 @@ class AttendeeProfileBase(models.Model):
@classmethod
def name_field(cls):
''' This is used to pre-fill the attendee's name from the
speaker profile. If it's None, that functionality is disabled. '''
'''
Returns:
The name of a field that stores the attendee's name. This is used
to pre-fill the attendee's name from their Speaker profile, if they
have one.
'''
return None
def invoice_recipient(self):
''' Returns a representation of this attendee profile for the purpose
of rendering to an invoice. Override in subclasses. '''
'''
Returns:
A representation of this attendee profile for the purpose
of rendering to an invoice. This should include any information
that you'd usually include on an invoice. Override in subclasses.
'''
# Manual dispatch to subclass. Fleh.
slf = AttendeeProfileBase.objects.get_subclass(id=self.id)