Thomas Bechtold has proposed merging lp:~toabctl/loco-directory/fix-570619 into 
lp:loco-directory.

Requested reviews:
  loco-directory-dev (loco-directory-dev)
Related bugs:
  #570619 Categorise Teams
  https://bugs.launchpad.net/bugs/570619

-- 
https://code.launchpad.net/~toabctl/loco-directory/fix-570619/+merge/24763
Your team loco-directory-dev is requested to review the proposed merge of 
lp:~toabctl/loco-directory/fix-570619 into lp:loco-directory.
=== added file 'loco_directory/teams/migrations/0003_add_continent_field.py'
--- loco_directory/teams/migrations/0003_add_continent_field.py	1970-01-01 00:00:00 +0000
+++ loco_directory/teams/migrations/0003_add_continent_field.py	2010-05-05 18:05:38 +0000
@@ -0,0 +1,52 @@
+
+from south.db import db
+from django.db import models
+from teams.models import *
+
+class Migration:
+    
+    def forwards(self, orm):
+        
+        # Adding field 'Team.continent'
+        db.add_column('teams', 'continent', orm['teams.team:continent'])
+        
+    
+    
+    def backwards(self, orm):
+        
+        # Deleting field 'Team.continent'
+        db.delete_column('teams', 'continent')
+        
+    
+    
+    models = {
+        'teams.team': {
+            'Meta': {'db_table': "'teams'"},
+            'admins': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.TeamAdministrator']"}),
+            'approved': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+            'approved_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+            'city': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
+            'continent': ('django.db.models.fields.CharField', [], {'default': "'Unknown'", 'max_length': '60', 'db_index': 'True'}),
+            'country': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
+            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
+            'expires_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+            'forum_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'irc_chan': ('django.db.models.fields.CharField', [], {'max_length': '25', 'null': 'True', 'blank': 'True'}),
+            'lp_name': ('django.db.models.fields.SlugField', [], {'max_length': '40', 'null': 'True', 'db_index': 'True'}),
+            'ml_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
+            'mugshot_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'null': 'True'}),
+            'owner': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'null': 'True', 'db_index': 'True'}),
+            'provides_support': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+            'spr': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
+            'web_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
+            'wiki_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'})
+        },
+        'teams.teamadministrator': {
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'lpid': ('django.db.models.fields.SlugField', [], {'max_length': '40', 'db_index': 'True'})
+        }
+    }
+    
+    complete_apps = ['teams']

=== modified file 'loco_directory/teams/models.py'
--- loco_directory/teams/models.py	2010-01-18 14:41:22 +0000
+++ loco_directory/teams/models.py	2010-05-05 18:05:38 +0000
@@ -9,6 +9,18 @@
     def __unicode__(self):
        return u'%s' % (self.lpid)
 
+CONTINENT_CHOICES = (
+        ('NorthAmerica', _('North America')),
+        ('SouthAmerica', _('South America')),
+        ('Africa', _('Africa')),
+        ('Asia', _('Asia')),
+        ('Europe', _('Europe')),
+        ('Australia', _('Australia')),
+        ('Antarctica', _('Antarctica')),
+        ('Unknown', _('Unknown Continent')),
+)
+
+
 class Team(models.Model):
     lp_name = models.SlugField(_("Launchpad Team ID"), max_length=40, null=True)
     name = models.CharField(_("Team Name"), max_length=80, null=True)
@@ -32,6 +44,7 @@
     owner = models.SlugField(_("Launchpad Team Owner"), null=True, blank=False)
     admins = models.ManyToManyField(TeamAdministrator)
     mugshot_url = models.URLField(_("URL of mugshot"), verify_exists=False, null=True, blank=True)
+    continent = models.CharField(_("Continent"), max_length=60, choices = CONTINENT_CHOICES, default='Unknown', db_index=True)
     
     objects = TeamManager()
     

=== modified file 'loco_directory/teams/views.py'
--- loco_directory/teams/views.py	2010-04-27 15:38:25 +0000
+++ loco_directory/teams/views.py	2010-05-05 18:05:38 +0000
@@ -44,7 +44,8 @@
         if form.cleaned_data['q']:
             q = form.cleaned_data['q']
             team_list = team_list.filter(Q(name__icontains=q) | Q(country__icontains=q) | Q(city__icontains=q))
-
+    
+    team_list = team_list.order_by('continent')
     context = {
         'team_list': team_list,
         'form': form,

=== modified file 'loco_directory/templates/teams/team_detail.html'
--- loco_directory/templates/teams/team_detail.html	2010-05-04 05:58:12 +0000
+++ loco_directory/templates/teams/team_detail.html	2010-05-05 18:05:38 +0000
@@ -36,6 +36,9 @@
             {% else %}
 		        {% trans "None Specified" %}
             {% endif %}
+            {% if team.continent %}
+                ( {{ team.continent }} )
+            {% endif %}
         </td>
     </tr>
 	<tr>

=== modified file 'loco_directory/templates/teams/team_list.html'
--- loco_directory/templates/teams/team_list.html	2010-05-02 17:33:13 +0000
+++ loco_directory/templates/teams/team_list.html	2010-05-05 18:05:38 +0000
@@ -17,11 +17,17 @@
 		{{ form.as_line }}
 		<input type="image" src="/media/img/search.png" title="{% trans "Search" %}" />
 </form>
-<ul>
-{% for team in team_list %}
-<li title="{% if team.approved %}{% blocktrans with team.name as teamname %}{{ teamname }} approved{% endblocktrans %}{% else %}{% blocktrans with team.name as teamname %}{{ teamname }} not approved{% endblocktrans %}{% endif %}" class="{% if team.approved %}approved{% else %}unapproved{% endif %} {% cycle 'col_left' 'col_right' %}"><a href="{{ team.get_absolute_url }}">{{ team.name }}</a></li>
+
+{% regroup team_list by continent as team_continent_list %}    
+{% for continent in team_continent_list %}
+    <h2>{{ continent.grouper }}</h2>
+    <ul>
+        {% for team in continent.list %}
+            <li title="{% if team.approved %}{% blocktrans with team.name as teamname %}{{ teamname }} approved{% endblocktrans %}{% else %}{% blocktrans with team.name as teamname %}{{ teamname }} not approved{% endblocktrans %}{% endif %}" class="{% if team.approved %}approved{% else %}unapproved{% endif %} {% cycle 'col_left' 'col_right' %}"><a href="{{ team.get_absolute_url }}">{{ team.name }}</a></li>
+        {% endfor %}
+    </ul>
+    <br class="clear" />
 {% endfor %}
-</ul>
 <br class="clear" />
 <p><b><a href="reapprovals">{% trans "Upcoming Reapprovals" %}</a></b></p>
 {% else %}

_______________________________________________
Mailing list: https://launchpad.net/~loco-directory-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~loco-directory-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to