general: declare new URLs and actions via django.apps (#6979)

This commit is contained in:
Frédéric Péters 2015-04-18 14:27:02 +02:00
parent d292d1daf1
commit 9ed0808042
1 changed files with 7 additions and 0 deletions

View File

@ -14,6 +14,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import django.apps
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
@ -21,6 +22,10 @@ class Plugin(object):
def get_apps(self):
return [__name__]
class AppConfig(django.apps.AppConfig):
name = 'lingo'
def get_before_urls(self):
from . import urls
return urls.urlpatterns
@ -28,3 +33,5 @@ class Plugin(object):
def get_extra_manager_actions(self):
return [{'href': reverse('lingo-manager-homepage'),
'text': _('Online Payment')}]
default_app_config = 'lingo.AppConfig'