1 2 3 4 5 6 7 8 9 10 11 12 | import twitter
from django.db.models.signals import post_save
def tweetit(sender,**kwargs):
"""
extract relevant info and tweet it
"""
if kwargs['created']:
t = twitter.Api(settings.TWITTER_USER, settings.TWITTER_PASSWORD)
t.PostUpdate("%s has registered as a delegate" %(kwargs['instance']))
post_save.connect(tweetit, sender=Delegate)
|
More like this
- Twitter status tag by gmacgregor 5 years, 3 months ago
- Changing field type in production by lawgon 6 years, 1 month ago
- Twitter template tags and filters by moxypark 2 years, 8 months ago
- Autogenerate admin classes in admin.py by dodgyville 4 years, 9 months ago
- Template tag: Last x twitter msgs of user by coulix 3 years, 10 months ago
Comments