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 <claude@2xlibre.net>
* stats/admin.py: Enrich Release editing in admin, allowing branch choice.
2008-11-08 Claude Paroz <claude@2xlibre.net>
* languages/urls.py: Fixed regression: /languages/ll redirect to
corresponding team page.
* stats/models.py: Get human-readable category name.
* templates/languages/language_release_stats.html: Use new catname.
2008-11-08 Claude Paroz <claude@2xlibre.net>
* stats/admin.py: Add Domain class to admin UI, and domain inline in
Moudle admin.
* teams/urls.py: Priority to slug URL.
2008-11-08 Claude Paroz <claude@2xlibre.net>
* languages/models.py: get_name/get_team_url API addition.
* languages/urls.py: Permit '@' in urls for language.
* people/models.py: Remove deprecated _old_id.
* stats/models.py: Temporary fix for ooo-build speciality. Replace
external by xternal for ordering purposes.
* teams/models.py: Added get_languages method, and FakeTeam class to
provide for locales without team.
* teams/urls.py:
* teams/views.py: Replaced generic view by a normal view to handle
FakeTeam teams.
* templates/languages/language_list.html: Use new get_team_url/get_name
methods.
* templates/teams/team_detail.html: Adapted to handle FakeTeam use case.
2008-11-08 Claude Paroz <claude@2xlibre.net>
* teams/models.py: Replaced default by blank.
* templates/base.html: Updated footer.
2008-11-07 Claude Paroz <claude@2xlibre.net>
* languages/urls.py: Some locales contain a '-'.
* stats/management/commands/compile-trans.py: This is a NoArgsCommand.
* stats/management/commands/copy-release.py: New command to copy an
existing release and use HEAD branches.
* stats/models.py: Added new get_head_branch method (for copy-release).
2008-11-07 Claude Paroz <claude@2xlibre.net>
* people/models.py: Set default ordering for people.
* languages/urls.py:
* languages/views.py:
* stats/models.py:
* stats/views.py:
* templates/languages/language_release.html:
* templates/release.html:
* templates/release_list.html:
* templates/stats_show.html:
* templates/teams/team_detail.html:
* urls.py: Use (slug) release.name instead of id in release URLs.
2008-11-07 Claude Paroz <claude@2xlibre.net>
* people/models.py: Permit users without passwords (or '!').
* settings_sample.py: Make admin media a subdir of media.
* stats/management/commands/update-stats.py: Fixed typo.
* stats/models.py: Replace default=None by blank=True in models.
* urls.py:
* stats/urls.py: Moved urls in /urls.py so as /module and /release urls
are in the root.
2008-11-07 Stéphane Raimbault <stephane.raimbault@gmail.com>
* languages/admin.py:
* stats/admin.py:
* stats/models.py:
* teams/admin.py: Enhanced administration interface (display name,
search, ordering, etc).
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.
2008-11-06 Claude Paroz <claude@2xlibre.net>
* stats/models.py: branch.releases should be iterated with all().
2008-11-06 Claude Paroz <claude@2xlibre.net>
* docs/scgi-sample-init-script.txt:
* README: Added some hints about running Django as CGI.
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.
2008-11-03 Stéphane Raimbault <stephane.raimbault@gmail.com>
Moved language components to their own 'languages' application.
* languages/admin.py: Register the new model.
* languages/models.py: Moved from stats.models with adjustments.
* languages/urls.py: Moved from stats.urls with adjustments.
* languages/views.py: Moved from stats.views with adjustments.
* settings_sample.py: Added teams, people and languages.
* stats/admin.py:
* stats/management/commands/migrate.py:
* stats/models.py: Removed Language and duplicate slug_locale().
Renamed lang in lang_name and langcode in lang_locale.
* stats/urls.py: Removed old URL.
* stats/views.py: Removed languages() and languagerelease().
* teams/models.py:
* teams/views.py: 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
language_release.
* urls.py: Add the languages application.
* vertimus/models.py: Updated imports.
2008-11-03 Stéphane Raimbault <stephane.raimbault@gmail.com>
* templates/person_base.html: Fixed team URL and missing </li>.
2008-11-02 Stéphane Raimbault <stephane.raimbault@gmail.com>
Moved person components to their own 'people application.
* TODO: Updated.
* people/admin.py: Moved from stats.admin
* people/models.py: Used name relation in translates()
* people/urls.py: Generic views only.
* stats/admin.py: Updated with new Team and Person models.
* stats/management/commands/migrate.py: Idem.
* stats/models.py: Removed Person class.
* stats/urls.py:
* stats/utils.py:
* stats/views.py: Removed old views.
* teams/admin.py:
* teams/models.py: Renamed model relation from managed_teams to
coordinates.
* teams/urls.py: 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:
* urls.py:
2008-11-02 Stéphane Raimbault <stephane.raimbault@gmail.com>
Moved teams components to their own 'teams' application.
* common/utils.py:
* common/views.py: Moved home.
* stats/models.py:
* stats/urls.py: Removed useless admin.autodiscover().
* stats/views.py: Removed hard URL for coordinator.
* teams/models.py: Add get_absolute_url.
* teams/urls.py: A team is accessible by its id or its name.
* teams/views.py: 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
get_absolute_url().
* urls.py: Updated for index and teams.
2008-11-02 Stéphane Raimbault <stephane.raimbault@gmail.com>
* README: Added information about the ANSI_QUOTES setting
server-side.
* stats/management/commands/migrate.py: Removed stupid pdb call
from my previous commit.
* stats/urls.py: Added comment.
2008-11-02 Stéphane Raimbault <stephane.raimbault@gmail.com>
* stats/conf/settings_sample.py: Added setting to use an external
MySQL database.
* stats/management/commands/migrate.py: Use the new settings. Fix
return from migrate_stats when the old_statistics table doesn't
exist.
2008-11-01 Claude Paroz <claude@2xlibre.net>
* stats/management/commands/migrate.py: 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/models.py: Changed model (category is now the manytomany
intermediate table between branch and release, permitting a branch to be
in multiple releases.
* stats/urls.py: Add the '+' char as a valid char for module name (for
gtk+).
* docs/DataModel.odg: Updated.
2008-11-01 Stéphane Raimbault <stephane.raimbault@gmail.com>
* stats/urls.py: Removed incorrect '*' in regexp on toplevel
URL (repeats the previous expression). Use simpler [\w-] instead
of (\w|-).
2008-11-01 Stéphane Raimbault <stephane.raimbault@gmail.com>
* stats/urls.py: Fixed URL parsing for module and branch
names. Stricter with release ID and team names.
2008-11-01 Stéphane Raimbault <stephane.raimbault@gmail.com>
* stats/models.py: Fixed invalid SQL query (detected by
PostgreSQL). Code formatting cleanups.
2008-10-28 Claude Paroz <claude@2xlibre.net>
* TODO:
* stats/defaults.py: Deleted, all settings now in stats/conf/settings.py
* templates/base.html: Get LANGUAGE_CODE from global function.
2008-10-28 Claude Paroz <claude@2xlibre.net>
* stats/models.py: Missing branch name in po file name produced by
update-stats.
* stats/views.py: Fixed typo in template name.
* templates/index.html:
* TODO: Hardcoded '/stats/teams' in index.html fixed.
2008-10-28 Stéphane Raimbault <stephane.raimbault@gmail.com>
* README:
* settings_sample.py: Notes about databases configuration.
2008-10-27 Claude Paroz <claude@2xlibre.net>
* stats/models.py: Language has no 'Language' field, but 'language'.
* templates/module.html: Use person_base to display maintainers.
2008-10-27 Claude Paroz <claude@2xlibre.net>
* stats/conf/settings_sample.py: Herit DATABASE_ENGINE setting.
* stats/models.py: 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/views.py: 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 <stephane.raimbault@gmail.com>
* TODO: Add some items
* stats/models.py: Add some get_absolute_url. Don't escape release
name with PostgreSQL.
* stats/urls.py: Add explicit names.
* stats/views.py: 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
files.
* urls.py: Define the index view.
2008-10-26 Stéphane Raimbault <stephane.raimbault@gmail.com>
* stats/views.py:
* 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 <stephane.raimbault@gmail.com>
* stats/admin.py:
* stats/urls.py:
* templates/list-modules.html:
* templates/person-base.html:
* urls.py: Removed constraint on the project name (easier to
deploy).
2008-10-26 Stéphane Raimbault <stephane.raimbault@gmail.com>
* stats/conf_settings_sample.py: Renamed from settings.py 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 <stephane.raimbault@gmail.com>
* stats/models.py: Fix plural forms in admin interface.
2008-10-26 Stéphane Raimbault <stephane.raimbault@gmail.com>
* stats/management/commands/migrate.py: SVN is our memory :)
* stats/management/commands/update-stats.py: Minor changes.
2008-10-26 Stéphane Raimbault <stephane.raimbault@gmail.com>
* README: Added note about Sites setting.
* TODO: Added item to use username instead of person_id.
* stats/models.py: Defined get_absolute_url for Person. Explicit
relation name between coordinator and person to not mix up with
'groups'.
* stats/urls.py: Use a generic view for person.
* stats/views.py: 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 <stephane.raimbault@gmail.com>
* stats/admin.py: Added Person to admin interface.
2008-10-25 Claude Paroz <claude@2xlibre.net>
* stats/admin.py: Added more objects to admin interface.
* stats/models.py: Added more __unicode__ functions and ordering table
attribute for better display in admin mode.
2008-10-24 Claude Paroz <claude@2xlibre.net>
* stats/management/commands/compile-trans.py:
* stats/management/commands/update-trans.py: Added scripts to manage
translations (wrappers to makemessages and compilemessages).
* stats/management/commands/migrate.py: Don't migrate Stats, they should
be regenerated by update-stats script.
* stats/utils.py: Removed N_ shortcut, because strings are not extracted.
* stats/models.py: Reworked Statistics (old fields removed, field names
lowercased).
* templates/language-release-stats.html: Use lowercase field names from
Statistics.
2008-10-24 Claude Paroz <claude@2xlibre.net>
* TODO: update-stats is now complete.
* settings_sample.py: Use locale middleware.
* stats/models.py: Coerce percentages to int type. Quote release table as
it is a protected word in mysql.
* templates/team.html:
* stats/views.py: 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 <claude@2xlibre.net>
* stats/models.py: Finished update-stats implementation.
* stats/utils.py: 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 <claude@2xlibre.net>
* README: Add stats/conf/settings.py notice.
* stats/conf/settings.py: Remove my local paths
* stats/management/commands/migrate.py: Take xml_base value from settings.
Don't import nobody.png in database.
* stats/urls.py: Take static document_root from settings.
* templates/person-base.html: nobody.png is not any more in DB.
2008-10-23 Stéphane Raimbault <stephane.raimbault@gmail.com>
* stats/urls.py: Fixed argument for Team.
* templates/person-base.html: Reverted missing webroot.
2008-10-23 Stéphane Raimbault <stephane.raimbault@gmail.com>
* settings_sample.py: Removed one template setting.
* stats/templates/*.tmpl:
* stats/views.py:
* templates/*.html: Moved all templates to /templates.
Rename .tmpl to .html (HTML mode and Django convention).
2008-10-23 Stéphane Raimbault <stephane.raimbault@gmail.com>
* stats/models.py:
* stats/templates/module-images.tmpl:
* stats/templates/show-stats.tmpl: Replace remaining URLs to /data
* stats/urls.py: Remove the old URL pattern to Claude's directory :)
2008-10-23 Stéphane Raimbault <stephane.raimbault@gmail.com>
Migrate all the static data from /stats/data to /media.
Update all templates and CSS files.
Use specific paths for img, css and js.
* settings_sample.py: Added new STATIC_SERVE setting.
* stats/urls.py: Added URL pattern to static Django view (only for
development purpose).
2008-10-23 Stéphane Raimbault <stephane.raimbault@gmail.com>
* vertimus/models.py: Fixed test of Vertimus.
2008-10-23 Stéphane Raimbault <stephane.raimbault@gmail.com>
* stats/templates/list-teams.tmpl:
* stats/templates/person-base.tmpl:
* stats/urls.py:
* stats/views.py:
* vertimus/models.py: Fixed using of lang_code for Team.
2008-10-23 Stéphane Raimbault <stephane.raimbault@gmail.com>
* stats/models.py: Add a convenient property to get Person
fullname.
2008-10-23 Stéphane Raimbault <stephane.raimbault@gmail.com>
* stats/management/commands/migrate.py:
* stats/models.py:
* stats/templates/module-images.tmpl:
* stats/templates/module.tmpl:
* stats/utils.py: PEP-8 but I don't want to touch Statistics and
Information for now :-/
2008-10-22 Stéphane Raimbault <stephane.raimbault@gmail.com>
* Fixed svn:ignore property.
2008-10-22 Stéphane Raimbault <stephane.raimbault@gmail.com>
* settings_sample.py: Renamed from settings.py to avoid wrong
commits. Added to svn:ignore property.
* README: Added note to rename the file at installation
2008-10-22 Stéphane Raimbault <stephane.raimbault@gmail.com>
Updated Person and Team classes.
* stats/management/commands/migrate.py: Removed app argument. Try
to split first name and last name. Use svn_accound or email for
username.
* stats/models.py: 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/utils.py: PEP-8 changes.
2008-10-22 Claude Paroz <claude@2xlibre.net>
* stats/conf/settings.py: Added conf variables for notifications.
* stats/models.py: Progress with updating statistics (still WIP for docs).
* stats/potdiff.py: Copied from legacy damned lies.
* stats/utils.py: Added several utility functions for updating statistics.
2008-10-22 Claude Paroz <claude@2xlibre.net>
* stats/management/commands/migrate.py: Allow to migrate with a fresh
damned-lies checkout (xml.in files).
2008-10-22 Claude Paroz <claude@2xlibre.net>
* docs/DataModel.odg: Added vcs_subdir to branch table.
* stats/conf/settings.py: Added DEBUG variable (referring to global DEBUG)
* stats/management/commands/migrate.py: Populate vcs_subpath.
* stats/management/commands/update-stats.py: Added script to update
statistics.
* stats/models.py: 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 <stephane.raimbault@gmail.com>
Initial and rough commit of Vertimus features.
2008-10-20 Claude Paroz <claude@2xlibre.net>
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 (danilo@gnome.org). This implementation has been
written by Claude Paroz (claude@2xlibre.net).
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 (http://transifex.org).
Installation
============
1 - Rename settings_sample.py in settings.py
2 - Review and fill in settings in stats/conf/settings_sample.py and
rename it to settings.py (please refer to Database configuration
below for more informations).
3 - Run 'python manage.py syncdb'
4 - Configure Sites in admin interface to define the 'View on site'
link.
Databases
=========
It's important to use the Unix Domain Socket connection to obtain good
performances.
PostgreSQL
----------
You just need to define DATABASE_ENGINE = 'postgresql_psycopg2' and DATABASE_NAME. Leave DATABASE_HOST setting empty to use UDS.
MySQL
-----
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;'
In settings.py:
DATABASE_HOST = '/var/run/mysqld/mysqld.sock'
DATABASE_OPTIONS = {
'read_default_file': '/etc/mysql/my.cnf',
"init_command": "SET storage_engine=INNODB"
}
Grep for ANSI_QUOTES in the source code to find the models.py 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
mode: http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html
(sql-mode="ANSI_QUOTES" in my.cnf) but it can be dangerous for other
applications.
Running as CGI
==============
If you don't won't to setup Django with mod_python, there is a tutorial
on the Django Wiki:
http://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/
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 <danilo@gnome.org>.
# Copyright (c) 2008 Claude Paroz <claude@2xlibre.net>.
#
# 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
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# 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]
templist.sort()
return [obj_ for (key1, obj_) in templist]
# -*- coding: utf-8 -*-
#
# Copyright (c) 2008 Claude Paroz <claude@2xlibre.net>.
#
# 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
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# 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 = ''
else:
translator_credits = translator_credits.split('\n')
context = {
'pageSection': 'home',
'translator_credits': translator_credits
}
return render_to_response('index.html', context)
#! /bin/sh
### BEGIN INIT INFO
# Provides: FastCGI servers for Django
# Required-Start: networking
# Required-Stop: networking
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: Start FastCGI servers with Django.
# Description: Django, in order to operate with FastCGI, must be started
# in a very specific way with manage.py. This must be done
# for each DJango web server that has to run.
### END INIT INFO
#
# Author: Guillermo Fernandez Castellanos
# <guillermo.fernandez.castellanos AT gmail.com>.
#
# Version: @(#)fastcgi 0.1 11-Jan-2007 guillermo.fernandez.castellanos AT gmail.com
#
#### SERVER SPECIFIC CONFIGURATION
DJANGO_SITES="djamnedlies"
SITES_PATH=/var/www
RUNFILES_PATH=$SITES_PATH/run
HOST=127.0.0.1
PORT_START=3000
RUN_AS=user
#### DO NOT CHANGE ANYTHING AFTER THIS LINE!
set -e
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="FastCGI servers"
NAME=$0
SCRIPTNAME=/etc/init.d/$NAME
#
# Function that starts the daemon/service.
#
d_start()
{
# Starting all Django FastCGI processes
PORT=$PORT_START
for SITE in $DJANGO_SITES
do
echo -n ", $SITE"
if [ -f $RUNFILES_PATH/$SITE.pid ]; then
echo -n " already running"
else
start-stop-daemon --start --quiet \
--pidfile $RUNFILES_PATH/$SITE.pid \
--chuid $RUN_AS --exec /usr/bin/env -- python \
$SITES_PATH/$SITE/manage.py runfcgi method=threaded \
protocol=scgi host=$HOST port=$PORT pidfile=$RUNFILES_PATH/$SITE.pid
chmod 400 $RUNFILES_PATH/$SITE.pid
fi
let "PORT = $PORT + 1"
done
}
#
# Function that stops the daemon/service.
#
d_stop() {
# Killing all Django FastCGI processes running
for SITE in $DJANGO_SITES
do
echo -n ", $SITE"
start-stop-daemon --stop --quiet --pidfile $RUNFILES_PATH/$SITE.pid \
|| echo -n " not running"
if [ -f $RUNFILES_PATH/$SITE.pid ]; then
rm $RUNFILES_PATH/$SITE.pid
fi
done
}
ACTION="$1"
case "$ACTION" in
start)
echo -n "Starting $DESC: $NAME"
d_start
echo "."
;;
stop)
echo -n "Stopping $DESC: $NAME"
d_stop