Creating a TumbleLog

3 views
Skip to first unread message

stranger

unread,
Aug 2, 2008, 12:49:30 PM8/2/08
to Django users
Hi,

I am trying to create a tumblelog like feature as per Ryan's
tutorial (http://ryanberg.net/blog/2008/jun/24/basics-creating-
tumblelog-django/).
In this tutorial a post_save signal is passed when every an entry is
creted for the model Bookmark, Freecoment & Status. So I followed it
all the same but,

1). I imported all the models into the signals.py file which has the
function 'create_stream_item'.
2). I need to import the function 'create_stream_item' into the
Bookmark, status model so that I can issue

dispatcher.connect(create_stream_item, signal=signals.post_save,
sender=modelname)

This situation is like a deadlock where I import 'create_stream_item'
into models and in signals.py which contain function
'create_stream_item' I import those models.

So i am getting an import error. Is there any way so that I can keep
this dispatcher code away from models.py and avoid the error.
Reply all
Reply to author
Forward
0 new messages