Thanks, Tom,

I'm not sure I need to use signals altogether, as I know when a Song is added. If I make a method in the Song model, I suppose I can import the model and run it in the shell? Or is there a way I could run it directly from the admin site?

Hélène




On 21/05/2014 17:15, Tom Lockhart wrote:
On 2014-05-20, at 12:26 PM, "C. Kirby" <mist...@gmail.com <mailto:mist...@gmail.com>> wrote:

I would strongly suggest you use signals <https://docs.djangoproject.com/en/1.7/topics/signals/>.

This nicely enables an automatic path of execution. But if you also want to execute this code, say, from the admin interface or separately for testing then you may want to package the fundamental code into a method of the Song model, then run that method in the signal handler.

hth

                        - Tom


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/537CD10A.9070307%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to