Daniel Holbach has proposed merging lp:~dholbach/loco-directory/601947 into 
lp:loco-directory.

Requested reviews:
  loco-directory-dev (loco-directory-dev)
Related bugs:
  #601947 Add the language in a team detail page
  https://bugs.launchpad.net/bugs/601947

-- 
https://code.launchpad.net/~dholbach/loco-directory/601947/+merge/30003
Your team loco-directory-dev is requested to review the proposed merge of 
lp:~dholbach/loco-directory/601947 into lp:loco-directory.
=== modified file '.bzrignore'
--- .bzrignore	2010-02-16 17:14:13 +0000
+++ .bzrignore	2010-07-15 14:31:04 +0000
@@ -8,3 +8,4 @@
 loco_directory/media/jquery-ui
 loco_directory/teams/fixtures
 local_settings.py
+loco_directory/ubuntu_website

=== modified file 'loco_directory/locale/loco-directory.pot'
--- loco_directory/locale/loco-directory.pot	2010-07-09 14:42:31 +0000
+++ loco_directory/locale/loco-directory.pot	2010-07-15 14:31:04 +0000
@@ -8,7 +8,11 @@
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
+<<<<<<< TREE
 "POT-Creation-Date: 2010-07-09 14:40+0000\n"
+=======
+"POT-Creation-Date: 2010-07-15 14:11+0000\n"
+>>>>>>> MERGE-SOURCE
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <em...@address>\n"
 "Language-Team: LANGUAGE <[email protected]>\n"
@@ -199,81 +203,89 @@
 msgid "You can not update this global event. You are not on the LoCo Council."
 msgstr ""
 
+#: teams/models.py:7
+msgid "Language"
+msgstr ""
+
 #: teams/models.py:8
+msgid "Language Code"
+msgstr ""
+
+#: teams/models.py:17
 msgid "Launchpad ID"
 msgstr ""
 
-#: teams/models.py:13 teams/models.py:19
+#: teams/models.py:22 teams/models.py:28
 msgid "Name"
 msgstr ""
 
-#: teams/models.py:26
+#: teams/models.py:35
 msgid "Launchpad Team ID"
 msgstr ""
 
-#: teams/models.py:27
+#: teams/models.py:36
 msgid "Team Name"
 msgstr ""
 
-#: teams/models.py:29
+#: teams/models.py:38
 msgid "State/Province/Region"
 msgstr ""
 
-#: teams/models.py:30
+#: teams/models.py:39
 msgid "City"
 msgstr ""
 
-#: teams/models.py:31
+#: teams/models.py:40
 msgid "Ubuntu Wiki Page"
 msgstr ""
 
-#: teams/models.py:32
+#: teams/models.py:41
 msgid "Website"
 msgstr ""
 
-#: teams/models.py:33
+#: teams/models.py:42
 msgid "Mailing List URL"
 msgstr ""
 
-#: teams/models.py:34
+#: teams/models.py:43
 msgid "Forums URL"
 msgstr ""
 
-#: teams/models.py:35 templates/teams/team_detail.html:81
+#: teams/models.py:44 templates/teams/team_detail.html:93
 msgid "Email Address"
 msgstr ""
 
-#: teams/models.py:36 templates/teams/team_detail.html:75
+#: teams/models.py:45 templates/teams/team_detail.html:87
 msgid "IRC Channel"
 msgstr ""
 
-#: teams/models.py:38
+#: teams/models.py:47
 msgid ""
 "IRC Channel name that is hosted on the freenode IRC network. Ex. #ubuntu-"
 "chicago"
 msgstr ""
 
-#: teams/models.py:40
+#: teams/models.py:49
 msgid "Provides local support"
 msgstr ""
 
-#: teams/models.py:42
+#: teams/models.py:51
 msgid "Approved Team"
 msgstr ""
 
-#: teams/models.py:43
+#: teams/models.py:52
 msgid "Date Approved"
 msgstr ""
 
-#: teams/models.py:44
+#: teams/models.py:53
 msgid "Date Expires"
 msgstr ""
 
-#: teams/models.py:45
+#: teams/models.py:54
 msgid "Launchpad Team Owner"
 msgstr ""
 
-#: teams/models.py:47
+#: teams/models.py:56
 msgid "URL of mugshot"
 msgstr ""
 
@@ -850,72 +862,109 @@
 msgid "Location:"
 msgstr ""
 
+<<<<<<< TREE
 #: templates/teams/team_detail.html:34 templates/teams/team_detail.html:110
+=======
+#: templates/teams/team_detail.html:34 templates/teams/team_detail.html:46
+#: templates/teams/team_detail.html:120
+>>>>>>> MERGE-SOURCE
 msgid "None Specified"
 msgstr ""
 
 #: templates/teams/team_detail.html:39
+msgid "Languages:"
+msgstr ""
+
+#: templates/teams/team_detail.html:51
 msgid "Launchpad Page:"
 msgstr ""
 
