Browse Source

add get_absolute_url method to the Mumble model to enable "view on site" buttonés in the admin

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
ae63d7abb2
  1. 5
      pyweb/mumble/models.py

5
pyweb/mumble/models.py

@ -221,6 +221,11 @@ class Mumble( models.Model ):
bonjour = mk_config_bool_property( "bonjour", ugettext_noop("Publish this server via Bonjour") ) bonjour = mk_config_bool_property( "bonjour", ugettext_noop("Publish this server via Bonjour") )
autoboot= mk_config_bool_property( "boot", ugettext_noop("Boot Server when Murmur starts") ) autoboot= mk_config_bool_property( "boot", ugettext_noop("Boot Server when Murmur starts") )
def get_absolute_url( self ):
from views import show
from django.core.urlresolvers import reverse
return reverse( show, kwargs={ 'server': self.id } )
def getBooted( self ): def getBooted( self ):
if self.id is not None: if self.id is not None:
if self.server.online: if self.server.online:

Loading…
Cancel
Save