On Wed, Dec 16, 2009 at 9:32 AM, Joseph Wayodi <[email protected]> wrote:
> I've put my signal-registration code in my app's models.py, and my app is > the last one in the INSTALLED_APPS setting. > It shouldn't matter where in the list your app is placed. > I've done a bit of testing, and it appears that by the time I register my > listener function to receive the signal, it has already been sent, and I'm > therefore too late. It also appears that products.urls (from where the > signal is sent) is loaded in parallel with my app's models.py. I've tried > writing to standard output from different places in my models.py, and it > appears that I can catch the signal by going towards the top of the file. > That seems odd. Are you doing some sort of url reversing in your models? Usually, the urls aren't resolved in a Django app until the first time something needs to be looked up. If you are using urlresolvers.reverse, that would cause the urls to get loaded. > Am I wrong about how Satchmo and signals work? > No, that's the way it is normally used. There are a ton of examples in Satchmo, as it is the main way we add urls for optional apps. > I'm trying to use that signal to add a URL to /$SHOP_BASE/$PRODUCT_SLUG/ > without hard coding it too much. Is the signal meant for such stuff in the > first place? Or should I try something else? > You could probably just use the SHOP_URLS setting in your settings.py file, and skip the signal altogether. -- Bruce Kroeze http://www.ecomsmith.com It's time to hammer your site into shape. -- You received this message because you are subscribed to the Google Groups "Satchmo users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/satchmo-users?hl=en.