-#: templates/teams/team_detail.html:44
+#: templates/teams/team_detail.html:56
 msgid "Launchpad Team Owner:"
 msgstr ""
 
-#: templates/teams/team_detail.html:50
+#: templates/teams/team_detail.html:62
 msgid "Approval Date:"
 msgstr ""
 
-#: templates/teams/team_detail.html:56
+#: templates/teams/team_detail.html:68
 msgid "Expires Date:"
 msgstr ""
 
-#: templates/teams/team_detail.html:62
+#: templates/teams/team_detail.html:74
 msgid "Launchpad Team Admin(s):"
 msgstr ""
 
-#: templates/teams/team_detail.html:69
+#: templates/teams/team_detail.html:81
 msgid "Resources:"
 msgstr ""
 
-#: templates/teams/team_detail.html:72
+#: templates/teams/team_detail.html:84
 msgid "Team Wiki"
 msgstr ""
 
-#: templates/teams/team_detail.html:78
+#: templates/teams/team_detail.html:90
 msgid "Team Mailing List"
 msgstr ""
 
+<<<<<<< TREE
 #: templates/teams/team_detail.html:83
 msgid "Contact Team via Launchpad"
 msgstr ""
 
 #: templates/teams/team_detail.html:86
+=======
+#: templates/teams/team_detail.html:96
+>>>>>>> MERGE-SOURCE
 msgid "Team Forums"
 msgstr ""
 
+<<<<<<< TREE
 #: templates/teams/team_detail.html:89
+=======
+#: templates/teams/team_detail.html:99
+>>>>>>> MERGE-SOURCE
 msgid "Team Website"
 msgstr ""
 
+<<<<<<< TREE
 #: templates/teams/team_detail.html:92
+=======
+#: templates/teams/team_detail.html:102
+>>>>>>> MERGE-SOURCE
 msgid "Provides Support"
 msgstr ""
 
+<<<<<<< TREE
 #: templates/teams/team_detail.html:98
+=======
+#: templates/teams/team_detail.html:108
+>>>>>>> MERGE-SOURCE
 msgid "Upcoming Events:"
 msgstr ""
 
+<<<<<<< TREE
 #: templates/teams/team_detail.html:105
+=======
+#: templates/teams/team_detail.html:115
+>>>>>>> MERGE-SOURCE
 #, python-format
 msgid "%(start_date)s in %(city)s"
 msgstr ""
 
+<<<<<<< TREE
 #: templates/teams/team_detail.html:105
+=======
+#: templates/teams/team_detail.html:115
+>>>>>>> MERGE-SOURCE
 msgid "on: "
 msgstr ""
 
+<<<<<<< TREE
 #: templates/teams/team_detail.html:108
+=======
+#: templates/teams/team_detail.html:118
+>>>>>>> MERGE-SOURCE
 msgid "Show detailed Event List"
 msgstr ""
 

=== modified file 'loco_directory/teams/admin.py'
--- loco_directory/teams/admin.py	2010-06-04 11:46:55 +0000
+++ loco_directory/teams/admin.py	2010-07-15 14:31:04 +0000
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 
 from django.contrib import admin
-from teams.models import Team, TeamAdministrator, Continent, Country
+from teams.models import Team, TeamAdministrator, Continent, Country, Language
 
 class TeamAdmin(admin.ModelAdmin):
     search_fields = ('name',)
@@ -22,8 +22,11 @@
 class CountryAdmin(admin.ModelAdmin):
     search_fields = ('name',)
 
+class LanguageAdmin(admin.ModelAdmin):
+    search_fields = ('name',)
+
 admin.site.register(Team, TeamAdmin)
 admin.site.register(TeamAdministrator, TeamAdministratorAdmin)
 admin.site.register(Continent, ContinentAdmin)
 admin.site.register(Country, CountryAdmin)
-
+admin.site.register(Language, LanguageAdmin)

=== added file 'loco_directory/teams/management/commands/update-languages.py'
--- loco_directory/teams/management/commands/update-languages.py	1970-01-01 00:00:00 +0000
+++ loco_directory/teams/management/commands/update-languages.py	2010-07-15 14:31:04 +0000
@@ -0,0 +1,22 @@
+#!/usr/bin/python
+
+from django.core.management.base import NoArgsCommand
+
+from teams import models
+
+from common import launchpad
+
+class Command(NoArgsCommand):
+    help = "Update list of continents and countries."
+
+    def handle_noargs(self, **options):
+        lp = launchpad.lp_login()
+        ld_languages = models.Language.objects.all()
+        lp_language_names = set([(a.english_name, a.code) for a in lp.languages.getAllLanguages()])
+        ld_language_names = set([(a.name, a.code) for a in ld_languages])
+        for (language_name, language_code) in ld_language_names.difference(lp_language_names):
+            language = ld_languages.get(name=language_name)
+            language.delete()
+        for (language_name, language_code) in lp_language_names.difference(ld_language_names):
+            language = models.Language(name=language_name, code=language_code)
+            language.save()

=== modified file 'loco_directory/teams/management/commands/update.py'
--- loco_directory/teams/management/commands/update.py	2010-06-04 11:43:09 +0000
+++ loco_directory/teams/management/commands/update.py	2010-07-15 14:31:04 +0000
@@ -14,6 +14,7 @@
         pwd = os.getcwd()
         os.chdir(settings.PROJECT_PATH)
         subprocess.call(["./manage.py", "update-countries"])
+        subprocess.call(["./manage.py", "update-languages"])
         subprocess.call(["./manage.py", "lpupdate"])
         os.chdir(pwd)
 

=== added file 'loco_directory/teams/migrations/0004_add_languages.py'
--- loco_directory/teams/migrations/0004_add_languages.py	1970-01-01 00:00:00 +0000
+++ loco_directory/teams/migrations/0004_add_languages.py	2010-07-15 14:31:04 +0000
@@ -0,0 +1,81 @@
+
+from south.db import db
+from django.db import models
+from teams.models import *
+
+class Migration:
+    
+    def forwards(self, orm):
+        
+        # Adding model 'Language'
+        db.create_table('teams_language', (
+            ('id', orm['teams.language:id']),
+            ('name', orm['teams.language:name']),
+            ('code', orm['teams.language:code']),
+        ))
+        db.send_create_signal('teams', ['Language'])
+        
+        # Adding ManyToManyField 'Team.languages'
+        db.create_table('teams_languages', (
+            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
+            ('team', models.ForeignKey(orm.Team, null=False)),
+            ('language', models.ForeignKey(orm.Language, null=False))
+        ))
+        
+    
+    
+    def backwards(self, orm):
+        
+        # Deleting model 'Language'
+        db.delete_table('teams_language')
+        
+        # Dropping ManyToManyField 'Team.languages'
+        db.delete_table('teams_languages')
+        
+    
+    
+    models = {
+        'teams.continent': {
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'name': ('django.db.models.fields.TextField', [], {'max_length': '50'})
+        },
+        'teams.country': {
+            'continents': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Continent']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'name': ('django.db.models.fields.TextField', [], {'max_length': '100'})
+        },
+        'teams.language': {
+            'code': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '150', 'null': 'True'})
+        },
+        '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'}),
+            'countries': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Country']"}),
+            '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'}),
+            'languages': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Language']"}),
+            '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-06-04 11:46:55 +0000
+++ loco_directory/teams/models.py	2010-07-15 14:31:04 +0000
@@ -1,6 +1,15 @@
 from django.db import models
 from django.utils.translation import ugettext_lazy as _
 
+class Language(models.Model):
+    class Meta:
+        ordering = ('name',)
+    name = models.CharField(_("Language"), max_length=150, null=True)
+    code = models.CharField(_("Language Code"), max_length=20, null=True)
+
+    def __unicode__(self):
+        return u'%s' % (self.name)
+
 class TeamManager(models.Manager):
     pass
 
@@ -45,6 +54,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)
+    languages = models.ManyToManyField(Language)
     
     objects = TeamManager()
     

=== modified file 'loco_directory/teams/views.py'
--- loco_directory/teams/views.py	2010-06-04 14:27:35 +0000
+++ loco_directory/teams/views.py	2010-07-15 14:31:04 +0000
@@ -49,7 +49,7 @@
     if form.is_valid():
         if form.cleaned_data['q']:
             q = form.cleaned_data['q']
-            team_list = team_list.filter(Q(name__icontains=q) | Q(countries__name__icontains=q) | Q(city__icontains=q))
+            team_list = team_list.filter(Q(name__icontains=q) | Q(countries__name__icontains=q) | Q(city__icontains=q) | Q(languages__name__icontains=q))
 
     context = {
         'team_list': team_list,

=== modified file 'loco_directory/templates/teams/team_detail.html'
--- loco_directory/templates/teams/team_detail.html	2010-07-09 10:09:32 +0000
+++ loco_directory/templates/teams/team_detail.html	2010-07-15 14:31:04 +0000
@@ -35,6 +35,18 @@
             {% endif %}
         </td>
     </tr>
+    <tr>
+        <th class="form-item-label" scope="row"><label>{% trans "Languages:" %}</label></th>
+        <td class="form-item-value">
+            {% if team.languages.all %}
+                {% for language in team.languages.all %}
+		   {{ language.name }}&nbsp;
+		{% endfor %}
+            {% else %}
+		        {% trans "None Specified" %}
+            {% endif %}
+        </td>
+    </tr>
 	<tr>
 	  <th class="form-item-label" scope="row"><label>{% trans "Launchpad Page:" %}</label></th>
 	  <td class="form-item-value"><a href="https://launchpad.net/~{{ team.lp_name }}">{{ team.name }}</a></td>

_______________________________________________
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