Where to add Python functions for scheduled tasks

I am following the Developer Guide tutorial and am at the last section (8. Tasks). The tutorial says how to add a task handler in hooks.py for the library_management application, but it also shows the Python code for the scheduled task without mentioning where this function should be placed.

Where should the function shown in the tutorial be placed?

Thanks,
Chris



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/2f9cc7e7-6524-4949-8d52-bdd565e54f25%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Could be anywhere you like as long as it is accessible as a Python module. The route is defined in hooks.py

In this case, the function "library_management.tasks.daily" would be in libarary_management/tasks.py



On 12-Jun-2014, at 11:31 pm, Chris Horton <ch...@thedrainage.com> wrote:

I am following the Developer Guide tutorial and am at the last section (8. Tasks). The tutorial says how to add a task handler in hooks.py for the library_management application, but it also shows the Python code for the scheduled task without mentioning where this function should be placed.

Where should the function shown in the tutorial be placed?

Thanks,
Chris



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/2f9cc7e7-6524-4949-8d52-bdd565e54f25%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/895E76B6-4A84-484B-A28A-1AAB60F3052E%40gmail.com.

    For more options, visit https://groups.google.com/d/optout.
That's what I initially thought, but I just wanted to make sure. Thanks for the help!

On Thursday, June 12, 2014 2:07:04 PM UTC-4, rushabh wrote:
Could be anywhere you like as long as it is accessible as a Python module. The route is defined in hooks.py

In this case, the function "library_management.tasks.daily" would be in libarary_management/tasks.py



On 12-Jun-2014, at 11:31 pm, Chris Horton <ch...@thedrainage.com> wrote:

I am following the Developer Guide tutorial and am at the last section (8. Tasks). The tutorial says how to add a task handler in hooks.py for the library_management application, but it also shows the Python code for the scheduled task without mentioning where this function should be placed.

Where should the function shown in the tutorial be placed?

Thanks,
Chris



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/2f9cc7e7-6524-4949-8d52-bdd565e54f25%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/5d30cc3c-4290-471f-849e-e85883a691cc%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.