Skip to content
Browse files

Merge branch 'master' of github.com:kachayev/gearoscope

  • Loading branch information...
2 parents be53c7c + bb6eaf9 commit 2fb42372c4b75ba93a0c8ffd59f8ad7e15a3671a @kachayev committed Jul 31, 2011
Showing with 6 additions and 3 deletions.
  1. +5 −2 gearoscope/apps/scoper/models.py
  2. +1 −1 gearoscope/templates/dashboard/partials/supervisords.html
View
7 gearoscope/apps/scoper/models.py
@@ -1,6 +1,7 @@
from django.db import models
from django.contrib import admin
from django.contrib.admin.sites import AlreadyRegistered
+import binascii
def register(model_handler, admin_handler):
'''Register handlers to admin site, ignoring already registered exception'''
@@ -87,7 +88,8 @@ def __unicode__(self):
'''Clean human-understanding string representation for gearman node'''
return '%s:%s' % (self.server.host, self.port)
- def crc_it(self):
+ @property
+ def crc(self):
return abs(binascii.crc32(self.__unicode__()))
class GearmanAdmin(admin.ModelAdmin):
@@ -117,7 +119,8 @@ def __unicode__(self):
'''Clean human-understanding string representation for supervisor daemon'''
return '%s:%s' % (self.server.host, self.port)
- def crc_it(self):
+ @property
+ def crc(self):
return abs(binascii.crc32(self.__unicode__()))
class SupervisorAdmin(admin.ModelAdmin):
View
2 gearoscope/templates/dashboard/partials/supervisords.html
@@ -4,7 +4,7 @@
<ul id="supervisords_list">
{% for supervisord in supervisords %}
- <li id="supervisord_{{ supervisord.crc_it }}">
+ <li id="supervisord_{{ supervisord.crc }}">
<a class="exp" href="#">+</a>
<ul class="logHistory collapsed">
<li>{{ supervisord }} - No messages found</li>

0 comments on commit 2fb4237

Please sign in to comment.
Something went wrong with that request. Please try again.