This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Facebook-like mentions for Django

Project Description
=======
django-mentions
=======

Facebook-like mentions for Django
-----------------------------------------------------

Installation
""""""""""""
Add aplication to INSTALLED_APPS in **settings.py**:
::

INSTALLED_APPS = (
...,
'mentions',
)

Add app urls to your **urls.py**:
::

urlpatterns = patterns('',
...
url(r'^mentions/', include('mentions.urls')),
)

Implement a mention provider:
::

from mentions.providers import Provider

class UserProvider(Provider):
model = User

def get_title(self, obj):
return obj.username

def search(self, request, term):
return self.get_queryset().filter(username__istartswith=term)

Add this provider to your **settings.py**:
::
MENTIONS_PROVIDERS = {
# You can put your provider anywhere you want
'default': [
'accounts.mentions.UserProvider'
]
}

Use `mentions.forms.MentionTextarea` widget instead of the default one:
::
from mentions.forms import MentionTextarea

class PostForm(forms.ModelForm):
class Meta:
model = Post
widgets = {
'text': MentionTextarea
}

To urlize mentions in your templates, use `urlize_mentions` filter:
::
{{ post.text|urlize_mentions }}
Release History

Release History

This version
History Node

0.2

History Node

0.1.10

History Node

0.1.9

History Node

0.1.8

History Node

0.1.7

History Node

0.1.5

History Node

0.1.4

History Node

0.1.3

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-mentions-0.2.tar.gz (15.2 kB) Copy SHA256 Checksum SHA256 Source Dec 30, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting