Commit d146a21f authored by Claude Paroz's avatar Claude Paroz

djamnedlies branch committed in trunk.

svn path=/trunk/; revision=1147
parent ea314d91
2008-11-08 Claude Paroz <>
* stats/ Enrich Release editing in admin, allowing branch choice.
2008-11-08 Claude Paroz <>
* languages/ Fixed regression: /languages/ll redirect to
corresponding team page.
* stats/ Get human-readable category name.
* templates/languages/language_release_stats.html: Use new catname.
2008-11-08 Claude Paroz <>
* stats/ Add Domain class to admin UI, and domain inline in
Moudle admin.
* teams/ Priority to slug URL.
2008-11-08 Claude Paroz <>
* languages/ get_name/get_team_url API addition.
* languages/ Permit '@' in urls for language.
* people/ Remove deprecated _old_id.
* stats/ Temporary fix for ooo-build speciality. Replace
external by xternal for ordering purposes.
* teams/ Added get_languages method, and FakeTeam class to
provide for locales without team.
* teams/
* teams/ Replaced generic view by a normal view to handle
FakeTeam teams.
* templates/languages/language_list.html: Use new get_team_url/get_name
* templates/teams/team_detail.html: Adapted to handle FakeTeam use case.
2008-11-08 Claude Paroz <>
* teams/ Replaced default by blank.
* templates/base.html: Updated footer.
2008-11-07 Claude Paroz <>
* languages/ Some locales contain a '-'.
* stats/management/commands/ This is a NoArgsCommand.
* stats/management/commands/ New command to copy an
existing release and use HEAD branches.
* stats/ Added new get_head_branch method (for copy-release).
2008-11-07 Claude Paroz <>
* people/ Set default ordering for people.
* languages/
* languages/
* stats/
* stats/
* templates/languages/language_release.html:
* templates/release.html:
* templates/release_list.html:
* templates/stats_show.html:
* templates/teams/team_detail.html:
* Use (slug) instead of id in release URLs.
2008-11-07 Claude Paroz <>
* people/ Permit users without passwords (or '!').
* Make admin media a subdir of media.
* stats/management/commands/ Fixed typo.
* stats/ Replace default=None by blank=True in models.
* stats/ Moved urls in / so as /module and /release urls
are in the root.
2008-11-07 Stéphane Raimbault <>
* languages/
* stats/
* stats/
* teams/ Enhanced administration interface (display name,
search, ordering, etc).
2008-11-07 Stéphane Raimbault <>
* TODO: Removed item.
* people/ Removed old functions and added comments
* stats/ Added new related name maintains_modules.
* teams/ Renamed coordinates to coordinates_teams.
* templates/person_base.html: Use new relations.
2008-11-06 Claude Paroz <>
* stats/ branch.releases should be iterated with all().
2008-11-06 Claude Paroz <>
* docs/scgi-sample-init-script.txt:
* README: Added some hints about running Django as CGI.
2008-11-06 Claude Paroz <>
* languages/
* people/
* stats/
* teams/ Add some more default values.
* stats/ Improve module admin form.
* stats/management/commands/ Update field name from
category table.
2008-11-03 Stéphane Raimbault <>
Moved language components to their own 'languages' application.
* languages/ Register the new model.
* languages/ Moved from stats.models with adjustments.
* languages/ Moved from stats.urls with adjustments.
* languages/ Moved from stats.views with adjustments.
* Added teams, people and languages.
* stats/
* stats/management/commands/
* stats/ Removed Language and duplicate slug_locale().
Renamed lang in lang_name and langcode in lang_locale.
* stats/ Removed old URL.
* stats/ Removed languages() and languagerelease().
* teams/
* teams/ Fix wrong import from stats.
* templates/languages/language_list.html: Remove useless spaces in
title. It's simpler to directly call the team URL.
* templates/languages/language_release.html: Use locale for locale
and avoid a duplicate assignment.
* templates/languages/language_release_stats.html:
* templates/release.html: Use locale for locale!
* templates/teams/team_detail.html: New name for the view
* Add the languages application.
* vertimus/ Updated imports.
2008-11-03 Stéphane Raimbault <>
* templates/person_base.html: Fixed team URL and missing </li>.
2008-11-02 Stéphane Raimbault <>
Moved person components to their own 'people application.
* TODO: Updated.
* people/ Moved from stats.admin
* people/ Used name relation in translates()
* people/ Generic views only.
* stats/ Updated with new Team and Person models.
* stats/management/commands/ Idem.
* stats/ Removed Person class.
* stats/
* stats/
* stats/ Removed old views.
* teams/
* teams/ Renamed model relation from managed_teams to
* teams/ Restored pageSection.
* templates/people.html:
* templates/people/person_detail.html: Removed hack.
* templates/people/person_list.html:
* templates/person_base.html: Used get_absolute_url.
* templates/stats/person_detail.html:
2008-11-02 Stéphane Raimbault <>
Moved teams components to their own 'teams' application.
* common/
* common/ Moved home.
* stats/
* stats/ Removed useless admin.autodiscover().
* stats/ Removed hard URL for coordinator.
* teams/ Add get_absolute_url.
* teams/ A team is accessible by its id or its name.
* teams/ Use the generic view for detail.
* templates/base.html: Removed rtl not used and wrong on body tag.
* templates/team_detail.html:
* templates/team_list.html:
* templates/teams/team_detail.html: Use team.language_set.all.
* templates/teams/team_list.html: Use team and coordinator
* Updated for index and teams.
2008-11-02 Stéphane Raimbault <>
* README: Added information about the ANSI_QUOTES setting
* stats/management/commands/ Removed stupid pdb call
from my previous commit.
* stats/ Added comment.
2008-11-02 Stéphane Raimbault <>
* stats/conf/ Added setting to use an external
MySQL database.
* stats/management/commands/ Use the new settings. Fix
return from migrate_stats when the old_statistics table doesn't
2008-11-01 Claude Paroz <>
* stats/management/commands/ Adapted to model change and
reintroduced migrate_stats (conditionally import an old_statistics table
to be able to test with real and massive data).
* stats/ Changed model (category is now the manytomany
intermediate table between branch and release, permitting a branch to be
in multiple releases.
* stats/ Add the '+' char as a valid char for module name (for
* docs/DataModel.odg: Updated.
2008-11-01 Stéphane Raimbault <>
* stats/ Removed incorrect '*' in regexp on toplevel
URL (repeats the previous expression). Use simpler [\w-] instead
of (\w|-).
2008-11-01 Stéphane Raimbault <>
* stats/ Fixed URL parsing for module and branch
names. Stricter with release ID and team names.
2008-11-01 Stéphane Raimbault <>
* stats/ Fixed invalid SQL query (detected by
PostgreSQL). Code formatting cleanups.
2008-10-28 Claude Paroz <>
* stats/ Deleted, all settings now in stats/conf/
* templates/base.html: Get LANGUAGE_CODE from global function.
2008-10-28 Claude Paroz <>
* stats/ Missing branch name in po file name produced by
* stats/ Fixed typo in template name.
* templates/index.html:
* TODO: Hardcoded '/stats/teams' in index.html fixed.
2008-10-28 Stéphane Raimbault <>
* Notes about databases configuration.
2008-10-27 Claude Paroz <>
* stats/ Language has no 'Language' field, but 'language'.
* templates/module.html: Use person_base to display maintainers.
2008-10-27 Claude Paroz <>
* stats/conf/ Herit DATABASE_ENGINE setting.
* stats/ Add Language methods to normalize/denormalize
langcode in URLs (URL resolver doesn't support @ char).
Requote release table, but with ANSI quotes, and set adequate mode
when DB backend is MySQL.
Prevent divide by 0 in get_global_stats.
* stats/ Handle case where langcode is "slug" normalized.
* templates/person_base.html: maintains and translates are now methods
from Person object.
* templates/release.html: url tag needs {%
2008-10-26 Stéphane Raimbault <>
* TODO: Add some items
* stats/ Add some get_absolute_url. Don't escape release
name with PostgreSQL.
* stats/ Add explicit names.
* stats/ Remove all webroot except one.
* templates/*.html: Get rid of webroot with url filter or
get_absolute_url. Use the Django convention to name the template
* Define the index view.
2008-10-26 Stéphane Raimbault <>
* stats/
* templates/index.html: Fix incorrect variable name
translator_credit. Fix missing assignment after replace
call. Remove useless '<' and '>' replacements in Django
template. Format only in the template with a filter.
2008-10-26 Stéphane Raimbault <>
* stats/
* stats/
* templates/list-modules.html:
* templates/person-base.html:
* Removed constraint on the project name (easier to
2008-10-26 Stéphane Raimbault <>
* stats/ Renamed from to avoid
wrong commits. Added to svn:ignore property.
* README: Added note to rename the file at installation time.
2008-10-26 Stéphane Raimbault <>
* stats/ Fix plural forms in admin interface.
2008-10-26 Stéphane Raimbault <>
* stats/management/commands/ SVN is our memory :)
* stats/management/commands/ Minor changes.
2008-10-26 Stéphane Raimbault <>
* README: Added note about Sites setting.
* TODO: Added item to use username instead of person_id.
* stats/ Defined get_absolute_url for Person. Explicit
relation name between coordinator and person to not mix up with
* stats/ Use a generic view for person.
* stats/ Remove the deprecated view.
* templates/person-base.html: Use get_absolute_url
* templates/person.html: Renamed in person_detail.html
* templates/stats/person_detail.html: Use object instead of person
and add an ugly hack to use person into the included template.
2008-10-26 Stéphane Raimbault <>
* stats/ Added Person to admin interface.
2008-10-25 Claude Paroz <>
* stats/ Added more objects to admin interface.
* stats/ Added more __unicode__ functions and ordering table
attribute for better display in admin mode.
2008-10-24 Claude Paroz <>
* stats/management/commands/
* stats/management/commands/ Added scripts to manage
translations (wrappers to makemessages and compilemessages).
* stats/management/commands/ Don't migrate Stats, they should
be regenerated by update-stats script.
* stats/ Removed N_ shortcut, because strings are not extracted.
* stats/ Reworked Statistics (old fields removed, field names
* templates/language-release-stats.html: Use lowercase field names from
2008-10-24 Claude Paroz <>
* TODO: update-stats is now complete.
* Use locale middleware.
* stats/ Coerce percentages to int type. Quote release table as
it is a protected word in mysql.
* templates/team.html:
* stats/ team template should be displayable even when there is
no team for a language.
* templates/show-stats.html: Use new description_get function for domain.
2008-10-23 Claude Paroz <>
* stats/ Finished update-stats implementation.
* stats/ Added more functions to generate doc stats.
* templates/module.html: 'Translation' and 'Documentation' should only
appear when domain > 1
* templates/show-stats.html: Missing webroot.
2008-10-23 Claude Paroz <>
* README: Add stats/conf/ notice.
* stats/conf/ Remove my local paths
* stats/management/commands/ Take xml_base value from settings.
Don't import nobody.png in database.
* stats/ Take static document_root from settings.
* templates/person-base.html: nobody.png is not any more in DB.
2008-10-23 Stéphane Raimbault <>
* stats/ Fixed argument for Team.
* templates/person-base.html: Reverted missing webroot.
2008-10-23 Stéphane Raimbault <>
* Removed one template setting.
* stats/templates/*.tmpl:
* stats/
* templates/*.html: Moved all templates to /templates.
Rename .tmpl to .html (HTML mode and Django convention).
2008-10-23 Stéphane Raimbault <>
* stats/
* stats/templates/module-images.tmpl:
* stats/templates/show-stats.tmpl: Replace remaining URLs to /data
* stats/ Remove the old URL pattern to Claude's directory :)
2008-10-23 Stéphane Raimbault <>
Migrate all the static data from /stats/data to /media.
Update all templates and CSS files.
Use specific paths for img, css and js.
* Added new STATIC_SERVE setting.
* stats/ Added URL pattern to static Django view (only for
development purpose).
2008-10-23 Stéphane Raimbault <>
* vertimus/ Fixed test of Vertimus.
2008-10-23 Stéphane Raimbault <>
* stats/templates/list-teams.tmpl:
* stats/templates/person-base.tmpl:
* stats/
* stats/
* vertimus/ Fixed using of lang_code for Team.
2008-10-23 Stéphane Raimbault <>
* stats/ Add a convenient property to get Person
2008-10-23 Stéphane Raimbault <>
* stats/management/commands/
* stats/
* stats/templates/module-images.tmpl:
* stats/templates/module.tmpl:
* stats/ PEP-8 but I don't want to touch Statistics and
Information for now :-/
2008-10-22 Stéphane Raimbault <>
* Fixed svn:ignore property.
2008-10-22 Stéphane Raimbault <>
* Renamed from to avoid wrong
commits. Added to svn:ignore property.
* README: Added note to rename the file at installation
2008-10-22 Stéphane Raimbault <>
Updated Person and Team classes.
* stats/management/commands/ Removed app argument. Try
to split first name and last name. Use svn_accound or email for
* stats/ Updated Person and Team classes to respectively
inherit from User and Group. Replaced too short CharField by
URLField. Removed duplicate fields (with Django Auth ones). Team
and Person are now associated by Django.
* stats/ PEP-8 changes.
2008-10-22 Claude Paroz <>
* stats/conf/ Added conf variables for notifications.
* stats/ Progress with updating statistics (still WIP for docs).
* stats/ Copied from legacy damned lies.
* stats/ Added several utility functions for updating statistics.
2008-10-22 Claude Paroz <>
* stats/management/commands/ Allow to migrate with a fresh
damned-lies checkout ( files).
2008-10-22 Claude Paroz <>
* docs/DataModel.odg: Added vcs_subdir to branch table.
* stats/conf/ Added DEBUG variable (referring to global DEBUG)
* stats/management/commands/ Populate vcs_subpath.
* stats/management/commands/ Added script to update
* stats/ Added code to checkout branches and skeleton for
updating stats (wip).
* stats/templates/language-release-stats.tmpl: Fixed relative path for
/data content.
2008-10-22 Stéphane Raimbault <>
Initial and rough commit of Vertimus features.
2008-10-20 Claude Paroz <>
Initial commit of djangoified Damned-Lies.
This is a re-implementation of the Damned-Lies application
in a Django app. Damned-Lies has been originally written by
Danilo Segan ( This implementation has been
written by Claude Paroz (
The former XML files (modules, releases, people, translation
teams) have been replaced by a database.
The Data model is in the /docs directory.
The middle-term objective is to merge this code with the Transifex
application (
1 - Rename in
2 - Review and fill in settings in stats/conf/ and
rename it to (please refer to Database configuration
below for more informations).
3 - Run 'python syncdb'
4 - Configure Sites in admin interface to define the 'View on site'
It's important to use the Unix Domain Socket connection to obtain good
You just need to define DATABASE_ENGINE = 'postgresql_psycopg2' and DATABASE_NAME. Leave DATABASE_HOST setting empty to use UDS.
Create a database in UTF8, either with default-character-set = utf8
under [mysqld] section in the my.cnf file or with an explicit 'create
database bla charset=utf8;'
DATABASE_HOST = '/var/run/mysqld/mysqld.sock'
'read_default_file': '/etc/mysql/my.cnf',
"init_command": "SET storage_engine=INNODB"
Grep for ANSI_QUOTES in the source code to find the which
use a hack to workaround the double quotes interpretation in MySQL.
The best solution is to run the MySQL server with the ANSI_QUOTES
(sql-mode="ANSI_QUOTES" in my.cnf) but it can be dangerous for other
Running as CGI
If you don't won't to setup Django with mod_python, there is a tutorial
on the Django Wiki:
You'll also file a sample init script in the /docs directory.
Things left to do:
* i18n (translation for strings in database?)
* Still a webroot in stats_show.html
# -*- coding: utf-8 -*-
# Copyright (c) 2006-2007 Danilo Segan <>.
# Copyright (c) 2008 Claude Paroz <>.
# This file is part of Damned Lies.
# Damned Lies is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# Damned Lies is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with Damned Lies; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from django.utils.translation import ugettext as _
def trans_sort_object_list(lst, tr_field):
""" Sort an object list with translated_name """
for l in lst:
l.translated_name = _(getattr(l, tr_field))
templist = [(obj_.translated_name.lower(), obj_) for obj_ in lst]
return [obj_ for (key1, obj_) in templist]
# -*- coding: utf-8 -*-
# Copyright (c) 2008 Claude Paroz <>.
# This file is part of Damned Lies.
# Damned Lies is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# Damned Lies is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with Damned Lies; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from django.shortcuts import render_to_response
from django.utils.translation import ugettext_lazy as _
def index(request):
translator_credits = _("translator-credits")
# FIXME Not sure the LANGUAGE_CODE test is useful
if request.LANGUAGE_CODE == 'en' or translator_credits == "translator-credits":
translator_credits = ''