Skip to main content

descriptive relationships between auth.User

Project description

Descriptive relationships between auth.users:

In [4]: john.relationships.friends()
Out[4]: [<User: Yoko>]

In [5]: john.relationships.following()
Out[5]: [<User: Paul>, <User: Yoko>]

In [6]: john.relationships.followers()
Out[6]: [<User: Yoko>]

In [7]: john.relationships.blockers()
Out[7]: [<User: Paul>]

In [8]: paul.relationships.blocking()
Out[8]: [<User: John>]

You can create as many types of relationships as you like, or just use the default ones, ‘following’ and ‘blocking’.

From, To and Symmetrical

Relationship types define each of the following cases:

  • from - ‘following’, who I am following

  • to - ‘followers’, who is following me

  • symmetrical - ‘friends’, we follow eachother

Relationship types can be login_required, or private, and if you want to make a relationship type unviewable (i.e. you may not want to allow users to see who is blocking them), simply give it a unmatchable slug, like ‘!blockers’.

Admin Interface

Relationships hook right into the pre-existing User admin, and appear below the ‘Groups’ inline.

Installation

python setup.py install

OR

put the relationships folder on your python-path

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-relationships-0.2.1.tar.gz (17.5 kB view details)

Uploaded Source

File details

Details for the file django-relationships-0.2.1.tar.gz.

File metadata

File hashes

Hashes for django-relationships-0.2.1.tar.gz
Algorithm Hash digest
SHA256 9c70401ac270d5744c0a4af4e95c1da0ea20ca91f688a0ff4493c14f6feed070
MD5 fc060c5780b30c0baafca953c4afcb92
BLAKE2b-256 2b8426039d287a8a4f5bb32fa3d18541ef806860005b652326b4e2d9437b6f71

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page