{ "info": { "author": "Thane Thomson", "author_email": "connect@thanethomson.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "django-likeable\n===============\n\nAdds \"liking\" functionality which aims to be scale-friendly\n(see `django-nonrel `_)\nby favouring abstract classes instead of direct class inheritance when\nfacilitating liking. Allows liking of any model registered with the\n``contenttypes`` framework.\n\nNote that this app is not yet tested at scale, but will be at some point in the\nnear future. In the meantime, it simply adds \"liking\" functionality to your models.\n\nQuick Installation\n------------------\n1. Add the ``django-likeable`` app to your Python path.\n2. Add ``likeable`` to your list of ``INSTALLED_APPS`` in your project settings.\n3. Create your likeable model:\n\n::\n\n from likeable import Likeable\n from django.contrib.auth.models import User\n\n class BlogEntry(Likeable):\n\n author = models.ForeignKey(User)\n content = models.TextField()\n created = models.DateTimeField(auto_now_add=True)\n\n class BlogEntryComment(Likeable):\n \n entry = models.ForeignKey(BlogEntry)\n author = models.ForeignKey(User)\n content = models.TextField()\n created = models.DateTimeField(auto_now_add=True)\n\nLiking Content Manually\n-----------------------\nYou can use the provided ``Likeable.like`` function to automatically like a particular\nobject by a given user, such as:\n\n::\n\n from likeable import Like\n from models import BlogEntry, BlogEntryComment\n from django.contrib.auth.models import User\n\n ...\n\n # harry posts a blog entry\n harry = User.objects.create(username='harry')\n blog_entry = BlogEntry.objects.create(author=harry, content=\"This is my first post.\")\n\n ...\n\n # sally likes the blog entry\n sally = User.objects.create(username='sally')\n blog_entry.like(sally)\n\nLiking Content Via Provided Views\n---------------------------------\nMake sure your project's ``urls.py`` file looks something like this:\n\n::\n\n from django.conf.urls.defaults import patterns, include, url\n\n urlpatterns = patterns('',\n\n # ...\n\n # add django-likeable's urls\n url(r'^like/', include('likeable.urls')),\n\n # ...\n )\n\n**Enabled URLs**\n\n``like//``\n\nAuto-detects whether a request comes in via\na plain GET request or an AJAX request, and handles it according to the following two\nviews.\n\n``like/noajax//``\n\nAttempts to like the object whose\ncontent type ID is ```` and primary key is ```` (both\npositive integers). This function automatically attempts to redirect the user to the\nreferring URL after liking the given object. If no object matching the given criteria is\nfound, an HTTP 404 error will be generated.\n\n``like/ajax//``\n\nAttempts to like the object whose\ncontent type ID is ```` and primary key is ```` (both\npositive integers). This function returns a JSON object of the format\n``{'success': true}`` upon success. If no object matching the given criteria is\nfound, an HTTP 404 error will be generated.\n\nOther Batteries Included\n------------------------\n\n``likeable.views.get_like_view_params(obj)``\n\n``obj`` must be any object registered with the ``contenttypes`` framework.\nOn success, this shortcut function will return a tuple containing first the\ncontent type ID primary key as well as the object's primary key, which can\nthen simply be passed to one of the ``django-likeable`` views.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/thanethomson/django-likeable", "keywords": null, "license": "Apache Software License", "maintainer": null, "maintainer_email": null, "name": "django-likeable", "package_url": "https://pypi.org/project/django-likeable/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-likeable/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/thanethomson/django-likeable" }, "release_url": "https://pypi.org/project/django-likeable/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "Simple Django app to facilitate \"liking\" of any content type.", "version": "0.0.1" }, "last_serial": 329128, "releases": { "0.0.1": [] }, "urls": [] }