Welcome to Eggplant’s documentation!

Contents:

Installation

Warning

Eggplant is under heavy development and is not fully fuctional. The point of this document is mainly to give a sense of how Eggplant can be used by external organizations.

Eggplant is an application for Django, meaning that it’s something you would embed in a django project.

However, for your convenience, it comes with a pre-setup Django project so you can run it with default settings and templates for development etc. To get started developing, please see Get Started!.

In order to install Eggplant for a given other Django project, obtain eggplant from PyPi:

$> mkvirtualenv my_eggplant_env
$> pip install django\>=1.9,\<2.0
$> django-admin startproject my_eggplat_project
$> pip install eggplant
$> $EDITOR my_eggplat_project/settings.py
$> # INSERT from eggplat.deployments.default.settings.base import *
$> $EDITOR my_eggplat_project/urls.py
$> # Insert url(r'^eggplant/', include('eggplant.urls')) in urlpatterns

Note

We haven’t released the first eggplant on PyPi yet, so you need to get it directly from Github instead

Authors

Please feel free to add yourself to the list when you open a PR. For a more complete, automated list, refer to Github Contributor’s list.

Contributors:

  • Andreas Lloyd: andreaslloyd
  • Viðir Valberg: valberg
  • Kræn Hansen: kraenhansen
  • Benjamin Bach: benjaoming
  • Paweł Bielecki: pawciobiel
  • Francesco Zanitti: cheng81
  • James Brooking: jambroo
  • Sean Bendtsen Powell: sepow
  • Sam Thomson: samthomson
  • Anders Thøgersen: aklt
  • Jacob Andreasen: jacobandreasen
  • Jakob Garde: climbcat
  • Mikkel Munch Mortensen: decibyte
  • Jerzy Kozera: jkozera
  • Steffen Maegaard: smaegaard
  • Kevin Simper: kevinsimper

Organizations who contributed to the development of Eggplant:

  • The Eggplan Meetup Group (hosted by KbhFF)
  • KbhFF, Københavns Fødevarefællesskab (Copenhagen Food Coop)
  • SocialSquare

History

0.1 (2015-08-15)

  • Adding a history file for the Eggplant application

Developer documentation

Contents:

Component overview

The Eggplant application contains the following sub-applications (python packages nested in eggplant/ containing models and migrations).

Applications inside eggplant/ are interdependent, except core which should not depend on anything else and permissions which all other applications are expected to use.

  • accounts - Administration and user pages related to accounts, being everything that has to do with user’s transactions inside the market.
  • core - an application with models that all other applications may depend on, dependency of others
  • dashboard - Functionality for workflow of members, administrators etc.
  • departments - Administration logic regarding a department such as shifts.
  • invitations - Sending of invitation emails to create new user profiles that join accounts, departments etc.
  • membership - Extends from Django allauth and contains the models of memberships and their organizations.
  • market - Contains everything related to paying for stuff, invoicing, and creating and managing goods such as grocery bags.
  • permissions - Models and decorators for permissions, dependency of others
  • profiles - User information

Coupling

Currently, we expect applications to depend on each other’s models. But it would get messy if templates, views, and static assets also started being interdependent.

Possible scheme: Only allow models and decorators to be interdependent, all other common elements should live in eggplant.core.

Philosophy

To quote Two Scoops of Django (1.8 version) that in turn quotes James Bennett (who in turn quotes Douglas McIlroy):

James Bennett volunteers as both a Django core developer and as its release manager. He taught us everything that we know about good Django app design. We quote him:

“The art of creating and maintaining a good Django app is that it should follow the truncated Unix philosophy according to Douglas McIlroy:

‘Write programs that do one thing and do it well.’

In essence, each app should be tightly focused on its task. If an app can’t be explained in a single sentence of moderate length, or you need to say ‘and’ more than once, it probably means the app is too big and should be broken up.

TODO

The scope of the applications may need to be consolidated.

Dependency overview

askdasdk

Python Reference

eggplant package

Subpackages

eggplant.accounts package
Submodules
eggplant.accounts.admin module
class eggplant.accounts.admin.AccountAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

inlines = [<class 'eggplant.accounts.admin.AccountMembershipInline'>]
media
class eggplant.accounts.admin.AccountCategoryAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

media
class eggplant.accounts.admin.AccountMembershipInline(parent_model, admin_site)[source]

