Package: django-ar-organizations
django-ar-organizations====================.. image:: https://travis-ci.org/arteria/django-ar-organizations.svg?branch=master:target: https://travis-ci.org/arteria/django-ar-organizations.. image:: https://coveralls.io/repos/github/arteria/django-ar-organizations/badge.svg?branch=master:target: https://coveralls.io/github/arteria/django-ar-organizations?branch=master.. image:: https://img.shields.io/pypi/v/django-ar-organizations.svg:target: https://pypi.python.org/pypi/django-ar-organizations)This package is an adopted and adapted version of django-organizations (https://github.com/bennylope/django-organizations)!Add user-managed, multi-user groups to your Django project. Usedjango-organizations whether your site needs organizations that function likesocial groups or multi-user account objects to provide account and subscriptionfunctionality beyond the individual user.* Relies on `django.contrib.auth` and does not add or require additional useror authentication functionality* Users can be belong to and own more than one organization (account, group)* Invitation and registration functionality is designed to be flexible to allowyou to integrate existing invitation and registration appsDocumentation is on `Read the Docs<http://django-organizations.readthedocs.org/en/latest/index.html>`_Installing==========First add the application to your Python path. The easiest way is to use`pip`::pip install django-ar-organizationsYou should install by downloading the source and running::$ python setup.py installMigrating to 0.2.10 manually----------------------------Update the database::ALTER TABLE `organizations_organization` add   `custom_data` longtext NOT NULL after is_active;ALTER TABLE `organizations_organization` add   `custom_settings` longtext NOT NULL after custom_data;and set an empty dictionary as default value::update organizations_organization  set custom_settings='{}', custom_data='{}' where id > 0 ;Configuring-----------Make sure you have `django.contrib.auth` installed, and add the `organizations`application to your `INSTALLED_APPS` list::INSTALLED_APPS = (...'django.contrib.auth','organizations',)Then ensure that your project URL conf is updated. You should hook in themain application URL conf as well as your chosen invitation backend URLs::from organizations.backends import invitation_backendurlpatterns = patterns('',...url(r'^accounts/', include('organizations.urls')),url(r'^invitations/', include(invitation_backend().get_urls())),)Add `organizations.middleware.OrganizationsMiddleware` to the `MIDDLEWARE_CLASSES` this middleware stores the current Organization in ther session.::MIDDLEWARE_CLASSES = (...'organizations.middleware.OrganizationsMiddleware',...)You can specify a different invitation backend in your project settings, andthe `invitation_backend` function will provide the URLs defined by thatbackend::ORGS_INVITATION_BACKEND = 'myapp.backends.MyInvitationBackend'There is also a lightly tested way to use your own user model, rather than thedefault `auth.User` model. Set the `AUTH_USER_MODEL` setting to the dottedmodel name of your custom user model, following the procedure in Django 1.5::AUTH_USER_MODEL = 'myuserapp.MyUser'**This is still experimental and your user model's API should hew close to thatof the `auth.User` class.**Usage Overview==============For most use cases it should be sufficient to include the app views directlyusing the default URL conf file. You can customize their functionality oraccess controls by extending the base views.There are three models:* **Organization** The group object. This is what you would associate your ownapp's functionality with, e.g. subscriptions, repositories, projects, etc.* **OrganizationUser** A custom `through` model for the ManyToMany relationshipbetween the `Organization` model and the `User` model. It stores additionalinformation about the user specific to the organization and provides aconvenient link for organization ownership.* **OrganizationOwner** The user with rights over the life and death of theorganization. This is a one to one relationship with the `OrganizationUser`model. This allows `User` objects to own multiple organizations and makes iteasy to enforce ownership from within the organization's membership.The underlying organizations API is simple::>>> from compat import get_user_model>>> from organizations.utils import create_organization>>>>>> User = get_user_model()>>> chris = User.objects.create(username="chris")>>> soundgarden = create_organization(chris, "Soundgarden", "soundgarden")>>> soundgarden.is_member(chris)True>>> soundgarden.is_admin(chris)True>>> soundgarden.owner.organization_user<OrganizationUser: Chris Cornell>>>> soundgarden.owner.organization_user.user<User: chris>>>> audioslave = create_organization(chris, "Audioslave", "audioslave")>>> tom = User.objects.create(username="tom")>>> audioslave.add_user(tom, is_admin=True)<OrganizationUser: Tom Morello>Overview--------Each organization can have only one owner, however a site user can be a memberof multiple organizations, or own multiple organizations. The OrganizationUsermodel servers as an intermediary between the `Organization` and the `Users` toallow this.Development & Contributing==========================Development is on-going. To-do items have been moved to the wiki for the timebeing.The basic functionality should not need much extending. Current dev prioritiesfor me and contributors should include:* Improving the tests and test coverage (ideally moving them back out of themain module and executable using the setup.py file)* Improving the backends and backends concept so that additional invitation andregistration backends can be used* Documentation* Ensuring all application text is translatable* Python 3 readiness* Configurable user model (a la Django 1.5's anticipated auth.User rewrite)Please use the project's issues tracker to report bugs, doc updates, or otherrequests/suggestions.Targets-------The codebase is targeted at tested against:* Django 1.4.x against Python 2.6 and Python 2.7* Django 1.5.x against Python 2.6, Python 2.7, and Python 3.3* Django 1.6.x against Python 2.7 and Python 3.3* Django 1.7Submitting----------These submission guidelines will make it more likely your submissions will bereviewed and make it into the project:* Ensure they match the project goals and are sufficiently generalized* Please try to follow `Django coding style<https://docs.djangoproject.com/en/1.4/internals/contributing/writing-code/coding-style/>`_.The code base style isn't all up to par, but I'd like it to move in thatdirection* Also please try to include `good commit log messages<http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html>`_.* Pull requests should include a quantity amount of code and commits that arereasonable to review, are logically grouped, and based off clean featurebranches.Code contributions are expected to pass in all three target environments, andpull requests should be made from branches with passing builds.Project goals-------------django-organizations should be backend agnostic:1. Authentication agnostic2. Registration agnostic3. Invitation agnostic4. User messaging agnosticEtc.License=======Anyone is free to use or modify this software under the terms of the BSDlicense.Specific settings=================* ``AR_FALLBACK_ORG_SLUG`` - allow to define a fallback organization for anonymous users* ``AR_CRM_MULTI_CLIENT`` - arteria internalQ&A===Q: Gettting a ``SimpleLazyObject`` error----------------------------------------TypeError at /dummy/int() argument must be a string or a number, not 'SimpleLazyObject'A:--Did you specify ``AR_FALLBACK_ORG_SLUG`` in your project settings?