You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

application.py 628B

12345678910111213141516171819202122
  1. from django.conf.urls.defaults import patterns
  2. class Application(object):
  3. name = None
  4. def __init__(self, app_name=None, **kwargs):
  5. self.app_name = app_name
  6. # Set all kwargs as object attributes
  7. for key, value in kwargs.iteritems():
  8. setattr(self, key, value)
  9. def get_urls(self):
  10. """
  11. Return the url patterns for this app, MUST be implemented in the subclass
  12. """
  13. return patterns('')
  14. @property
  15. def urls(self):
  16. # We set the application and instance namespace here
  17. return self.get_urls(), self.app_name, self.name