damned-lies r1135 - in branches/djamnedlies: . people stats teams templates



Author: stephaner
Date: Fri Nov  7 14:00:52 2008
New Revision: 1135
URL: http://svn.gnome.org/viewvc/damned-lies?rev=1135&view=rev

Log:
2008-11-07  StÃphane Raimbault  <stephane raimbault gmail com>

	* TODO: Removed item.
	* people/models.py: Removed old functions and added comments
	* stats/models.py: Added new related name maintains_modules.
	* teams/models.py: Renamed coordinates to coordinates_teams.
	* templates/person_base.html: Use new relations.


Modified:
   branches/djamnedlies/ChangeLog
   branches/djamnedlies/TODO
   branches/djamnedlies/people/models.py
   branches/djamnedlies/stats/models.py
   branches/djamnedlies/teams/models.py
   branches/djamnedlies/templates/person_base.html

Modified: branches/djamnedlies/TODO
==============================================================================
--- branches/djamnedlies/TODO	(original)
+++ branches/djamnedlies/TODO	Fri Nov  7 14:00:52 2008
@@ -1,4 +1,3 @@
 Things left to do:
  * i18n (translation for strings in database?)
  * Still a webroot in stats_show.html
- * Replace maintains and translates by the relation names
\ No newline at end of file

Modified: branches/djamnedlies/people/models.py
==============================================================================
--- branches/djamnedlies/people/models.py	(original)
+++ branches/djamnedlies/people/models.py	Fri Nov  7 14:00:52 2008
@@ -36,9 +36,6 @@
     def get_absolute_url(self):
         return ('person', [str(self.id)])
 
-    def maintains(self):
-        return self.module_set.all()
-
-    def translates(self): 	 
-        # FIXME The term 'translates' is confusing (see TODO)
-        return self.coordinates.all()
+    # Related names
+    # - module: maintains_modules
+    # - team: coordinates_teams

Modified: branches/djamnedlies/stats/models.py
==============================================================================
--- branches/djamnedlies/stats/models.py	(original)
+++ branches/djamnedlies/stats/models.py	Fri Nov  7 14:00:52 2008
@@ -29,7 +29,7 @@
 
 from people.models import Person
 from languages.models import Language
-    
+
 VCS_TYPE_CHOICES = (
     ('cvs', 'CVS'), 
     ('svn', 'Subversion'), 
@@ -50,7 +50,8 @@
     vcs_root = models.URLField()
     vcs_web = models.URLField()
     
-    maintainers = models.ManyToManyField(Person, db_table='module_maintainer')
+    maintainers = models.ManyToManyField(Person, db_table='module_maintainer',
+        related_name='maintains_modules')
 
     class Meta:
         db_table = 'module'

Modified: branches/djamnedlies/teams/models.py
==============================================================================
--- branches/djamnedlies/teams/models.py	(original)
+++ branches/djamnedlies/teams/models.py	Fri Nov  7 14:00:52 2008
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 #
-# Copyright (c) 2008 StÃphane Railmbault <stephane raimbault gmail com>.
+# Copyright (c) 2008 StÃphane Raimbault <stephane raimbault gmail com>.
 #
 # This file is part of Damned Lies.
 #
@@ -28,7 +28,7 @@
 
     description = models.TextField()
     # Don't confuse this relation with the 'groups' one
-    coordinator = models.ForeignKey(Person, related_name='coordinates')
+    coordinator = models.ForeignKey(Person, related_name='coordinates_teams')
     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)

Modified: branches/djamnedlies/templates/person_base.html
==============================================================================
--- branches/djamnedlies/templates/person_base.html	(original)
+++ branches/djamnedlies/templates/person_base.html	Fri Nov  7 14:00:52 2008
@@ -36,19 +36,19 @@
   {% endif %}
 
   {% if printroles %}
-      {% if person.maintains %}
+      {% if person.maintains_modules.all %}
       <h2>{% trans "Maintains:" %}</h2>
       <ul>
-        {% for module in person.maintains %}
+        {% for module in person.maintains_modules.all %}
         <li><a href="{{ module.get_absolute_url }} ">{{ module.description }}</a></li>
         {% endfor %}
       </ul>
       {% endif %}
 
-      {% if person.translates %}
-      <h2>{% trans "Translates:" %}</h2>
+      {% if person.coordinates_teams.all %}
+      <h2>{% trans "Coordinates:" %}</h2>
       <ul>
-        {% for team in person.translates %}
+        {% for team in person.coordinates_teams.all %}
           <li>
             {% blocktrans with team.get_absolute_url as team_url and team.description as team_desc %}
             Coordinates <a href="{{ team_url }}">{{ team_desc }}</a>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]