Bases: django.contrib.admin.options.TabularInline

media
model

alias of Account_user_profiles

eggplant.accounts.models module
class eggplant.accounts.models.Account(id, name, category, department, start, exit, active)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

active

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

category

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

category_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

department

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

department_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

exit

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_start(*moreargs, **morekwargs)
get_previous_by_start(*moreargs, **morekwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_or_profile_names()[source]
objects = <django.db.models.manager.Manager object>
payment_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

start

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

user_profiles

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

pizza.toppings and topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

userprofilepermission_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class eggplant.accounts.models.AccountCategory(id, name)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

accounts

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

departmentinvitation_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
eggplant.accounts.urls module
Module contents
eggplant.core package
Subpackages
eggplant.core.templatetags package
Submodules
eggplant.core.templatetags.partition_slice module
eggplant.core.templatetags.partition_slice.partition(thelist, n)[source]

Break a list into n pieces. The last list may be larger than the rest if the list doesn’t break cleanly. That is:

>>> l = range(10)

>>> partition(l, 2)
[[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]

>>> partition(l, 3)
[[0, 1, 2], [3, 4, 5], [6, 7, 8, 9]]

>>> partition(l, 4)
[[0, 1], [2, 3], [4, 5], [6, 7, 8, 9]]

>>> partition(l, 5)
[[0, 1], [2, 3], [4, 5], [6, 7], [8, 9]]
eggplant.core.templatetags.partition_slice.partition_horizontal(thelist, n)[source]

Break a list into n peices, but “horizontally.” That is, partition_horizontal(range(10), 3) gives:

[[1, 2, 3],
 [4, 5, 6],
 [7, 8, 9],
 [10]]

@see: https://djangosnippets.org/snippets/6/

Module contents
Submodules
eggplant.core.context_processors module
eggplant.core.context_processors.coop_vars(request)[source]
eggplant.core.tests module
class eggplant.core.tests.UtilsTestCase(methodName='runTest')[source]

Bases: django.test.testcases.TestCase

test_context_processor()[source]
test_generate_upload_path()[source]
test_generate_upload_path_with_dir()[source]
eggplant.core.utils module
eggplant.core.utils.absolute_url_reverse(url_name=None, **kwargs)[source]
eggplant.core.utils.disable_for_loaddata(signal_handler)[source]

Decorator that turns off signal handlers when loading fixture data.

eggplant.core.utils.generate_upload_path(instance, filename, dirname=None)[source]

Generate path with random file name for FileField.

eggplant.core.views module
class eggplant.core.views.LoginRequiredMixin[source]

Bases: object

TODO: This mixin should be replaced with django.contrib.auth.mixin.LoginRequiredMixin in django 1.9

classmethod as_view(**kwargs)[source]
eggplant.core.widgets module
class eggplant.core.widgets.MoneyWidget(*args, **kwargs)[source]

Bases: djmoney.forms.widgets.MoneyWidget

media
render(name, value, attrs=None)[source]
Module contents
eggplant.dashboard package
Submodules
eggplant.dashboard.models module
eggplant.dashboard.tests module
class eggplant.dashboard.tests.TestDashboard(methodName='runTest')[source]

Bases: django.test.testcases.TestCase

test_home()[source]
eggplant.dashboard.urls module

Dashboard urlconf, included by foodnet.urls

Final namespace of these URLs:

eggplant:dashboard:url_name

eggplant.dashboard.views module
eggplant.dashboard.views.home(request, *args, **kwargs)[source]

home page

Module contents
eggplant.departments package
Submodules
eggplant.departments.admin module
class eggplant.departments.admin.DepartmentAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

inlines = [<class 'eggplant.departments.admin.DepartmentAdministratorInline'>]
media
class eggplant.departments.admin.DepartmentAdministratorInline(parent_model, admin_site)[source]

Bases: django.contrib.admin.options.TabularInline

media
model

alias of DepartmentAdministrator

eggplant.departments.models module
class eggplant.departments.models.Department(id, name, slug, site)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

accounts

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

departmentadministrator_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

departmentinvitation_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
save(**kwargs)[source]
site

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

site_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

slug

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

userprofilepermission_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class eggplant.departments.models.DepartmentAdministrator(id, department, profile, created)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

department

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

department_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_created(*moreargs, **morekwargs)
get_previous_by_created(*moreargs, **morekwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
profile

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

profile_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

eggplant.departments.tests module
eggplant.departments.urls module
eggplant.departments.views module
class eggplant.departments.views.DepartmentProfiles(**kwargs)[source]

Bases: eggplant.core.views.LoginRequiredMixin, django.views.generic.list.ListView

get_queryset()[source]
model

alias of UserProfile

paginate_by = 25
template_name = 'eggplant/departments/profiles.html'
eggplant.departments.views.departments_profiles(request, *args, **kwargs)
Module contents
eggplant.invitations package
Submodules
eggplant.invitations.admin module
class eggplant.invitations.admin.DepartmentInvitationAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

media
eggplant.invitations.auth_backends module
class eggplant.invitations.auth_backends.InvitationBackend[source]

Bases: django.contrib.auth.backends.ModelBackend

authenticate(**credentials)[source]

Authenticate only invited users with not completed profile.

eggplant.invitations.forms module
class eggplant.invitations.forms.AcceptInvitationForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form

base_fields = OrderedDict([('captcha', <captcha.fields.ReCaptchaField object>)])
declared_fields = OrderedDict([('captcha', <captcha.fields.ReCaptchaField object>)])
media
class eggplant.invitations.forms.DepartmentInvitationForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None)[source]

Bases: django.forms.models.ModelForm

class Meta[source]
fields = ['department', 'account_category', 'email']
model

alias of DepartmentInvitation

base_fields = OrderedDict([('department', <django.forms.models.ModelChoiceField object>), ('account_category', <django.forms.models.ModelChoiceField object>), ('email', <django.forms.fields.EmailField object>)])
declared_fields = OrderedDict([('email', <django.forms.fields.EmailField object>)])
media
eggplant.invitations.models module
class eggplant.invitations.models.DepartmentInvitation(id, email, accepted, accepted_at, verification_key, created, invited_by, department, account_category)[source]

Bases: eggplant.invitations.models.InvitationBase

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

account_category

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

account_category_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

department

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

department_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_created(*moreargs, **morekwargs)
get_previous_by_created(*moreargs, **morekwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

invited_by

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

objects = <django.db.models.manager.Manager object>
class eggplant.invitations.models.InvitationBase(*args, **kwargs)[source]

Bases: django.db.models.base.Model

class Meta[source]
abstract = False
permissions = (('can_invite', 'Can send invitation'),)
accepted

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

accepted_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

email

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_created(*moreargs, **morekwargs)
get_previous_by_created(*moreargs, **morekwargs)
invited_by

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

invited_by_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

verification_key

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

eggplant.invitations.models.send_email_invitation(*args, **kwargs)[source]

TODO: Implement an HTML message, commenting out the html_* lines below

eggplant.invitations.tests module
eggplant.invitations.urls module
eggplant.invitations.utils module
eggplant.invitations.utils.create_verified_user(invitation)[source]
eggplant.invitations.views module
exception eggplant.invitations.views.AlreadyAcceptedInvitationException[source]

Bases: exceptions.Exception

eggplant.invitations.views.accept_invitation(request, verification_key)[source]

Accept invitation.

eggplant.invitations.views.do_accept_invitation(request, invitation)[source]
eggplant.invitations.views.invite(request, *args, **kwargs)[source]

Invite a new email address.

Module contents
eggplant.market package
Subpackages
eggplant.market.models package
Submodules
eggplant.market.models.cart module
class eggplant.market.models.cart.Basket(id, user, created, status)[source]

Bases: django.db.models.base.Model

CHECKEDOUT = 'checked-out'
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

OPEN = 'open'
STATUES = (('open', 'open'), ('checked-out', 'checked-out'))
add_to_items(product=None, quantity=1, delivery_date=None)[source]
created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

do_checkout(*args, **kwargs)[source]
get_items_count()[source]
get_next_by_created(*moreargs, **morekwargs)
get_previous_by_created(*moreargs, **morekwargs)
get_status_display(*moreargs, **morekwargs)
get_total_amount()[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

items

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

objects = <eggplant.market.models.cart.BasketManager object>
remove_from_items(product=None, quantity=1, delivery_date=None)[source]
status

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

user

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

user_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class eggplant.market.models.cart.BasketItem(id, basket, product, quantity, delivery_date)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

basket

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

basket_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

delivery_date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
product

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

product_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

quantity

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class eggplant.market.models.cart.BasketManager[source]

Bases: django.db.models.manager.Manager

open_for_user(user)[source]

Get open basket for a given user. This is just a wrapper around get_or_create so we can add more default kwargs or logic to basket in one place - perhaps a check if user payed some fees(?)...

eggplant.market.models.inventory module
class eggplant.market.models.inventory.Product(id, title, description, category, price_currency, price, stock, tax, enabled, image)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

basketitem_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

category

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

category_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

enabled

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_price_currency_display(*moreargs, **morekwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

image

Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.

objects = <djmoney.models.managers.MoneyManager object>
price
price_currency

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

stock

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

tax

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

tax_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class eggplant.market.models.inventory.ProductCategory(id, title, description, enabled)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

enabled

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
product_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class eggplant.market.models.inventory.ProductTax(id, title, description, enabled, tax)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

enabled

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
product_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

tax

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

eggplant.market.models.inventory.do_upload_product_image(inst, filename)[source]
eggplant.market.models.listeners module

Notice: getpaid calls it “order” objects, however since our payments app does not model orders, we also call this “payment” in eggplant.payments.models

eggplant.market.models.listeners.new_payment_listener(sender, order=None, payment=None, **kwargs)[source]

Log how many and which payments were made.

eggplant.market.models.listeners.new_payment_query_listener(sender, order=None, payment=None, **kwargs)[source]

Fills in required payment details.

eggplant.market.models.listeners.order_additional_validation_listener(sender, request=None, order=None, backend=None, **kwargs)[source]

Custom validation.

eggplant.market.models.listeners.payment_status_changed_listener(sender, instance, old_status, new_status, **kwargs)[source]

Here we will actually do something, when payment is accepted. E.g. lets change an order status based on payment status.

eggplant.market.models.listeners.user_data_query_listener(sender, order=None, user_data=None, **kwargs)[source]

Fills in required user details.

eggplant.market.models.payment module
class eggplant.market.models.payment.Payment(id, amount_currency, account, amount, created)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

account

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

account_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

amount
amount_currency

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_absolute_url()[source]
get_amount_currency_display(*moreargs, **morekwargs)
get_last_payment_status()[source]
get_next_by_created(*moreargs, **morekwargs)
get_previous_by_created(*moreargs, **morekwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_ready_for_payment()[source]
objects = <djmoney.models.managers.MoneyManager object>
payments

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

Module contents
eggplant.market.templatetags package
Submodules
eggplant.market.templatetags.cart_tags module
eggplant.market.templatetags.cart_tags.cart_action(context, action, product_id=None, quantity=None, delivery_date=None)[source]
Module contents
eggplant.market.views package
Submodules
eggplant.market.views.cart module
class eggplant.market.views.cart.AddToCart(**kwargs)[source]

Bases: eggplant.market.views.cart.BaseCartActionView

form_valid(form)[source]
class eggplant.market.views.cart.BaseCartActionView(**kwargs)[source]

Bases: django.views.generic.edit.FormView

form_class

alias of BasketItemForm

form_invalid(form)[source]
form_valid(form)[source]
get_template_names()[source]
success_url = <django.utils.functional.__proxy__ object>
class eggplant.market.views.cart.RemoveFromCart(**kwargs)[source]

Bases: eggplant.market.views.cart.BaseCartActionView

form_valid(form)[source]
eggplant.market.views.cart.add_to_cart(request, *args, **kwargs)
eggplant.market.views.cart.cart_details(request, *args, **kwargs)[source]
eggplant.market.views.cart.checkout(request, *args, **kwargs)[source]
eggplant.market.views.cart.remove_from_cart(request, *args, **kwargs)
eggplant.market.views.inventory module
eggplant.market.views.inventory.add_product(request, *args, **kwargs)[source]
eggplant.market.views.inventory.market_home(request, *args, **kwargs)[source]
eggplant.market.views.payment module
class eggplant.market.views.payment.PaymentView(**kwargs)[source]

Bases: eggplant.core.views.LoginRequiredMixin, django.views.generic.detail.DetailView

dispatch(obj)[source]
get_context_data(**kwargs)[source]
get_queryset()[source]
model

alias of Payment

template_name = 'eggplant/market/payment_detail.html'
eggplant.market.views.payment.payment_accepted(request, pk=None)[source]
eggplant.market.views.payment.payment_detail(request, *args, **kwargs)
eggplant.market.views.payment.payment_info(request, *args, **kwargs)[source]
eggplant.market.views.payment.payment_list(request, *args, **kwargs)[source]
eggplant.market.views.payment.payment_rejected(request, *args, **kwargs)[source]
Module contents
Submodules
eggplant.market.admin module
class eggplant.market.admin.ProductAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('title', 'category', 'stock', 'price', 'enabled')
list_filter = ('enabled', 'category__title')
media
class eggplant.market.admin.ProductCategoryAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('title', 'enabled')
list_filter = ('enabled',)
media
eggplant.market.filters module
class eggplant.market.filters.LinksGroupWidget(attrs=None, choices=())[source]

Bases: django_filters.widgets.LinkWidget

media
option_string()[source]
render(name, value, attrs=None, choices=())[source]
render_option(name, selected_choices, option_value, option_label)[source]
class eggplant.market.filters.ProductFilter(*args, **kwargs)[source]

Bases: django_filters.filterset.FilterSet

class Meta[source]
fields = ['category']
model

alias of Product

base_filters = OrderedDict([('category', <django_filters.filters.ModelChoiceFilter object>)])
declared_filters = OrderedDict([('category', <django_filters.filters.ModelChoiceFilter object>)])
eggplant.market.forms module
class eggplant.market.forms.BasketItemForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form

base_fields = OrderedDict([('product', <django.forms.models.ModelChoiceField object>), ('quantity', <django.forms.fields.IntegerField object>), ('delivery_date', <django.forms.fields.DateField object>)])
declared_fields = OrderedDict([('product', <django.forms.models.ModelChoiceField object>), ('quantity', <django.forms.fields.IntegerField object>), ('delivery_date', <django.forms.fields.DateField object>)])
media
class eggplant.market.forms.ProductForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None)[source]

Bases: django.forms.models.ModelForm

class Meta[source]
fields = ['title', 'description', 'price', 'category', 'tax', 'stock']
model

alias of Product

widgets = {'price': <eggplant.core.widgets.MoneyWidget object>}
base_fields = OrderedDict([('title', <django.forms.fields.CharField object>), ('description', <django.forms.fields.CharField object>), ('price', <djmoney.forms.fields.MoneyField object>), ('category', <django.forms.models.ModelChoiceField object>), ('tax', <django.forms.models.ModelChoiceField object>), ('stock', <django.forms.fields.IntegerField object>)])
declared_fields = OrderedDict()
media
eggplant.market.tests module
eggplant.market.urls module
Module contents
eggplant.permissions package
Submodules
eggplant.permissions.admin module
eggplant.permissions.models module

Permission philosophy:

  • Be explicit! Uses boolean fields for specific tasks
  • Be SQL friendly, create permissions that are nice to work with in query set lookups
  • Put logic in decorators
class eggplant.permissions.models.Permission(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Permission roles are a set of permissions. Permissions are modeled as booleans in this model.

What can a user do? Examples from discussion of different roles:

A user is a superuser: Don’t put it here – THIS IS FOR THE global User.is_superuser field!!

A user can create and manage all departments.: E.g. someone from the central commission can add a new department and close an existing one.

A user is a department manager: Can create and delete accounts and user profiles for everyone in a department.

A user is an “intro vagt”: Someone who can create new accounts

A user is a team link: Can manage volunteer shifts

A user owns an account: Can add credit card, can add others to the account

CONCEPT OF THIS MODEL: Create boolean fields for different permissions, create lots of them! We want to be very explicit.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

all_permissions

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

can_add_user_profiles

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

can_change_account

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
save(*args, **kwargs)[source]
userprofile_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

pizza.toppings and topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

userprofilepermission_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class eggplant.permissions.models.UserProfilePermission(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Link between a user profile and a set of permissions (a role).

Example 1:

Check if a user has user creation access to a department:

can_add_users = department.userprofilepermission_set.filter(
    user_profile__user=request.user,
    permission__can_add_user_profiles=True
).exists()

if can_add_users:
    obama_speech = "YES WE CAN"
    print(obama_speech)

Example 2:
Check if user can manage an account, like changing the data:

can_change_account = account.userprofilepermission_set.filter(
    user_profile__user=request.user,
    permission__can_change_accounts=True,
)

if not can_change_account:
    return HttpNotAllowed("piss off")

TODO: Create decorators to manage this easier!

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

account

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

account_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

department

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

department_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_global

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
permission

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

permission_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

user_profile

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

user_profile_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

Module contents
eggplant.profiles package
Submodules
eggplant.profiles.admin module
class eggplant.profiles.admin.UserProfileAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

media
eggplant.profiles.forms module
class eggplant.profiles.forms.NewUserSetPasswordForm(*args, **kwargs)[source]

Bases: allauth.account.forms.SetPasswordForm

base_fields = OrderedDict([('password1', <allauth.account.forms.SetPasswordField object>), ('password2', <allauth.account.forms.PasswordField object>)])
declared_fields = OrderedDict([('password1', <allauth.account.forms.SetPasswordField object>), ('password2', <allauth.account.forms.PasswordField object>)])
media
save(*args, **kwargs)[source]
class eggplant.profiles.forms.ProfileForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form

base_fields = OrderedDict([('first_name', <django.forms.fields.CharField object>), ('middle_name', <django.forms.fields.CharField object>), ('last_name', <django.forms.fields.CharField object>), ('address', <django.forms.fields.CharField object>), ('city', <django.forms.fields.CharField object>), ('postcode', <django.forms.fields.CharField object>), ('tel', <django.forms.fields.CharField object>), ('sex', <django.forms.fields.ChoiceField object>), ('photo', <django.forms.fields.ImageField object>)])
declared_fields = OrderedDict([('first_name', <django.forms.fields.CharField object>), ('middle_name', <django.forms.fields.CharField object>), ('last_name', <django.forms.fields.CharField object>), ('address', <django.forms.fields.CharField object>), ('city', <django.forms.fields.CharField object>), ('postcode', <django.forms.fields.CharField object>), ('tel', <django.forms.fields.CharField object>), ('sex', <django.forms.fields.ChoiceField object>), ('photo', <django.forms.fields.ImageField object>)])
media
class eggplant.profiles.forms.SignupForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: eggplant.profiles.forms.ProfileForm

base_fields = OrderedDict([('first_name', <django.forms.fields.CharField object>), ('middle_name', <django.forms.fields.CharField object>), ('last_name', <django.forms.fields.CharField object>), ('address', <django.forms.fields.CharField object>), ('city', <django.forms.fields.CharField object>), ('postcode', <django.forms.fields.CharField object>), ('tel', <django.forms.fields.CharField object>), ('sex', <django.forms.fields.ChoiceField object>), ('photo', <django.forms.fields.ImageField object>), ('email', <django.forms.fields.EmailField object>), ('password1', <allauth.account.forms.SetPasswordField object>), ('password2', <allauth.account.forms.PasswordField object>)])
clean_email()[source]

Check if user is already registered and if so raise validation error.

It may be considered a security hole to inform if a user is registered or not but it improves usability.

declared_fields = OrderedDict([('first_name', <django.forms.fields.CharField object>), ('middle_name', <django.forms.fields.CharField object>), ('last_name', <django.forms.fields.CharField object>), ('address', <django.forms.fields.CharField object>), ('city', <django.forms.fields.CharField object>), ('postcode', <django.forms.fields.CharField object>), ('tel', <django.forms.fields.CharField object>), ('sex', <django.forms.fields.ChoiceField object>), ('photo', <django.forms.fields.ImageField object>), ('email', <django.forms.fields.EmailField object>), ('password1', <allauth.account.forms.SetPasswordField object>), ('password2', <allauth.account.forms.PasswordField object>)])
media
eggplant.profiles.middleware module
class eggplant.profiles.middleware.NewUserForceProfileMiddleware[source]

Bases: object

process_request(request)[source]
eggplant.profiles.models module
class eggplant.profiles.models.UserProfile(id, user, middle_name, address, postcode, city, tel, tel2, sex, photo, created, changed)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

FEMALE = 'female'
MALE = 'male'
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

OTHER = 'other'
SEX_CHOICES = (('', '-----'), ('female', 'female'), ('male', 'male'), ('other', 'other'))
accounts

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

pizza.toppings and topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

active_accounts()[source]

Returns the active accounts.

address

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

administrator_for

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

can_be_edited_by(user_profile)[source]
changed

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

city

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

full_name

Returns member’s full name.

get_next_by_changed(*moreargs, **morekwargs)
get_next_by_created(*moreargs, **morekwargs)
get_previous_by_changed(*moreargs, **morekwargs)
get_previous_by_created(*moreargs, **morekwargs)
get_sex_display(*moreargs, **morekwargs)
has_admin_permission(department)[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

classmethod in_department(department, only_active_accounts=True)[source]

Returns the user profiles linked to the given department via: UserProfile -> Account -> DepartmentMembership -> Department

is_complete()[source]
middle_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
permissions

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

pizza.toppings and topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

photo

Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.

photo_url_or_default()[source]
postcode

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

sex

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

tel

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

tel2

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

user

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

user_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

userprofilepermission_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

eggplant.profiles.models.create_user_profile(*args, **kwargs)[source]

Every time a user is created, we automatically create a profile for the user.

eggplant.profiles.tests module
eggplant.profiles.urls module
eggplant.profiles.views module
class eggplant.profiles.views.NewUserPassword(**kwargs)[source]

Bases: eggplant.core.views.LoginRequiredMixin, allauth.account.views.PasswordSetView

Set password only for a new user. Existing users can use password change.

dispatch(*args, **kwargs)[source]

Overrides PasswordSetView.dispatch with the View.dispatch

form_class

alias of NewUserSetPasswordForm

form_valid(form)[source]
get(request, *args, **kwargs)[source]
get_authenticated_redirect_url(*args, **kwargs)[source]
get_success_url(*args, **kwargs)[source]
post(request, *args, **kwargs)[source]
success_url = <django.utils.functional.__proxy__ object>
class eggplant.profiles.views.Profile(**kwargs)[source]

Bases: eggplant.core.views.LoginRequiredMixin, django.views.generic.edit.FormView

Profile form view.

form_class

alias of ProfileForm

form_valid(form)[source]
get_initial()[source]
get_object(queryset=None)[source]
success_url = <django.utils.functional.__proxy__ object>
template_name = 'eggplant/profiles/profile_detail.html'
eggplant.profiles.views.signup(request)[source]
Module contents
eggplant.roles package
Subpackages
eggplant.roles.templatetags package
Submodules
eggplant.roles.templatetags.active_url module
eggplant.roles.templatetags.active_url.active(context, pattern_or_urlname)[source]
Module contents
Submodules
eggplant.roles.admin module
class eggplant.roles.admin.RoleAssignment(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

media
eggplant.roles.models module
class eggplant.roles.models.RoleAssignment(id, role, user)[source]

Bases: django.db.models.base.Model

ACCOUNTANT = 'accountant'
CASHIER = 'cashier'
COMMUNICATOR = 'communicator'
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

PACKER = 'packer'
PURCHASER = 'purchaser'
ROLE_CHOICES = (('purchaser', <django.utils.functional.__proxy__ object>), ('communicator', <django.utils.functional.__proxy__ object>), ('packer', <django.utils.functional.__proxy__ object>), ('cashier', <django.utils.functional.__proxy__ object>), ('accountant', <django.utils.functional.__proxy__ object>))
get_role_display(*moreargs, **morekwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
role

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

user

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

user_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

eggplant.roles.urls module
eggplant.roles.views module
eggplant.roles.views.accountant(request)[source]
eggplant.roles.views.cashier(request)[source]
eggplant.roles.views.communicator(request)[source]
eggplant.roles.views.packer(request)[source]
eggplant.roles.views.purchaser(request)[source]
eggplant.roles.views.role(request, role)[source]
Module contents

Submodules

eggplant.factories module

eggplant.urls module

Module contents

Eggplant is an open source food coop platform.

It allows buying and selling food products directly between farmers and consumers, cutting out the middle man, transportation, packaging etc.

Eggplant is good for the environment and good for you.

Eggplant

https://api.travis-ci.org/kbhff/eggplant.svg Documentation Status https://coveralls.io/repos/kbhff/eggplant/badge.svg?branch=master&service=github

Eggplant is an open source web application that provides simple and flexible infrastructure for organizing food coops and other local community-driven projects.

Get in touch

We use Slack for ad-hoc communication: Click to recieve an invitation. The techical discussion takes place on IRC #eggplant (Freenode) and Slack#teamblue (both rooms automatically forward to each other). The design and organisational issues can also be raised on Slack#teamgreen.

How to contribute

Read our documentation to get started reporting bugs, developing code etc. The project description, organization and goals are on our website eggplant.dk. The list of tickets is available on our GitHub project.

Write code, write tests, have fun.

Indices and tables