damned-lies r1132 - in branches/djamnedlies: . languages people stats stats/management/commands teams
- From: claudep svn gnome org
- To: svn-commits-list gnome org
- Subject: damned-lies r1132 - in branches/djamnedlies: . languages people stats stats/management/commands teams
- Date: Thu, 6 Nov 2008 10:39:23 +0000 (UTC)
Author: claudep
Date: Thu Nov 6 10:39:23 2008
New Revision: 1132
URL: http://svn.gnome.org/viewvc/damned-lies?rev=1132&view=rev
Log:
2008-11-06 Claude Paroz <claude 2xlibre net>
* languages/models.py:
* people/models.py:
* stats/models.py:
* teams/models.py: Add some more default values.
* stats/admin.py: Improve module admin form.
* stats/management/commands/update-trans.py: Update field name from
category table.
Modified:
branches/djamnedlies/ChangeLog
branches/djamnedlies/languages/models.py
branches/djamnedlies/people/models.py
branches/djamnedlies/stats/admin.py
branches/djamnedlies/stats/management/commands/update-trans.py
branches/djamnedlies/stats/models.py
branches/djamnedlies/teams/models.py
Modified: branches/djamnedlies/languages/models.py
==============================================================================
--- branches/djamnedlies/languages/models.py (original)
+++ branches/djamnedlies/languages/models.py Thu Nov 6 10:39:23 2008
@@ -4,7 +4,7 @@
class Language(models.Model):
name = models.CharField(max_length=50, unique=True)
locale = models.CharField(max_length=15, unique=True)
- team = models.ForeignKey(Team, null=True)
+ team = models.ForeignKey(Team, null=True, default=None)
class Meta:
db_table = 'language'
Modified: branches/djamnedlies/people/models.py
==============================================================================
--- branches/djamnedlies/people/models.py (original)
+++ branches/djamnedlies/people/models.py Thu Nov 6 10:39:23 2008
@@ -11,13 +11,13 @@
# Deprecated - This field will be removed after the first
# production deployment
- _old_id = models.CharField(max_length=50)
+ _old_id = models.CharField(max_length=50, default=None)
- svn_account = models.SlugField(max_length=20, null=True)
- image = models.URLField(null=True)
- webpage_url = models.URLField(null=True)
- irc_nick = models.SlugField(max_length=20, null=True)
- bugzilla_account = models.SlugField(null=True)
+ svn_account = models.SlugField(max_length=20, null=True, default=None)
+ image = models.URLField(null=True, default=None)
+ webpage_url = models.URLField(null=True, default=None)
+ irc_nick = models.SlugField(max_length=20, null=True, default=None)
+ bugzilla_account = models.SlugField(null=True, default=None)
class Meta:
db_table = 'person'
Modified: branches/djamnedlies/stats/admin.py
==============================================================================
--- branches/djamnedlies/stats/admin.py (original)
+++ branches/djamnedlies/stats/admin.py Thu Nov 6 10:39:23 2008
@@ -19,13 +19,36 @@
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from django.contrib import admin
+from django import forms
from stats.models import Statistics, Module, Branch, Category, Release
class ReleaseAdmin(admin.ModelAdmin):
list_display = ('name', 'status', 'stringfrozen')
+class ModuleForm(forms.ModelForm):
+ description = forms.CharField(max_length=40, widget=forms.TextInput())
+
+ class Meta:
+ model = Module
+
+class BranchInline(admin.TabularInline):
+ model = Branch
+
+class ModuleAdmin(admin.ModelAdmin):
+ #form = ModuleForm
+ fieldsets = (
+ (None, {
+ 'fields': (('name','description'),
+ 'homepage', 'comment',
+ ('bugs_base', 'bugs_product', 'bugs_component'),
+ ('vcs_type', 'vcs_root', 'vcs_web'),
+ 'maintainers')
+ }),
+ )
+ inlines = [ BranchInline, ]
+
admin.site.register(Statistics)
-admin.site.register(Module)
+admin.site.register(Module, ModuleAdmin)
admin.site.register(Branch)
admin.site.register(Category)
admin.site.register(Release, ReleaseAdmin)
Modified: branches/djamnedlies/stats/management/commands/update-trans.py
==============================================================================
--- branches/djamnedlies/stats/management/commands/update-trans.py (original)
+++ branches/djamnedlies/stats/management/commands/update-trans.py Thu Nov 6 10:39:23 2008
@@ -37,7 +37,7 @@
SELECT name from `language` UNION DISTINCT
SELECT description FROM domain UNION DISTINCT
SELECT description FROM module UNION DISTINCT
- SELECT description FROM category UNION DISTINCT
+ SELECT category FROM category UNION DISTINCT
SELECT name from `release`;"""
cursor = connection.cursor()
cursor.execute(query)
Modified: branches/djamnedlies/stats/models.py
==============================================================================
--- branches/djamnedlies/stats/models.py (original)
+++ branches/djamnedlies/stats/models.py Thu Nov 6 10:39:23 2008
@@ -40,9 +40,9 @@
class Module(models.Model):
name = models.CharField(max_length=50)
- homepage = models.URLField(null=True)
- description = models.TextField(null=True)
- comment = models.TextField(null=True)
+ homepage = models.URLField(null=True, default=None)
+ description = models.TextField(null=True, default=None)
+ comment = models.TextField(null=True, default=None)
bugs_base = models.CharField(max_length=50)
bugs_product = models.CharField(max_length=50)
bugs_component = models.CharField(max_length=50)
@@ -59,6 +59,10 @@
def __unicode__(self):
return self.name
+ @models.permalink
+ def get_absolute_url(self):
+ return ('stats.views.module', [self.name])
+
def get_bugs_i18n_url(self):
if self.bugs_base.find("bugzilla") != -1 or self.bugs_base.find("freedesktop") != -1:
return "%sbuglist.cgi?product=%s&component=%s&keywords_type=anywords&keywords=I18N+L10N&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=NEEDINFO" % (self.bugs_base, self.bugs_product, self.bugs_component)
@@ -89,7 +93,7 @@
""" Branch of a module """
name = models.CharField(max_length=50)
#description = models.TextField(null=True)
- vcs_subpath = models.CharField(max_length=50, null=True)
+ vcs_subpath = models.CharField(max_length=50, null=True, default=None)
module = models.ForeignKey(Module)
# 'releases' is the backward relation name from Release model
@@ -414,8 +418,8 @@
class Domain(models.Model):
module = models.ForeignKey(Module)
name = models.CharField(max_length=50)
- description = models.TextField(null=True)
- dtype = models.CharField(max_length=5, choices=DOMAIN_TYPE_CHOICES)
+ description = models.TextField(null=True, default=None)
+ dtype = models.CharField(max_length=5, choices=DOMAIN_TYPE_CHOICES, default='ui')
directory = models.CharField(max_length=50)
class Meta:
@@ -437,7 +441,7 @@
)
class Release(models.Model):
name = models.CharField(max_length=50)
- stringfrozen = models.BooleanField()
+ stringfrozen = models.BooleanField(default=False)
status = models.CharField(max_length=12, choices=RELEASE_STATUS_CHOICES)
branches = models.ManyToManyField(Branch, through='Category', related_name='releases')
Modified: branches/djamnedlies/teams/models.py
==============================================================================
--- branches/djamnedlies/teams/models.py (original)
+++ branches/djamnedlies/teams/models.py Thu Nov 6 10:39:23 2008
@@ -29,9 +29,9 @@
description = models.TextField()
# Don't confuse this relation with the 'groups' one
coordinator = models.ForeignKey(Person, related_name='coordinates')
- webpage_url = models.URLField(null=True)
- mailing_list = models.URLField(null=True)
- mailing_list_subscribe = models.URLField(null=True)
+ webpage_url = models.URLField(null=True, default=None)
+ mailing_list = models.URLField(null=True, default=None)
+ mailing_list_subscribe = models.URLField(null=True, default=None)
class Meta:
db_table = 'team'
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]