damned-lies r1142 - in branches/djamnedlies: . stats teams
- From: claudep svn gnome org
- To: svn-commits-list gnome org
- Subject: damned-lies r1142 - in branches/djamnedlies: . stats teams
- Date: Sat, 8 Nov 2008 14:07:47 +0000 (UTC)
Author: claudep
Date: Sat Nov 8 14:07:47 2008
New Revision: 1142
URL: http://svn.gnome.org/viewvc/damned-lies?rev=1142&view=rev
Log:
2008-11-08 Claude Paroz <claude 2xlibre net>
* stats/admin.py: Add Domain class to admin UI, and domain inline in
Moudle admin.
* teams/urls.py: Priority to slug URL.
Modified:
branches/djamnedlies/ChangeLog
branches/djamnedlies/stats/admin.py
branches/djamnedlies/teams/urls.py
Modified: branches/djamnedlies/stats/admin.py
==============================================================================
--- branches/djamnedlies/stats/admin.py (original)
+++ branches/djamnedlies/stats/admin.py Sat Nov 8 14:07:47 2008
@@ -19,11 +19,19 @@
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from django.contrib import admin
-from stats.models import Statistics, Module, Branch, Category, Release
+from stats.models import Statistics, Module, Branch, Domain, Category, Release
class BranchInline(admin.TabularInline):
model = Branch
+class DomainInline(admin.TabularInline):
+ model = Domain
+ def formfield_for_dbfield(self, db_field, **kwargs):
+ field = super(DomainInline, self).formfield_for_dbfield(db_field, **kwargs)
+ if db_field.name == 'description':
+ field.widget.attrs['rows'] = '1'
+ return field
+
class ModuleAdmin(admin.ModelAdmin):
fieldsets = (
(None, {
@@ -34,7 +42,7 @@
'maintainers')
}),
)
- inlines = [ BranchInline, ]
+ inlines = [ BranchInline, DomainInline ]
search_fields = ('name',)
def formfield_for_dbfield(self, db_field, **kwargs):
@@ -49,6 +57,9 @@
class BranchAdmin(admin.ModelAdmin):
search_fields = ('name', 'module__name')
+class DomainAdmin(admin.ModelAdmin):
+ pass
+
class CategoryAdmin(admin.ModelAdmin):
search_fields = ('category', 'branch__module__name')
@@ -60,6 +71,7 @@
admin.site.register(Statistics, StatisticsAdmin)
admin.site.register(Branch, BranchAdmin)
+admin.site.register(Domain, DomainAdmin)
admin.site.register(Category, CategoryAdmin)
admin.site.register(Module, ModuleAdmin)
admin.site.register(Release, ReleaseAdmin)
Modified: branches/djamnedlies/teams/urls.py
==============================================================================
--- branches/djamnedlies/teams/urls.py (original)
+++ branches/djamnedlies/teams/urls.py Sat Nov 8 14:07:47 2008
@@ -12,7 +12,7 @@
urlpatterns = patterns('',
url(r'^$', 'teams.views.teams', name='teams'),
- url(r'(?P<object_id>\d+)', 'django.views.generic.list_detail.object_detail', dict(info_dict), 'team'),
#url(r'(?P<slug>\w+)', 'django.views.generic.list_detail.object_detail', dict(info_dict), 'team_slug'),
url(r'(?P<team_slug>[\w\- ]+)', 'teams.views.team', name='team_slug'),
+ url(r'(?P<object_id>\d+)', 'django.views.generic.list_detail.object_detail', dict(info_dict), 'team'),
)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]