diff --git a/.gitignore b/.gitignore index ffecd6ba..4b767908 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,13 @@ .ropeproject *.swp *.sw? +.project +.pydevproject +.settings/ +htmlcov/* +truffe2/.coverage truffe2/db.sqlite3 venv/* -truffe2/.idea/* \ No newline at end of file +truffe2/.idea/* + diff --git a/Deployement/django.py b/Deployement/django.py index 7b202ad3..441254ee 100644 --- a/Deployement/django.py +++ b/Deployement/django.py @@ -168,7 +168,6 @@ def chmod_and_chown(): def sync_databases(): """Sync django databases""" with cd('/var/www/git-repo/truffe2/truffe2'): - sudo("python manage.py syncdb --noinput") sudo("python manage.py migrate --noinput") diff --git a/README.md b/README.md index 99198398..b5e4f767 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ Truffe 2 is licensed under the [BSD](http://opensource.org/licenses/BSD-2-Clause * Cedric Cook (Fixed a typo) * Yolan Romailler (Fixed a path) * Yann Beaud (Fixed VCARDs) +* Laurent Gay (Migration to Python3/Django3) ## Development @@ -38,16 +39,22 @@ Deployment scripts using fabric are located in the `Deployment` folder. ### Example development environment setup -1. Create a virtual Python environment: `virtualenv --python=/usr/bin/python2 venv` +1. Create a virtual Python 3 environment: `virtualenv --python=/usr/bin/python3 venv` 2. Activate it: `. ./venv/bin/activate` 3. Install dependencies: `pip install -r ./truffe2/data/pip-reqs.txt` 4. `cp ./truffe2/app/settingsLocal.py{.dist,}` 5. Edit `./truffe2/app/settingsLocal.py` and set the database engine to `django.db.backends.sqlite3` and database name to `db.sqlite3` 6. To be apple to see the mails sent from the application, run a [maildump](https://pypi.python.org/pypi/maildump) instance on port 1025 7. Go inside the `truffe2` directory for the next steps: `cd truffe2` -8. Create the database tables not managed by south with `python manage.py syncdb` -9. On OSX, if you get `ImportError: MagickWand shared library not found.`, it's probably because Python was not installed using MacPorts, you have to export MAGICK_HOME path. You should try to set the path with `export MAGICK_HOME=/opt/local` and go back to point 8. -10. Create the database tables managed by south with `python manage.py migrate` -11. Run the development server with `python manage.py runserver` -12. Go to `http://localhost:8000/` and log in with Tequila -13. Give your user superuser rights with `echo "update users_truffeuser set is_superuser=1 where id=1;" | sqlite3 db.sqlite3` \ No newline at end of file +8. On OSX, if you get `ImportError: MagickWand shared library not found.`, it's probably because Python was not installed using MacPorts, you have to export MAGICK_HOME path. You should try to set the path with `export MAGICK_HOME=/opt/local` and go back to point 8. +9. Create the database tables with `python manage.py migrate` +10. Run the development server with `python manage.py runserver` +11. Go to `http://localhost:8000/` and log in with Tequila +12. Give your user superuser rights with `echo "update users_truffeuser set is_superuser=1 where id=1;" | sqlite3 db.sqlite3` + +Those actions are setting in a script for Linux : `tools/install_venv.sh`. +2 Options for this script: + - `./tools/install_venv.sh noclean` : don't remove virtual Python environment, just delete SQLite DB file and reload a new DB. + - `./tools/install_venv.sh "" demo` : add examples of data for testing in DB (5 users: admin, user1, user2, user3, user4 with username as password). + +A new script, `tools/run_tests.sh`, allows to launch tests with code coverage. diff --git a/tools/install_venv.sh b/tools/install_venv.sh new file mode 100755 index 00000000..7753bfc2 --- /dev/null +++ b/tools/install_venv.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Script to install virtual environment for truffe2 for developpement +# --- DO NOT USE IN PRODUCTION MODE --- + +set -e +set +x + +project_dir="$(dirname $(dirname $(readlink -f "$0")))" + +if [ "$1" != "noclean" ] +then + rm -rf "$project_dir/venv" + python3 -m virtualenv --python python3.8 "$project_dir/venv" + + . "$project_dir/venv/bin/activate" + pip install -U pip + pip install -r "$project_dir/truffe2/data/pip-reqs.txt" +else + . "$project_dir/venv/bin/activate" +fi + +rm -rf "$project_dir/truffe2/db.sqlite3" +cp "$project_dir/tools/settingsLocal.py.test" "$project_dir/truffe2/app/settingsLocal.py" + +( + cd "$project_dir/truffe2" + python -Wd manage.py migrate + if [ "$2" == "demo" ] + then + echo 'from main.test_data import setup_testing_all_data; setup_testing_all_data()' | python -Wd manage.py shell + fi +) \ No newline at end of file diff --git a/tools/run_tests.sh b/tools/run_tests.sh new file mode 100755 index 00000000..e4c5655c --- /dev/null +++ b/tools/run_tests.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set +e +set +x + +project_dir=$(dirname $(dirname $(readlink -f "$0"))) + +rm -rf $project_dir/htmlcov +. $project_dir/venv/bin/activate + +cd $project_dir/truffe2 +python -m pip install -U coverage >/dev/null +python -m coverage erase +python -Wd -m coverage run --branch --source=. manage.py test +# python -m coverage report +python -m coverage html -d $project_dir/htmlcov + +deactivate diff --git a/tools/settingsLocal.py.test b/tools/settingsLocal.py.test new file mode 100644 index 00000000..660ea5aa --- /dev/null +++ b/tools/settingsLocal.py.test @@ -0,0 +1,57 @@ +from os.path import join, dirname, abspath +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': join(dirname(dirname(abspath(__file__))), 'db.sqlite3'), + } +} + +SECRET_KEY = "_____________________________________________________" + +# Deactivate Haystack indexing on save +HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.BaseSignalProcessor' + +# Logging to console, for debug :) +LOGGING = { + 'disable_existing_loggers': False, + 'version': 1, + 'formatters': { + 'verbose': { + 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s' + }, + 'simple': { + 'format': '%(levelname)s %(message)s' + }, + }, + 'handlers': { + 'console': { + 'level': 'DEBUG', + 'class': 'logging.StreamHandler', + 'formatter': 'simple' + }, + }, + 'loggers': { + 'django': { + 'handlers': ['console'], + 'level': 'DEBUG', + 'propagate': True, + }, + + 'django.template': { + 'handlers': ['console'], + 'level': 'INFO', + 'propagate': True, + }, + + 'django.db.backends': { + 'handlers': ['console'], + 'level': 'ERROR', + 'propagate': False, + }, + }, +} + +EMAIL_HOST = 'localhost' +EMAIL_PORT = 1025 + +TEQUILA_ALLOW_GUEST = True # used for test diff --git a/truffe2/accounting_core/migrations/0001_initial.py b/truffe2/accounting_core/migrations/0001_initial.py index 8fb5713e..35df9de3 100644 --- a/truffe2/accounting_core/migrations/0001_initial.py +++ b/truffe2/accounting_core/migrations/0001_initial.py @@ -1,103 +1,274 @@ # -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals +from django.db import models, migrations +import accounting_core.utils +import generic.search +import rights.utils +import generic.models +from django.conf import settings -class Migration(SchemaMigration): - def forwards(self, orm): - # Adding model 'AccountingYear' - db.create_table(u'accounting_core_accountingyear', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('deleted', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=255)), - ('start_date', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)), - ('end_date', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)), - ('status', self.gf('django.db.models.fields.CharField')(default='0_preparing', max_length=255)), - )) - db.send_create_signal(u'accounting_core', ['AccountingYear']) +class Migration(migrations.Migration): - # Adding model 'AccountingYearLogging' - db.create_table(u'accounting_core_accountingyearlogging', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('extra_data', self.gf('django.db.models.fields.TextField')(blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('what', self.gf('django.db.models.fields.CharField')(max_length=64)), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='logs', to=orm['accounting_core.AccountingYear'])), - )) - db.send_create_signal(u'accounting_core', ['AccountingYearLogging']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('units', '__first__'), + ] - - def backwards(self, orm): - # Deleting model 'AccountingYear' - db.delete_table(u'accounting_core_accountingyear') - - # Deleting model 'AccountingYearLogging' - db.delete_table(u'accounting_core_accountingyearlogging') - - - models = { - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}) - }, - u'accounting_core.accountingyearlogging': { - 'Meta': {'object_name': 'AccountingYearLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountingYear']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '255'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_core'] \ No newline at end of file + operations = [ + migrations.CreateModel( + name='Account', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('deleted', models.BooleanField(default=False)), + ('name', models.CharField(max_length=255, verbose_name='Nom du compte')), + ('account_number', models.CharField(max_length=10, verbose_name='Num\xe9ro du compte')), + ('visibility', models.CharField(max_length=50, verbose_name='Visibilit\xe9 dans les documents comptables', choices=[(b'all', 'Visible \xe0 tous'), (b'cdd', 'Visible au Comit\xe9 de Direction uniquement'), (b'root', 'Visible aux personnes qui g\xe8re la comptabilit\xe9 g\xe9n\xe9rale'), (b'none', 'Visible \xe0 personne')])), + ('description', models.TextField(null=True, verbose_name='Description', blank=True)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model, accounting_core.utils.AccountingYearLinked, rights.utils.AgepolyEditableModel, generic.search.SearchableModel), + ), + migrations.CreateModel( + name='AccountCategory', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('deleted', models.BooleanField(default=False)), + ('name', models.CharField(max_length=255, verbose_name='Nom de la cat\xe9gorie')), + ('order', models.SmallIntegerField(default=0, help_text="Le plus petit d'abord", verbose_name='Ordre dans le plan comptable')), + ('description', models.TextField(null=True, verbose_name='Description', blank=True)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model, accounting_core.utils.AccountingYearLinked, rights.utils.AgepolyEditableModel, generic.search.SearchableModel), + ), + migrations.CreateModel( + name='AccountCategoryLogging', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('extra_data', models.TextField(blank=True)), + ('what', models.CharField(max_length=64, choices=[(b'imported', 'Import\xe9 depuis Truffe 1'), (b'created', 'Creation'), (b'edited', 'Edit\xe9'), (b'deleted', 'Supprim\xe9'), (b'restored', 'Restaur\xe9'), (b'state_changed', 'Statut chang\xe9'), (b'file_added', 'Fichier ajout\xe9'), (b'file_removed', 'Fichier supprim\xe9')])), + ('object', models.ForeignKey(related_name='logs', to='accounting_core.AccountCategory', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='AccountCategoryViews', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('object', models.ForeignKey(related_name='views', to='accounting_core.AccountCategory', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='AccountingYear', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('deleted', models.BooleanField(default=False)), + ('name', models.CharField(unique=True, max_length=255, verbose_name='Nom')), + ('start_date', models.DateTimeField(null=True, verbose_name='Date de d\xe9but', blank=True)), + ('end_date', models.DateTimeField(null=True, verbose_name='Date de fin', blank=True)), + ('subvention_deadline', models.DateTimeField(null=True, verbose_name='D\xe9lai pour les subventions', blank=True)), + ('last_accounting_import', models.DateTimeField(null=True, verbose_name='Dernier import de la compta', blank=True)), + ('status', models.CharField(default=b'0_preparing', max_length=255, choices=[(b'1_active', 'Ann\xe9e active'), (b'3_archived', 'Ann\xe9e archiv\xe9e'), (b'0_preparing', 'En pr\xe9paration'), (b'2_closing', 'En cl\xf4ture')])), + ], + options={ + 'abstract': False, + }, + bases=(models.Model, generic.models.GenericStateModel, rights.utils.AgepolyEditableModel, generic.search.SearchableModel), + ), + migrations.CreateModel( + name='AccountingYearLogging', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('extra_data', models.TextField(blank=True)), + ('what', models.CharField(max_length=64, choices=[(b'imported', 'Import\xe9 depuis Truffe 1'), (b'created', 'Creation'), (b'edited', 'Edit\xe9'), (b'deleted', 'Supprim\xe9'), (b'restored', 'Restaur\xe9'), (b'state_changed', 'Statut chang\xe9'), (b'file_added', 'Fichier ajout\xe9'), (b'file_removed', 'Fichier supprim\xe9')])), + ('object', models.ForeignKey(related_name='logs', to='accounting_core.AccountingYear', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='AccountingYearViews', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('object', models.ForeignKey(related_name='views', to='accounting_core.AccountingYear', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='AccountLogging', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('extra_data', models.TextField(blank=True)), + ('what', models.CharField(max_length=64, choices=[(b'imported', 'Import\xe9 depuis Truffe 1'), (b'created', 'Creation'), (b'edited', 'Edit\xe9'), (b'deleted', 'Supprim\xe9'), (b'restored', 'Restaur\xe9'), (b'state_changed', 'Statut chang\xe9'), (b'file_added', 'Fichier ajout\xe9'), (b'file_removed', 'Fichier supprim\xe9')])), + ('object', models.ForeignKey(related_name='logs', to='accounting_core.Account', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='AccountViews', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('object', models.ForeignKey(related_name='views', to='accounting_core.Account', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='CostCenter', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('deleted', models.BooleanField(default=False)), + ('name', models.CharField(max_length=255, verbose_name='Nom du centre de co\xfbt')), + ('account_number', models.CharField(max_length=10, verbose_name='Num\xe9ro associ\xe9 au centre de co\xfbt')), + ('description', models.TextField(null=True, verbose_name='Description', blank=True)), + ('accounting_year', models.ForeignKey(verbose_name='Ann\xe9e comptable', to='accounting_core.AccountingYear', on_delete=models.deletion.PROTECT)), + ('unit', models.ForeignKey(verbose_name='Appartient \xe0', to='units.Unit', on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model, accounting_core.utils.AccountingYearLinked, rights.utils.AgepolyEditableModel, generic.search.SearchableModel), + ), + migrations.CreateModel( + name='CostCenterLogging', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('extra_data', models.TextField(blank=True)), + ('what', models.CharField(max_length=64, choices=[(b'imported', 'Import\xe9 depuis Truffe 1'), (b'created', 'Creation'), (b'edited', 'Edit\xe9'), (b'deleted', 'Supprim\xe9'), (b'restored', 'Restaur\xe9'), (b'state_changed', 'Statut chang\xe9'), (b'file_added', 'Fichier ajout\xe9'), (b'file_removed', 'Fichier supprim\xe9')])), + ('object', models.ForeignKey(related_name='logs', to='accounting_core.CostCenter', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='CostCenterViews', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('object', models.ForeignKey(related_name='views', to='accounting_core.CostCenter', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='TVA', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('deleted', models.BooleanField(default=False)), + ('name', models.CharField(max_length=255, verbose_name='Nom de la TVA')), + ('value', models.DecimalField(verbose_name='Valeur (%)', max_digits=20, decimal_places=2)), + ('agepoly_only', models.BooleanField(default=False, verbose_name="Limiter l'usage au comit\xe9 de l'AGEPoly")), + ('code', models.CharField(max_length=255, verbose_name='Code de TVA')), + ('account', models.ForeignKey(verbose_name='Compte de TVA', to='accounting_core.Account', on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model, rights.utils.AgepolyEditableModel, generic.search.SearchableModel), + ), + migrations.CreateModel( + name='TVALogging', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('extra_data', models.TextField(blank=True)), + ('what', models.CharField(max_length=64, choices=[(b'imported', 'Import\xe9 depuis Truffe 1'), (b'created', 'Creation'), (b'edited', 'Edit\xe9'), (b'deleted', 'Supprim\xe9'), (b'restored', 'Restaur\xe9'), (b'state_changed', 'Statut chang\xe9'), (b'file_added', 'Fichier ajout\xe9'), (b'file_removed', 'Fichier supprim\xe9')])), + ('object', models.ForeignKey(related_name='logs', to='accounting_core.TVA', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='TVAViews', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('object', models.ForeignKey(related_name='views', to='accounting_core.TVA', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.AlterUniqueTogether( + name='costcenter', + unique_together=set([('name', 'accounting_year'), ('account_number', 'accounting_year')]), + ), + migrations.AddField( + model_name='accountcategory', + name='accounting_year', + field=models.ForeignKey(verbose_name='Ann\xe9e comptable', to='accounting_core.AccountingYear', on_delete=models.deletion.PROTECT), + preserve_default=True, + ), + migrations.AddField( + model_name='accountcategory', + name='parent_hierarchique', + field=models.ForeignKey(blank=True, to='accounting_core.AccountCategory', help_text='Cat\xe9gorie parente pour la hi\xe9rarchie', null=True, on_delete=models.deletion.SET_NULL), + preserve_default=True, + ), + migrations.AlterUniqueTogether( + name='accountcategory', + unique_together=set([('name', 'accounting_year')]), + ), + migrations.AddField( + model_name='account', + name='accounting_year', + field=models.ForeignKey(verbose_name='Ann\xe9e comptable', to='accounting_core.AccountingYear', on_delete=models.deletion.PROTECT), + preserve_default=True, + ), + migrations.AddField( + model_name='account', + name='category', + field=models.ForeignKey(verbose_name='Cat\xe9gorie', to='accounting_core.AccountCategory', on_delete=models.deletion.PROTECT), + preserve_default=True, + ), + migrations.AlterUniqueTogether( + name='account', + unique_together=set([('name', 'accounting_year'), ('account_number', 'accounting_year')]), + ), + ] diff --git a/truffe2/accounting_core/migrations/0002_auto_20201104_1648.py b/truffe2/accounting_core/migrations/0002_auto_20201104_1648.py new file mode 100644 index 00000000..fd21c317 --- /dev/null +++ b/truffe2/accounting_core/migrations/0002_auto_20201104_1648.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2020-11-04 15:48 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('accounting_core', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='account', + name='name', + field=models.CharField(default=b'---', max_length=255, verbose_name='Nom du compte'), + ), + migrations.AlterField( + model_name='accountcategory', + name='name', + field=models.CharField(default=b'---', max_length=255, verbose_name='Nom de la cat\xe9gorie'), + ), + migrations.AlterField( + model_name='accountingyear', + name='name', + field=models.CharField(default=b'---', max_length=255, unique=True, verbose_name='Nom'), + ), + migrations.AlterField( + model_name='costcenter', + name='name', + field=models.CharField(default=b'---', max_length=255, verbose_name='Nom du centre de co\xfbt'), + ), + migrations.AlterField( + model_name='tva', + name='name', + field=models.CharField(default=b'---', max_length=255, verbose_name='Nom de la TVA'), + ), + ] diff --git a/truffe2/accounting_core/migrations/0002_auto__add_dummypony__add_dummyponylogging.py b/truffe2/accounting_core/migrations/0002_auto__add_dummypony__add_dummyponylogging.py deleted file mode 100644 index a39652e8..00000000 --- a/truffe2/accounting_core/migrations/0002_auto__add_dummypony__add_dummyponylogging.py +++ /dev/null @@ -1,115 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'DummyPony' - db.create_table(u'accounting_core_dummypony', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('deleted', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=255)), - )) - db.send_create_signal(u'accounting_core', ['DummyPony']) - - # Adding model 'DummyPonyLogging' - db.create_table(u'accounting_core_dummyponylogging', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('extra_data', self.gf('django.db.models.fields.TextField')(blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('what', self.gf('django.db.models.fields.CharField')(max_length=64)), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='logs', to=orm['accounting_core.DummyPony'])), - )) - db.send_create_signal(u'accounting_core', ['DummyPonyLogging']) - - - def backwards(self, orm): - # Deleting model 'DummyPony' - db.delete_table(u'accounting_core_dummypony') - - # Deleting model 'DummyPonyLogging' - db.delete_table(u'accounting_core_dummyponylogging') - - - models = { - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}) - }, - u'accounting_core.accountingyearlogging': { - 'Meta': {'object_name': 'AccountingYearLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountingYear']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.dummypony': { - 'Meta': {'object_name': 'DummyPony'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - }, - u'accounting_core.dummyponylogging': { - 'Meta': {'object_name': 'DummyPonyLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.DummyPony']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '255'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_core'] \ No newline at end of file diff --git a/truffe2/accounting_core/migrations/0003_auto_20210210_1832.py b/truffe2/accounting_core/migrations/0003_auto_20210210_1832.py new file mode 100644 index 00000000..1ba08697 --- /dev/null +++ b/truffe2/accounting_core/migrations/0003_auto_20210210_1832.py @@ -0,0 +1,130 @@ +# Generated by Django 2.2.18 on 2021-02-10 17:32 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('accounting_core', '0002_auto_20201104_1648'), + ] + + operations = [ + migrations.AlterField( + model_name='account', + name='name', + field=models.CharField(default='---', max_length=255, verbose_name='Nom du compte'), + ), + migrations.AlterField( + model_name='account', + name='visibility', + field=models.CharField(choices=[('all', 'Visible à tous'), ('cdd', 'Visible au Comité de Direction uniquement'), ('root', 'Visible aux personnes qui gère la comptabilité générale'), ('none', 'Visible à personne')], max_length=50, verbose_name='Visibilité dans les documents comptables'), + ), + migrations.AlterField( + model_name='accountcategory', + name='name', + field=models.CharField(default='---', max_length=255, verbose_name='Nom de la catégorie'), + ), + migrations.AlterField( + model_name='accountcategory', + name='parent_hierarchique', + field=models.ForeignKey(blank=True, help_text='Catégorie parente pour la hiérarchie', null=True, on_delete=django.db.models.deletion.PROTECT, to='accounting_core.AccountCategory'), + ), + migrations.AlterField( + model_name='accountcategorylogging', + name='what', + field=models.CharField(choices=[('imported', 'Importé depuis Truffe 1'), ('created', 'Creation'), ('edited', 'Edité'), ('deleted', 'Supprimé'), ('restored', 'Restauré'), ('state_changed', 'Statut changé'), ('file_added', 'Fichier ajouté'), ('file_removed', 'Fichier supprimé')], max_length=64), + ), + migrations.AlterField( + model_name='accountcategorylogging', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='accountcategoryviews', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='accountingyear', + name='name', + field=models.CharField(default='---', max_length=255, unique=True, verbose_name='Nom'), + ), + migrations.AlterField( + model_name='accountingyear', + name='status', + field=models.CharField(choices=[('0_preparing', 'En préparation'), ('1_active', 'Année active'), ('2_closing', 'En clôture'), ('3_archived', 'Année archivée')], default='0_preparing', max_length=255), + ), + migrations.AlterField( + model_name='accountingyearlogging', + name='what', + field=models.CharField(choices=[('imported', 'Importé depuis Truffe 1'), ('created', 'Creation'), ('edited', 'Edité'), ('deleted', 'Supprimé'), ('restored', 'Restauré'), ('state_changed', 'Statut changé'), ('file_added', 'Fichier ajouté'), ('file_removed', 'Fichier supprimé')], max_length=64), + ), + migrations.AlterField( + model_name='accountingyearlogging', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='accountingyearviews', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='accountlogging', + name='what', + field=models.CharField(choices=[('imported', 'Importé depuis Truffe 1'), ('created', 'Creation'), ('edited', 'Edité'), ('deleted', 'Supprimé'), ('restored', 'Restauré'), ('state_changed', 'Statut changé'), ('file_added', 'Fichier ajouté'), ('file_removed', 'Fichier supprimé')], max_length=64), + ), + migrations.AlterField( + model_name='accountlogging', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='accountviews', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='costcenter', + name='name', + field=models.CharField(default='---', max_length=255, verbose_name='Nom du centre de coût'), + ), + migrations.AlterField( + model_name='costcenterlogging', + name='what', + field=models.CharField(choices=[('imported', 'Importé depuis Truffe 1'), ('created', 'Creation'), ('edited', 'Edité'), ('deleted', 'Supprimé'), ('restored', 'Restauré'), ('state_changed', 'Statut changé'), ('file_added', 'Fichier ajouté'), ('file_removed', 'Fichier supprimé')], max_length=64), + ), + migrations.AlterField( + model_name='costcenterlogging', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='costcenterviews', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='tva', + name='name', + field=models.CharField(default='---', max_length=255, verbose_name='Nom de la TVA'), + ), + migrations.AlterField( + model_name='tvalogging', + name='what', + field=models.CharField(choices=[('imported', 'Importé depuis Truffe 1'), ('created', 'Creation'), ('edited', 'Edité'), ('deleted', 'Supprimé'), ('restored', 'Restauré'), ('state_changed', 'Statut changé'), ('file_added', 'Fichier ajouté'), ('file_removed', 'Fichier supprimé')], max_length=64), + ), + migrations.AlterField( + model_name='tvalogging', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='tvaviews', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/truffe2/accounting_core/migrations/0003_auto__add_field_dummypony_accounting_year.py b/truffe2/accounting_core/migrations/0003_auto__add_field_dummypony_accounting_year.py deleted file mode 100644 index 68fbd0c0..00000000 --- a/truffe2/accounting_core/migrations/0003_auto__add_field_dummypony_accounting_year.py +++ /dev/null @@ -1,99 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'DummyPony.accounting_year' - db.add_column(u'accounting_core_dummypony', 'accounting_year', - self.gf('django.db.models.fields.related.ForeignKey')(default=1, to=orm['accounting_core.AccountingYear']), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'DummyPony.accounting_year' - db.delete_column(u'accounting_core_dummypony', 'accounting_year_id') - - - models = { - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}) - }, - u'accounting_core.accountingyearlogging': { - 'Meta': {'object_name': 'AccountingYearLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountingYear']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.dummypony': { - 'Meta': {'object_name': 'DummyPony'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - }, - u'accounting_core.dummyponylogging': { - 'Meta': {'object_name': 'DummyPonyLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.DummyPony']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '255'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_core'] \ No newline at end of file diff --git a/truffe2/accounting_core/migrations/0004_auto__del_dummypony__del_dummyponylogging__add_costcenterlogging__add_.py b/truffe2/accounting_core/migrations/0004_auto__del_dummypony__del_dummyponylogging__add_costcenterlogging__add_.py deleted file mode 100644 index cfa3dca5..00000000 --- a/truffe2/accounting_core/migrations/0004_auto__del_dummypony__del_dummyponylogging__add_costcenterlogging__add_.py +++ /dev/null @@ -1,162 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting model 'DummyPony' - db.delete_table(u'accounting_core_dummypony') - - # Deleting model 'DummyPonyLogging' - db.delete_table(u'accounting_core_dummyponylogging') - - # Adding model 'CostCenterLogging' - db.create_table(u'accounting_core_costcenterlogging', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('extra_data', self.gf('django.db.models.fields.TextField')(blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('what', self.gf('django.db.models.fields.CharField')(max_length=64)), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='logs', to=orm['accounting_core.CostCenter'])), - )) - db.send_create_signal(u'accounting_core', ['CostCenterLogging']) - - # Adding model 'CostCenter' - db.create_table(u'accounting_core_costcenter', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('deleted', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=255)), - ('account_number', self.gf('django.db.models.fields.SmallIntegerField')(unique=True)), - ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('accounting_year', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['accounting_core.AccountingYear'])), - ('unit', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['units.Unit'])), - )) - db.send_create_signal(u'accounting_core', ['CostCenter']) - - - def backwards(self, orm): - # Adding model 'DummyPony' - db.create_table(u'accounting_core_dummypony', ( - ('deleted', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('accounting_year', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['accounting_core.AccountingYear'])), - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('name', self.gf('django.db.models.fields.CharField')(max_length=255, unique=True)), - )) - db.send_create_signal(u'accounting_core', ['DummyPony']) - - # Adding model 'DummyPonyLogging' - db.create_table(u'accounting_core_dummyponylogging', ( - ('what', self.gf('django.db.models.fields.CharField')(max_length=64)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='logs', to=orm['accounting_core.DummyPony'])), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('extra_data', self.gf('django.db.models.fields.TextField')(blank=True)), - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - )) - db.send_create_signal(u'accounting_core', ['DummyPonyLogging']) - - # Deleting model 'CostCenterLogging' - db.delete_table(u'accounting_core_costcenterlogging') - - # Deleting model 'CostCenter' - db.delete_table(u'accounting_core_costcenter') - - - models = { - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}) - }, - u'accounting_core.accountingyearlogging': { - 'Meta': {'object_name': 'AccountingYearLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountingYear']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.costcenter': { - 'Meta': {'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.SmallIntegerField', [], {'unique': 'True'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_core.costcenterlogging': { - 'Meta': {'object_name': 'CostCenterLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.CostCenter']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_core'] \ No newline at end of file diff --git a/truffe2/accounting_core/migrations/0005_auto__add_accountcategory__add_accountcategorylogging__add_account__ad.py b/truffe2/accounting_core/migrations/0005_auto__add_accountcategory__add_accountcategorylogging__add_account__ad.py deleted file mode 100644 index fbd7296d..00000000 --- a/truffe2/accounting_core/migrations/0005_auto__add_accountcategory__add_accountcategorylogging__add_account__ad.py +++ /dev/null @@ -1,203 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'AccountCategory' - db.create_table(u'accounting_core_accountcategory', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('deleted', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=255)), - ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('parent_hierarchique', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['accounting_core.AccountCategory'], null=True, blank=True)), - ('accounting_year', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['accounting_core.AccountingYear'])), - )) - db.send_create_signal(u'accounting_core', ['AccountCategory']) - - # Adding model 'AccountCategoryLogging' - db.create_table(u'accounting_core_accountcategorylogging', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('extra_data', self.gf('django.db.models.fields.TextField')(blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('what', self.gf('django.db.models.fields.CharField')(max_length=64)), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='logs', to=orm['accounting_core.AccountCategory'])), - )) - db.send_create_signal(u'accounting_core', ['AccountCategoryLogging']) - - # Adding model 'Account' - db.create_table(u'accounting_core_account', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('deleted', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=255)), - ('account_number', self.gf('django.db.models.fields.SmallIntegerField')(unique=True)), - ('visibility', self.gf('django.db.models.fields.CharField')(max_length=50)), - ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('accounting_year', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['accounting_core.AccountingYear'])), - ('category', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['accounting_core.AccountCategory'])), - )) - db.send_create_signal(u'accounting_core', ['Account']) - - # Adding model 'AccountLogging' - db.create_table(u'accounting_core_accountlogging', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('extra_data', self.gf('django.db.models.fields.TextField')(blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('what', self.gf('django.db.models.fields.CharField')(max_length=64)), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='logs', to=orm['accounting_core.Account'])), - )) - db.send_create_signal(u'accounting_core', ['AccountLogging']) - - - def backwards(self, orm): - # Deleting model 'AccountCategory' - db.delete_table(u'accounting_core_accountcategory') - - # Deleting model 'AccountCategoryLogging' - db.delete_table(u'accounting_core_accountcategorylogging') - - # Deleting model 'Account' - db.delete_table(u'accounting_core_account') - - # Deleting model 'AccountLogging' - db.delete_table(u'accounting_core_accountlogging') - - - models = { - u'accounting_core.account': { - 'Meta': {'object_name': 'Account'}, - 'account_number': ('django.db.models.fields.SmallIntegerField', [], {'unique': 'True'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'visibility': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'accounting_core.accountcategory': { - 'Meta': {'object_name': 'AccountCategory'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountcategorylogging': { - 'Meta': {'object_name': 'AccountCategoryLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountCategory']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}) - }, - u'accounting_core.accountingyearlogging': { - 'Meta': {'object_name': 'AccountingYearLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountingYear']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountlogging': { - 'Meta': {'object_name': 'AccountLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.Account']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.costcenter': { - 'Meta': {'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.SmallIntegerField', [], {'unique': 'True'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_core.costcenterlogging': { - 'Meta': {'object_name': 'CostCenterLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.CostCenter']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_core'] \ No newline at end of file diff --git a/truffe2/accounting_core/migrations/0006_auto__del_unique_accountcategory_name__add_unique_accountcategory_name.py b/truffe2/accounting_core/migrations/0006_auto__del_unique_accountcategory_name__add_unique_accountcategory_name.py deleted file mode 100644 index dcc136e4..00000000 --- a/truffe2/accounting_core/migrations/0006_auto__del_unique_accountcategory_name__add_unique_accountcategory_name.py +++ /dev/null @@ -1,157 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Removing unique constraint on 'AccountCategory', fields ['name'] - db.delete_unique(u'accounting_core_accountcategory', ['name']) - - # Adding unique constraint on 'AccountCategory', fields ['name', 'accounting_year'] - db.create_unique(u'accounting_core_accountcategory', ['name', 'accounting_year_id']) - - - def backwards(self, orm): - # Removing unique constraint on 'AccountCategory', fields ['name', 'accounting_year'] - db.delete_unique(u'accounting_core_accountcategory', ['name', 'accounting_year_id']) - - # Adding unique constraint on 'AccountCategory', fields ['name'] - db.create_unique(u'accounting_core_accountcategory', ['name']) - - - models = { - u'accounting_core.account': { - 'Meta': {'object_name': 'Account'}, - 'account_number': ('django.db.models.fields.SmallIntegerField', [], {'unique': 'True'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'visibility': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'accounting_core.accountcategory': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'AccountCategory'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountcategorylogging': { - 'Meta': {'object_name': 'AccountCategoryLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountCategory']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}) - }, - u'accounting_core.accountingyearlogging': { - 'Meta': {'object_name': 'AccountingYearLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountingYear']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountlogging': { - 'Meta': {'object_name': 'AccountLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.Account']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.costcenter': { - 'Meta': {'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.SmallIntegerField', [], {'unique': 'True'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_core.costcenterlogging': { - 'Meta': {'object_name': 'CostCenterLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.CostCenter']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_core'] \ No newline at end of file diff --git a/truffe2/accounting_core/migrations/0007_auto__del_unique_costcenter_name__add_unique_costcenter_name_accountin.py b/truffe2/accounting_core/migrations/0007_auto__del_unique_costcenter_name__add_unique_costcenter_name_accountin.py deleted file mode 100644 index bcdc729f..00000000 --- a/truffe2/accounting_core/migrations/0007_auto__del_unique_costcenter_name__add_unique_costcenter_name_accountin.py +++ /dev/null @@ -1,169 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Removing unique constraint on 'Account', fields ['name'] - db.delete_unique(u'accounting_core_account', ['name']) - - # Removing unique constraint on 'CostCenter', fields ['name'] - db.delete_unique(u'accounting_core_costcenter', ['name']) - - # Adding unique constraint on 'CostCenter', fields ['name', 'accounting_year'] - db.create_unique(u'accounting_core_costcenter', ['name', 'accounting_year_id']) - - # Adding unique constraint on 'Account', fields ['name', 'accounting_year'] - db.create_unique(u'accounting_core_account', ['name', 'accounting_year_id']) - - - def backwards(self, orm): - # Removing unique constraint on 'Account', fields ['name', 'accounting_year'] - db.delete_unique(u'accounting_core_account', ['name', 'accounting_year_id']) - - # Removing unique constraint on 'CostCenter', fields ['name', 'accounting_year'] - db.delete_unique(u'accounting_core_costcenter', ['name', 'accounting_year_id']) - - # Adding unique constraint on 'CostCenter', fields ['name'] - db.create_unique(u'accounting_core_costcenter', ['name']) - - # Adding unique constraint on 'Account', fields ['name'] - db.create_unique(u'accounting_core_account', ['name']) - - - models = { - u'accounting_core.account': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'Account'}, - 'account_number': ('django.db.models.fields.SmallIntegerField', [], {'unique': 'True'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'visibility': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'accounting_core.accountcategory': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'AccountCategory'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountcategorylogging': { - 'Meta': {'object_name': 'AccountCategoryLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountCategory']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}) - }, - u'accounting_core.accountingyearlogging': { - 'Meta': {'object_name': 'AccountingYearLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountingYear']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountlogging': { - 'Meta': {'object_name': 'AccountLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.Account']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.costcenter': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.SmallIntegerField', [], {'unique': 'True'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_core.costcenterlogging': { - 'Meta': {'object_name': 'CostCenterLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.CostCenter']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_core'] \ No newline at end of file diff --git a/truffe2/accounting_core/migrations/0008_auto__del_unique_costcenter_account_number__add_unique_costcenter_acco.py b/truffe2/accounting_core/migrations/0008_auto__del_unique_costcenter_account_number__add_unique_costcenter_acco.py deleted file mode 100644 index 7c3105df..00000000 --- a/truffe2/accounting_core/migrations/0008_auto__del_unique_costcenter_account_number__add_unique_costcenter_acco.py +++ /dev/null @@ -1,169 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Removing unique constraint on 'Account', fields ['account_number'] - db.delete_unique(u'accounting_core_account', ['account_number']) - - # Removing unique constraint on 'CostCenter', fields ['account_number'] - db.delete_unique(u'accounting_core_costcenter', ['account_number']) - - # Adding unique constraint on 'CostCenter', fields ['account_number', 'accounting_year'] - db.create_unique(u'accounting_core_costcenter', ['account_number', 'accounting_year_id']) - - # Adding unique constraint on 'Account', fields ['account_number', 'accounting_year'] - db.create_unique(u'accounting_core_account', ['account_number', 'accounting_year_id']) - - - def backwards(self, orm): - # Removing unique constraint on 'Account', fields ['account_number', 'accounting_year'] - db.delete_unique(u'accounting_core_account', ['account_number', 'accounting_year_id']) - - # Removing unique constraint on 'CostCenter', fields ['account_number', 'accounting_year'] - db.delete_unique(u'accounting_core_costcenter', ['account_number', 'accounting_year_id']) - - # Adding unique constraint on 'CostCenter', fields ['account_number'] - db.create_unique(u'accounting_core_costcenter', ['account_number']) - - # Adding unique constraint on 'Account', fields ['account_number'] - db.create_unique(u'accounting_core_account', ['account_number']) - - - models = { - u'accounting_core.account': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'Account'}, - 'account_number': ('django.db.models.fields.SmallIntegerField', [], {}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'visibility': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'accounting_core.accountcategory': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'AccountCategory'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountcategorylogging': { - 'Meta': {'object_name': 'AccountCategoryLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountCategory']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}) - }, - u'accounting_core.accountingyearlogging': { - 'Meta': {'object_name': 'AccountingYearLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountingYear']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountlogging': { - 'Meta': {'object_name': 'AccountLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.Account']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.costcenter': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.SmallIntegerField', [], {}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_core.costcenterlogging': { - 'Meta': {'object_name': 'CostCenterLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.CostCenter']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_core'] \ No newline at end of file diff --git a/truffe2/accounting_core/migrations/0009_auto__chg_field_costcenter_account_number__chg_field_account_account_n.py b/truffe2/accounting_core/migrations/0009_auto__chg_field_costcenter_account_number__chg_field_account_account_n.py deleted file mode 100644 index a28afa03..00000000 --- a/truffe2/accounting_core/migrations/0009_auto__chg_field_costcenter_account_number__chg_field_account_account_n.py +++ /dev/null @@ -1,157 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Changing field 'CostCenter.account_number' - db.alter_column(u'accounting_core_costcenter', 'account_number', self.gf('django.db.models.fields.CharField')(max_length=10)) - - # Changing field 'Account.account_number' - db.alter_column(u'accounting_core_account', 'account_number', self.gf('django.db.models.fields.CharField')(max_length=10)) - - def backwards(self, orm): - - # Changing field 'CostCenter.account_number' - db.alter_column(u'accounting_core_costcenter', 'account_number', self.gf('django.db.models.fields.SmallIntegerField')()) - - # Changing field 'Account.account_number' - db.alter_column(u'accounting_core_account', 'account_number', self.gf('django.db.models.fields.SmallIntegerField')()) - - models = { - u'accounting_core.account': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'Account'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'visibility': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'accounting_core.accountcategory': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'AccountCategory'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountcategorylogging': { - 'Meta': {'object_name': 'AccountCategoryLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountCategory']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}) - }, - u'accounting_core.accountingyearlogging': { - 'Meta': {'object_name': 'AccountingYearLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountingYear']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountlogging': { - 'Meta': {'object_name': 'AccountLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.Account']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.costcenter': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_core.costcenterlogging': { - 'Meta': {'object_name': 'CostCenterLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.CostCenter']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_core'] \ No newline at end of file diff --git a/truffe2/accounting_core/migrations/0010_auto__add_field_accountingyear_subvention_deadline.py b/truffe2/accounting_core/migrations/0010_auto__add_field_accountingyear_subvention_deadline.py deleted file mode 100644 index 513836b3..00000000 --- a/truffe2/accounting_core/migrations/0010_auto__add_field_accountingyear_subvention_deadline.py +++ /dev/null @@ -1,155 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'AccountingYear.subvention_deadline' - db.add_column(u'accounting_core_accountingyear', 'subvention_deadline', - self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'AccountingYear.subvention_deadline' - db.delete_column(u'accounting_core_accountingyear', 'subvention_deadline') - - - models = { - u'accounting_core.account': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'Account'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'visibility': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'accounting_core.accountcategory': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'AccountCategory'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountcategorylogging': { - 'Meta': {'object_name': 'AccountCategoryLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountCategory']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}), - 'subvention_deadline': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountingyearlogging': { - 'Meta': {'object_name': 'AccountingYearLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountingYear']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountlogging': { - 'Meta': {'object_name': 'AccountLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.Account']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.costcenter': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_core.costcenterlogging': { - 'Meta': {'object_name': 'CostCenterLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.CostCenter']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_core'] \ No newline at end of file diff --git a/truffe2/accounting_core/migrations/0011_auto__add_field_accountcategory_order.py b/truffe2/accounting_core/migrations/0011_auto__add_field_accountcategory_order.py deleted file mode 100644 index c52ede72..00000000 --- a/truffe2/accounting_core/migrations/0011_auto__add_field_accountcategory_order.py +++ /dev/null @@ -1,156 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'AccountCategory.order' - db.add_column(u'accounting_core_accountcategory', 'order', - self.gf('django.db.models.fields.SmallIntegerField')(default=0), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'AccountCategory.order' - db.delete_column(u'accounting_core_accountcategory', 'order') - - - models = { - u'accounting_core.account': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'Account'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'visibility': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'accounting_core.accountcategory': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'AccountCategory'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountcategorylogging': { - 'Meta': {'object_name': 'AccountCategoryLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountCategory']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}), - 'subvention_deadline': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountingyearlogging': { - 'Meta': {'object_name': 'AccountingYearLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountingYear']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountlogging': { - 'Meta': {'object_name': 'AccountLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.Account']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.costcenter': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_core.costcenterlogging': { - 'Meta': {'object_name': 'CostCenterLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.CostCenter']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_core'] \ No newline at end of file diff --git a/truffe2/accounting_core/migrations/0012_auto__add_tvalogging__add_tva.py b/truffe2/accounting_core/migrations/0012_auto__add_tvalogging__add_tva.py deleted file mode 100644 index e19ca65b..00000000 --- a/truffe2/accounting_core/migrations/0012_auto__add_tvalogging__add_tva.py +++ /dev/null @@ -1,192 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'TVALogging' - db.create_table(u'accounting_core_tvalogging', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('extra_data', self.gf('django.db.models.fields.TextField')(blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('what', self.gf('django.db.models.fields.CharField')(max_length=64)), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='logs', to=orm['accounting_core.TVA'])), - )) - db.send_create_signal(u'accounting_core', ['TVALogging']) - - # Adding model 'TVA' - db.create_table(u'accounting_core_tva', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('deleted', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('name', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('value', self.gf('django.db.models.fields.DecimalField')(max_digits=20, decimal_places=2)), - ('onlyagepoly', self.gf('django.db.models.fields.BooleanField')(default=False)), - )) - db.send_create_signal(u'accounting_core', ['TVA']) - - - def backwards(self, orm): - # Deleting model 'TVALogging' - db.delete_table(u'accounting_core_tvalogging') - - # Deleting model 'TVA' - db.delete_table(u'accounting_core_tva') - - - models = { - u'accounting_core.account': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'Account'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'visibility': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'accounting_core.accountcategory': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'AccountCategory'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountcategorylogging': { - 'Meta': {'object_name': 'AccountCategoryLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountCategory']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}), - 'subvention_deadline': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountingyearlogging': { - 'Meta': {'object_name': 'AccountingYearLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountingYear']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountlogging': { - 'Meta': {'object_name': 'AccountLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.Account']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.costcenter': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_core.costcenterlogging': { - 'Meta': {'object_name': 'CostCenterLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.CostCenter']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.tva': { - 'Meta': {'object_name': 'TVA'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'onlyagepoly': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'value': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}) - }, - u'accounting_core.tvalogging': { - 'Meta': {'object_name': 'TVALogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.TVA']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_core'] \ No newline at end of file diff --git a/truffe2/accounting_core/migrations/0013_auto__del_field_tva_onlyagepoly__add_field_tva_agepoly_only.py b/truffe2/accounting_core/migrations/0013_auto__del_field_tva_onlyagepoly__add_field_tva_agepoly_only.py deleted file mode 100644 index 0e49f7bb..00000000 --- a/truffe2/accounting_core/migrations/0013_auto__del_field_tva_onlyagepoly__add_field_tva_agepoly_only.py +++ /dev/null @@ -1,181 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting field 'TVA.onlyagepoly' - db.delete_column(u'accounting_core_tva', 'onlyagepoly') - - # Adding field 'TVA.agepoly_only' - db.add_column(u'accounting_core_tva', 'agepoly_only', - self.gf('django.db.models.fields.BooleanField')(default=False), - keep_default=False) - - - def backwards(self, orm): - # Adding field 'TVA.onlyagepoly' - db.add_column(u'accounting_core_tva', 'onlyagepoly', - self.gf('django.db.models.fields.BooleanField')(default=False), - keep_default=False) - - # Deleting field 'TVA.agepoly_only' - db.delete_column(u'accounting_core_tva', 'agepoly_only') - - - models = { - u'accounting_core.account': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'Account'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'visibility': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'accounting_core.accountcategory': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'AccountCategory'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountcategorylogging': { - 'Meta': {'object_name': 'AccountCategoryLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountCategory']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}), - 'subvention_deadline': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountingyearlogging': { - 'Meta': {'object_name': 'AccountingYearLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountingYear']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountlogging': { - 'Meta': {'object_name': 'AccountLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.Account']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.costcenter': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_core.costcenterlogging': { - 'Meta': {'object_name': 'CostCenterLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.CostCenter']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.tva': { - 'Meta': {'object_name': 'TVA'}, - 'agepoly_only': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'value': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}) - }, - u'accounting_core.tvalogging': { - 'Meta': {'object_name': 'TVALogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.TVA']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_core'] \ No newline at end of file diff --git a/truffe2/accounting_core/migrations/0014_auto__add_field_accountingyear_last_accounting_import.py b/truffe2/accounting_core/migrations/0014_auto__add_field_accountingyear_last_accounting_import.py deleted file mode 100644 index 7c5d29ac..00000000 --- a/truffe2/accounting_core/migrations/0014_auto__add_field_accountingyear_last_accounting_import.py +++ /dev/null @@ -1,174 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'AccountingYear.last_accounting_import' - db.add_column(u'accounting_core_accountingyear', 'last_accounting_import', - self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'AccountingYear.last_accounting_import' - db.delete_column(u'accounting_core_accountingyear', 'last_accounting_import') - - - models = { - u'accounting_core.account': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'Account'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'visibility': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'accounting_core.accountcategory': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'AccountCategory'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountcategorylogging': { - 'Meta': {'object_name': 'AccountCategoryLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountCategory']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'last_accounting_import': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}), - 'subvention_deadline': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountingyearlogging': { - 'Meta': {'object_name': 'AccountingYearLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountingYear']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountlogging': { - 'Meta': {'object_name': 'AccountLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.Account']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.costcenter': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_core.costcenterlogging': { - 'Meta': {'object_name': 'CostCenterLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.CostCenter']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.tva': { - 'Meta': {'object_name': 'TVA'}, - 'agepoly_only': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'value': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}) - }, - u'accounting_core.tvalogging': { - 'Meta': {'object_name': 'TVALogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.TVA']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_core'] \ No newline at end of file diff --git a/truffe2/accounting_core/migrations/0015_auto__add_tvaviews__add_costcenterviews__add_accountcategoryviews__add.py b/truffe2/accounting_core/migrations/0015_auto__add_tvaviews__add_costcenterviews__add_accountcategoryviews__add.py deleted file mode 100644 index 5eed34a1..00000000 --- a/truffe2/accounting_core/migrations/0015_auto__add_tvaviews__add_costcenterviews__add_accountcategoryviews__add.py +++ /dev/null @@ -1,264 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'TVAViews' - db.create_table(u'accounting_core_tvaviews', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='views', to=orm['accounting_core.TVA'])), - )) - db.send_create_signal(u'accounting_core', ['TVAViews']) - - # Adding model 'CostCenterViews' - db.create_table(u'accounting_core_costcenterviews', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='views', to=orm['accounting_core.CostCenter'])), - )) - db.send_create_signal(u'accounting_core', ['CostCenterViews']) - - # Adding model 'AccountCategoryViews' - db.create_table(u'accounting_core_accountcategoryviews', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='views', to=orm['accounting_core.AccountCategory'])), - )) - db.send_create_signal(u'accounting_core', ['AccountCategoryViews']) - - # Adding model 'AccountingYearViews' - db.create_table(u'accounting_core_accountingyearviews', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='views', to=orm['accounting_core.AccountingYear'])), - )) - db.send_create_signal(u'accounting_core', ['AccountingYearViews']) - - # Adding model 'AccountViews' - db.create_table(u'accounting_core_accountviews', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='views', to=orm['accounting_core.Account'])), - )) - db.send_create_signal(u'accounting_core', ['AccountViews']) - - - def backwards(self, orm): - # Deleting model 'TVAViews' - db.delete_table(u'accounting_core_tvaviews') - - # Deleting model 'CostCenterViews' - db.delete_table(u'accounting_core_costcenterviews') - - # Deleting model 'AccountCategoryViews' - db.delete_table(u'accounting_core_accountcategoryviews') - - # Deleting model 'AccountingYearViews' - db.delete_table(u'accounting_core_accountingyearviews') - - # Deleting model 'AccountViews' - db.delete_table(u'accounting_core_accountviews') - - - models = { - u'accounting_core.account': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'Account'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'visibility': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'accounting_core.accountcategory': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'AccountCategory'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountcategorylogging': { - 'Meta': {'object_name': 'AccountCategoryLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountCategory']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountcategoryviews': { - 'Meta': {'object_name': 'AccountCategoryViews'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': u"orm['accounting_core.AccountCategory']"}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'last_accounting_import': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}), - 'subvention_deadline': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountingyearlogging': { - 'Meta': {'object_name': 'AccountingYearLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountingYear']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountingyearviews': { - 'Meta': {'object_name': 'AccountingYearViews'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': u"orm['accounting_core.AccountingYear']"}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountlogging': { - 'Meta': {'object_name': 'AccountLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.Account']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountviews': { - 'Meta': {'object_name': 'AccountViews'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': u"orm['accounting_core.Account']"}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.costcenter': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_core.costcenterlogging': { - 'Meta': {'object_name': 'CostCenterLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.CostCenter']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.costcenterviews': { - 'Meta': {'object_name': 'CostCenterViews'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': u"orm['accounting_core.CostCenter']"}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.tva': { - 'Meta': {'object_name': 'TVA'}, - 'agepoly_only': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'value': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}) - }, - u'accounting_core.tvalogging': { - 'Meta': {'object_name': 'TVALogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.TVA']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.tvaviews': { - 'Meta': {'object_name': 'TVAViews'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': u"orm['accounting_core.TVA']"}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'homepage': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_betatester': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_core'] \ No newline at end of file diff --git a/truffe2/accounting_core/migrations/0016_auto__add_field_tva_account__add_field_tva_code.py b/truffe2/accounting_core/migrations/0016_auto__add_field_tva_account__add_field_tva_code.py deleted file mode 100644 index 23131959..00000000 --- a/truffe2/accounting_core/migrations/0016_auto__add_field_tva_account__add_field_tva_code.py +++ /dev/null @@ -1,222 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'TVA.account' - db.add_column(u'accounting_core_tva', 'account', - self.gf('django.db.models.fields.related.ForeignKey')(default=2601, to=orm['accounting_core.Account']), - keep_default=False) - - # Adding field 'TVA.code' - db.add_column(u'accounting_core_tva', 'code', - self.gf('django.db.models.fields.CharField')(default='UNKNOW', max_length=255), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'TVA.account' - db.delete_column(u'accounting_core_tva', 'account_id') - - # Deleting field 'TVA.code' - db.delete_column(u'accounting_core_tva', 'code') - - - models = { - u'accounting_core.account': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'Account'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'visibility': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'accounting_core.accountcategory': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'AccountCategory'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountcategorylogging': { - 'Meta': {'object_name': 'AccountCategoryLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountCategory']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountcategoryviews': { - 'Meta': {'object_name': 'AccountCategoryViews'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': u"orm['accounting_core.AccountCategory']"}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'last_accounting_import': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}), - 'subvention_deadline': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountingyearlogging': { - 'Meta': {'object_name': 'AccountingYearLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.AccountingYear']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountingyearviews': { - 'Meta': {'object_name': 'AccountingYearViews'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': u"orm['accounting_core.AccountingYear']"}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountlogging': { - 'Meta': {'object_name': 'AccountLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.Account']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.accountviews': { - 'Meta': {'object_name': 'AccountViews'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': u"orm['accounting_core.Account']"}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.costcenter': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_core.costcenterlogging': { - 'Meta': {'object_name': 'CostCenterLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.CostCenter']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.costcenterviews': { - 'Meta': {'object_name': 'CostCenterViews'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': u"orm['accounting_core.CostCenter']"}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.tva': { - 'Meta': {'object_name': 'TVA'}, - 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.Account']"}), - 'agepoly_only': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'code': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'value': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}) - }, - u'accounting_core.tvalogging': { - 'Meta': {'object_name': 'TVALogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_core.TVA']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_core.tvaviews': { - 'Meta': {'object_name': 'TVAViews'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': u"orm['accounting_core.TVA']"}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'homepage': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_betatester': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_core'] \ No newline at end of file diff --git a/truffe2/accounting_core/models.py b/truffe2/accounting_core/models.py index 8f49f970..88014266 100644 --- a/truffe2/accounting_core/models.py +++ b/truffe2/accounting_core/models.py @@ -2,8 +2,8 @@ from django import forms from django.db import models -from django.utils.translation import ugettext_lazy as _ - +from django.db.models.deletion import PROTECT +from django.utils.translation import gettext_lazy as _ from generic.models import GenericModel, GenericStateModel, FalseFK, GenericGroupsModel, SearchableModel from rights.utils import AgepolyEditableModel @@ -16,7 +16,7 @@ class _AccountingYear(GenericModel, GenericStateModel, AgepolyEditableModel, Sea class MetaRightsAgepoly(AgepolyEditableModel.MetaRightsAgepoly): access = ['TRESORERIE'] - name = models.CharField(_('Nom'), max_length=255, unique=True) + name = models.CharField(_('Nom'), max_length=255, unique=True, default='---') start_date = models.DateTimeField(_(u'Date de début'), blank=True, null=True) end_date = models.DateTimeField(_('Date de fin'), blank=True, null=True) subvention_deadline = models.DateTimeField(_(u'Délai pour les subventions'), blank=True, null=True) @@ -133,13 +133,13 @@ class MetaEdit: datetime_fields = ['start_date', 'end_date', 'subvention_deadline'] only_if = { - 'last_accounting_import': lambda _: False + 'last_accounting_import': lambda _, _user: False } class Meta: abstract = True - def __unicode__(self): + def __str__(self): return self.name def rights_can_EDIT(self, user): @@ -180,7 +180,7 @@ class _CostCenter(GenericModel, AccountingYearLinked, AgepolyEditableModel, Sear class MetaRightsAgepoly(AgepolyEditableModel.MetaRightsAgepoly): access = ['TRESORERIE', 'SECRETARIAT'] - name = models.CharField(_(u'Nom du centre de coût'), max_length=255) + name = models.CharField(_(u'Nom du centre de coût'), max_length=255, default='---') account_number = models.CharField(_(u'Numéro associé au centre de coût'), max_length=10) unit = FalseFK('units.models.Unit', verbose_name=_(u'Appartient à')) description = models.TextField(_('Description'), blank=True, null=True) @@ -223,7 +223,7 @@ class MetaSearch(SearchableModel.MetaSearch): 'description', ] - def __unicode__(self): + def __str__(self): return u"{} - {}".format(self.account_number, self.name) def genericFormExtraClean(self, data, form): @@ -242,8 +242,8 @@ class _AccountCategory(GenericModel, AccountingYearLinked, AgepolyEditableModel, class MetaRightsAgepoly(AgepolyEditableModel.MetaRightsAgepoly): access = ['TRESORERIE', 'SECRETARIAT'] - name = models.CharField(_(u'Nom de la catégorie'), max_length=255) - parent_hierarchique = models.ForeignKey('AccountCategory', null=True, blank=True, help_text=_(u'Catégorie parente pour la hiérarchie')) + name = models.CharField(_(u'Nom de la catégorie'), max_length=255, default='---') + parent_hierarchique = models.ForeignKey('AccountCategory', null=True, blank=True, help_text=_(u'Catégorie parente pour la hiérarchie'), on_delete=PROTECT) order = models.SmallIntegerField(_(u'Ordre dans le plan comptable'), default=0, help_text=_(u'Le plus petit d\'abord')) description = models.TextField(_('Description'), blank=True, null=True) @@ -286,7 +286,7 @@ class MetaSearch(SearchableModel.MetaSearch): 'description', ] - def __unicode__(self): + def __str__(self): return u"{} ({})".format(self.name, self.accounting_year) def genericFormExtraInit(self, form, current_user, *args, **kwargs): @@ -332,7 +332,7 @@ class MetaRightsAgepoly(AgepolyEditableModel.MetaRightsAgepoly): ('none', _(u'Visible à personne')), ) - name = models.CharField(_('Nom du compte'), max_length=255) + name = models.CharField(_('Nom du compte'), max_length=255, default='---') account_number = models.CharField(_(u'Numéro du compte'), max_length=10) visibility = models.CharField(_(u'Visibilité dans les documents comptables'), max_length=50, choices=VISIBILITY_CHOICES) category = FalseFK('accounting_core.models.AccountCategory', verbose_name=_(u'Catégorie')) @@ -379,7 +379,7 @@ class MetaSearch(SearchableModel.MetaSearch): 'category', ] - def __unicode__(self): + def __str__(self): return u"{} - {}".format(self.account_number, self.name) def genericFormExtraInit(self, form, current_user, *args, **kwargs): @@ -388,7 +388,7 @@ def genericFormExtraInit(self, form, current_user, *args, **kwargs): yeared_account_categories = AccountCategory.objects.filter(accounting_year=self.accounting_year) yeared_account_categories = filter(lambda qs: qs.get_children_categories().count() == 0, yeared_account_categories) - ids_yac = map(lambda yac: yac.id, yeared_account_categories) + ids_yac = [yac.id for yac in yeared_account_categories] form.fields['category'].queryset = AccountCategory.objects.filter(id__in=ids_yac) def genericFormExtraClean(self, data, form): @@ -423,13 +423,12 @@ class _TVA(GenericModel, AgepolyEditableModel, SearchableModel): class MetaRightsAgepoly(AgepolyEditableModel.MetaRightsAgepoly): access = ['TRESORERIE', 'SECRETARIAT'] - name = models.CharField(_(u'Nom de la TVA'), max_length=255) + name = models.CharField(_(u'Nom de la TVA'), max_length=255, default='---') value = models.DecimalField(_('Valeur (%)'), max_digits=20, decimal_places=2) agepoly_only = models.BooleanField(_(u'Limiter l\'usage au comité de l\'AGEPoly'), default=False) account = FalseFK('accounting_core.models.Account', verbose_name=_('Compte de TVA')) code = models.CharField(verbose_name=_('Code de TVA'), max_length=255) - class Meta: abstract = True @@ -452,7 +451,7 @@ class MetaData: menu_id = 'menu-compta-tva' - yes_or_no_fields = ['agepoly_only',] + yes_or_no_fields = ['agepoly_only', ] help_list = _(u"""Les TVA sélectionnables dans les champs de TVA. Il est possible de restrainre l'usage de certaines TVA au CDD. @@ -475,7 +474,7 @@ def __init__(self, *args, **kwargs): 'ANYTVA': _(u'Peut utiliser n\'importe quelle valeure de TVA.'), }) - def __unicode__(self): + def __str__(self): return u"{}% ({})".format(self.value, self.name) def rights_can_ANYTVA(self, user): @@ -529,6 +528,6 @@ def _do(f): if user not in retour: retour.append(user) - map(_do, [self.build_group_members_for_agep_compta, self.build_group_members_for_agep_secretaire, self.build_group_members_for_unit_compta, self.build_group_members_for_editors]) + list(map(_do, [self.build_group_members_for_agep_compta, self.build_group_members_for_agep_secretaire, self.build_group_members_for_unit_compta, self.build_group_members_for_editors])) return retour diff --git a/truffe2/accounting_core/templates/accounting_core/account/edit.html b/truffe2/accounting_core/templates/accounting_core/account/edit.html index e081c698..840d8e41 100644 --- a/truffe2/accounting_core/templates/accounting_core/account/edit.html +++ b/truffe2/accounting_core/templates/accounting_core/account/edit.html @@ -21,7 +21,7 @@ }); function update_categories(pk) { - $.ajax('{% url 'accounting_core.views.leaves_cat_by_year' 99942999 %}'.replace(99942999, pk)).done(function (data) { + $.ajax('{% url 'accounting_core-views-leaves_cat_by_year' 99942999 %}'.replace(99942999, pk)).done(function (data) { $('#id_category option').remove(); $('#id_category').append( $('').val('').html('---------') diff --git a/truffe2/accounting_core/templates/accounting_core/account/list.html b/truffe2/accounting_core/templates/accounting_core/account/list.html index 55eea6f3..2250165b 100644 --- a/truffe2/accounting_core/templates/accounting_core/account/list.html +++ b/truffe2/accounting_core/templates/accounting_core/account/list.html @@ -3,7 +3,7 @@ {% block extrabuttons %} {% ifhasright Model user '!SHOW' %} - + {% trans "Plan comptable" %} diff --git a/truffe2/accounting_core/templates/accounting_core/accountcategory/edit.html b/truffe2/accounting_core/templates/accounting_core/accountcategory/edit.html index 1eb5da90..9c315016 100644 --- a/truffe2/accounting_core/templates/accounting_core/accountcategory/edit.html +++ b/truffe2/accounting_core/templates/accounting_core/accountcategory/edit.html @@ -15,7 +15,7 @@ }); function update_parents(pk) { - $.ajax('{% url 'accounting_core.views.parents_cat_by_year' 99942999 %}'.replace(99942999, pk)).done(function (data) { + $.ajax('{% url 'accounting_core-views-parents_cat_by_year' 99942999 %}'.replace(99942999, pk)).done(function (data) { $('#id_parent_hierarchique option').remove(); $('#id_parent_hierarchique').append( $('').val('').html('---------') diff --git a/truffe2/accounting_core/templates/accounting_core/accountingyear/list_json.html b/truffe2/accounting_core/templates/accounting_core/accountingyear/list_json.html index 9d7f1cae..b8752f39 100644 --- a/truffe2/accounting_core/templates/accounting_core/accountingyear/list_json.html +++ b/truffe2/accounting_core/templates/accounting_core/accountingyear/list_json.html @@ -3,6 +3,6 @@ {% block bonus_buttons %} {% ifhasright elem user '!CREATE' %} - {% trans "Copier" %}\"> + {% trans "Copier" %}\"> {% endifhasright %} {% endblock %} diff --git a/truffe2/accounting_core/templates/accounting_core/costcenter/list.html b/truffe2/accounting_core/templates/accounting_core/costcenter/list.html index d4c23006..0c858f7a 100644 --- a/truffe2/accounting_core/templates/accounting_core/costcenter/list.html +++ b/truffe2/accounting_core/templates/accounting_core/costcenter/list.html @@ -3,7 +3,7 @@ {% block extrabuttons %} {% ifhasright Model user '!SHOW' %} - + {% trans "Liste des centres de coûts" %} diff --git a/truffe2/accounting_core/tests.py b/truffe2/accounting_core/tests.py index 7ce503c2..49db70d7 100644 --- a/truffe2/accounting_core/tests.py +++ b/truffe2/accounting_core/tests.py @@ -1,3 +1,82 @@ -from django.test import TestCase +# -*- coding: utf-8 -*- +""" +This file demonstrates writing tests using the unittest module. These will pass +when you run "manage.py test". -# Create your tests here. +Replace this with more appropriate tests for your application. +""" + +from main.test_tools import TruffeTestAbstract + + +class AccountingCoreNoLoginTest(TruffeTestAbstract): + + def test_accountingyear_copy(self): + self.call_check_redirect('/accounting/core/accountingyear/1/copy') + + def test_accountingyear_cost_centers(self): + self.call_check_redirect('/accounting/core/accountingyear/1/cost_centers') + + def test_accountingyear_accounts(self): + self.call_check_redirect('/accounting/core/accountingyear/1/accounts') + + def test_accountingyear_get_leaves_cat(self): + self.call_check_redirect('/accounting/core/accountingyear/1/get_leaves_cat') + + def test_accountingyear_get_parents_cat(self): + self.call_check_redirect('/accounting/core/accountingyear/1/get_parents_cat') + + def test_accountingyear_get_accounts(self): + self.call_check_redirect('/accounting/core/accountingyear/1/get_accounts') + + def test_costcenter_available_list(self): + self.call_check_redirect('/accounting/core/costcenter/available_list') + + def test_account_available_list(self): + self.call_check_redirect('/accounting/core/account/available_list') + + def test_tva_available_list(self): + self.call_check_redirect('/accounting/core/tva/available_list') + + def test_unit_users_available_list(self): + self.call_check_redirect('/accounting/core/unit/1/users_available_list') + + +class AccountingCoreWithLoginTest(TruffeTestAbstract): + + login_username = 'admin' + + def test_accountingyear_copy(self): + self.call_check_redirect('/accounting/core/accountingyear/1/copy', + redirect_url='/accounting/core/accountingyear/2/edit') + + def test_accountingyear_cost_centers(self): + self.call_check_pdf('/accounting/core/accountingyear/1/cost_centers') + + def test_accountingyear_accounts(self): + self.call_check_pdf('/accounting/core/accountingyear/1/accounts') + + def test_accountingyear_get_leaves_cat(self): + self.call_check_json('/accounting/core/accountingyear/1/get_leaves_cat') + + def test_accountingyear_get_parents_cat(self): + self.call_check_json('/accounting/core/accountingyear/1/get_parents_cat') + + def test_accountingyear_get_accounts(self): + self.call_check_json('/accounting/core/accountingyear/1/get_accounts') + self.call_check_json('/accounting/core/accountingyear/1/get_accounts', data={"outcomes":1}) + self.call_check_json('/accounting/core/accountingyear/1/get_accounts', data={"incomes":1}) + + def test_costcenter_available_list(self): + self.call_check_json('/accounting/core/costcenter/available_list', data={'upk':1, 'ypk':1}) + + def test_account_available_list(self): + self.call_check_json('/accounting/core/account/available_list', data={'ypk':1}) + + def test_tva_available_list(self): + self.call_check_json('/accounting/core/tva/available_list') + self.call_check_json('/accounting/core/tva/available_list', data={'q':10}) + self.call_check_json('/accounting/core/tva/available_list', data={'init':10}) + + def test_unit_users_available_list(self): + self.call_check_json('/accounting/core/unit/1/users_available_list') diff --git a/truffe2/accounting_core/urls.py b/truffe2/accounting_core/urls.py index 4233f7cc..10bf3d7f 100644 --- a/truffe2/accounting_core/urls.py +++ b/truffe2/accounting_core/urls.py @@ -1,20 +1,21 @@ # -*- coding: utf-8 -*- -from django.conf.urls import patterns, url +from django.urls import re_path +from accounting_core.views import copy_accounting_year, pdf_list_cost_centers, \ + pdf_list_accounts, leaves_cat_by_year, parents_cat_by_year, accounts_by_year, \ + costcenter_available_list, account_available_list, tva_available_list, \ + users_available_list_by_unit +urlpatterns = [ + re_path(r'^accountingyear/(?P[0-9,]+)/copy$', copy_accounting_year, name='accounting_core-views-copy_accounting_year'), + re_path(r'^accountingyear/(?P[0-9]+)/cost_centers$', pdf_list_cost_centers, name='accounting_core-views-pdf_list_cost_centers'), + re_path(r'^accountingyear/(?P[0-9]+)/accounts$', pdf_list_accounts, name='accounting_core-views-pdf_list_accounts'), + re_path(r'^accountingyear/(?P[0-9]+)/get_leaves_cat$', leaves_cat_by_year, name='accounting_core-views-leaves_cat_by_year'), + re_path(r'^accountingyear/(?P[0-9]+)/get_parents_cat$', parents_cat_by_year, name='accounting_core-views-parents_cat_by_year'), + re_path(r'^accountingyear/(?P[0-9]+)/get_accounts$', accounts_by_year, name='accounting_core-views-accounts_by_year'), -urlpatterns = patterns( - 'accounting_core.views', - - url(r'^accountingyear/(?P[0-9,]+)/copy$', 'copy_accounting_year'), - url(r'^accountingyear/(?P[0-9]+)/cost_centers$', 'pdf_list_cost_centers'), - url(r'^accountingyear/(?P[0-9]+)/accounts$', 'pdf_list_accounts'), - url(r'^accountingyear/(?P[0-9]+)/get_leaves_cat$', 'leaves_cat_by_year'), - url(r'^accountingyear/(?P[0-9]+)/get_parents_cat$', 'parents_cat_by_year'), - url(r'^accountingyear/(?P[0-9]+)/get_accounts$', 'accounts_by_year'), - - url(r'^costcenter/available_list$', 'costcenter_available_list'), - url(r'^account/available_list$', 'account_available_list'), - url(r'^tva/available_list$', 'tva_available_list'), - url(r'^unit/(?P[0-9]+)/users_available_list$', 'users_available_list_by_unit'), -) + re_path(r'^costcenter/available_list$', costcenter_available_list, name='accounting_core-views-costcenter_available_list'), + re_path(r'^account/available_list$', account_available_list, name='accounting_core-views-account_available_list'), + re_path(r'^tva/available_list$', tva_available_list, name='accounting_core-views-tva_available_list'), + re_path(r'^unit/(?P[0-9]+)/users_available_list$', users_available_list_by_unit, name='accounting_core-views-users_available_list_by_unit'), +] diff --git a/truffe2/accounting_core/utils.py b/truffe2/accounting_core/utils.py index 0857e36d..41fbd721 100644 --- a/truffe2/accounting_core/utils.py +++ b/truffe2/accounting_core/utils.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ +from django.db.models.deletion import PROTECT class AccountingYearLinked(object): @@ -12,7 +13,7 @@ def do(module, models_module, model_class, cache): """Execute code at startup""" return { - 'accounting_year': models.ForeignKey(cache['accounting_core.models.AccountingYear'], verbose_name=_(u'Année comptable')), + 'accounting_year': models.ForeignKey(cache['accounting_core.models.AccountingYear'], verbose_name=_(u'Année comptable'), on_delete=PROTECT), } def rights_can_EDIT(self, user): @@ -49,5 +50,5 @@ def do(module, models_module, model_class, cache): setattr(model_class.MetaData, 'costcenterlinked', True) return { - 'costcenter': models.ForeignKey(cache['accounting_core.models.CostCenter'], verbose_name=_(u'Centre de coût')), + 'costcenter': models.ForeignKey(cache['accounting_core.models.CostCenter'], verbose_name=_(u'Centre de coût'), on_delete=PROTECT), } diff --git a/truffe2/accounting_core/views.py b/truffe2/accounting_core/views.py index 3110a214..4843518e 100644 --- a/truffe2/accounting_core/views.py +++ b/truffe2/accounting_core/views.py @@ -5,14 +5,12 @@ from django.http import Http404, HttpResponse from django.shortcuts import get_object_or_404, redirect from django.utils.timezone import now -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.db.models import Q from django.conf import settings - import json - from accounting_core import models as accounting_models from app.utils import update_current_year, generate_pdf from generic.models import copiable_things @@ -52,7 +50,7 @@ def copy_accounting_year(request, pk): elem.id = None elem.save() - for cp_class, cp_obj in copiable_objects.iteritems(): + for cp_class, cp_obj in copiable_objects.items(): # Correct dependencies on the new objects if hasattr(cp_class.MetaAccounting, 'foreign'): for (field_name, field_class) in cp_class.MetaAccounting.foreign: @@ -65,9 +63,9 @@ def copy_accounting_year(request, pk): if len(accounting_years) == 1: update_current_year(request, accounting_years[0].pk) - return redirect('accounting_core.views.accountingyear_edit', accounting_years[0].pk) + return redirect('accounting_core-views-accountingyear_edit', accounting_years[0].pk) else: - return redirect('accounting_core.views.accountingyear_list') + return redirect('accounting_core-views-accountingyear_list') @login_required @@ -80,7 +78,7 @@ def costcenter_available_list(request): if request.GET.get('upk'): unit = get_object_or_404(Unit, pk=request.GET.get('upk')) - unit_and_sub_pks = [unit.pk] + map(lambda un: un.pk, unit.sub_eqi() + unit.sub_grp()) + unit_and_sub_pks = [unit.pk] + [un.pk for un in unit.sub_eqi() + unit.sub_grp()] costcenters = costcenters.filter(unit__pk__in=unit_and_sub_pks) if request.GET.get('ypk'): @@ -88,7 +86,7 @@ def costcenter_available_list(request): costcenters = costcenters.filter(accounting_year=accounting_year) # costcenters = filter(lambda cc: cc.rights_can('SHOW', request.user), list(costcenters)) - retour = {'data': [{'pk': costcenter.pk, 'name': costcenter.__unicode__()} for costcenter in costcenters]} + retour = {'data': [{'pk': costcenter.pk, 'name': costcenter.__str__()} for costcenter in costcenters]} return HttpResponse(json.dumps(retour), content_type='application/json') @@ -161,7 +159,7 @@ def tva_available_list(request): except: tvas = tvas.filter(name__istartswith=init) - retour = [{'id': float(tva.value), 'text': tva.__unicode__()} for tva in tvas] + retour = [{'id': float(tva.value), 'text': tva.__str__()} for tva in tvas] if bonus_tva: # On rajoute, si n'existe pas déjà dans la liste retournée une entrée avec la valeur de la TVA recherchée par l'utilisateur bonus_tva_exists = False @@ -182,7 +180,7 @@ def leaves_cat_by_year(request, ypk): retour = AccountCategory.objects.filter(accounting_year__pk=ypk, deleted=False).order_by('order') retour = filter(lambda ac: not ac.get_children_categories().exists(), retour) - retour = map(lambda ac: {'value': ac.pk, 'text': ac.__unicode__()}, retour) + retour = [{'value': ac.pk, 'text': ac.__str__()} for ac in retour] return HttpResponse(json.dumps(retour), content_type='application/json') @@ -193,7 +191,7 @@ def parents_cat_by_year(request, ypk): retour = AccountCategory.objects.filter(accounting_year__pk=ypk, deleted=False).order_by('order') retour = filter(lambda ac: ac.get_children_categories().exists(), retour) - retour = map(lambda ac: {'value': ac.pk, 'text': ac.__unicode__()}, retour) + retour = [{'value': ac.pk, 'text': ac.__str__()} for ac in retour] return HttpResponse(json.dumps(retour), content_type='application/json') @@ -211,7 +209,7 @@ def accounts_by_year(request, ypk): elif request.GET.get('incomes'): retour = filter(lambda ac: ac.category.get_root_parent().name == "Produit", retour) - retour = map(lambda ac: {'value': ac.pk, 'text': ac.__unicode__()}, retour) + retour = [{'value': ac.pk, 'text': ac.__str__()} for ac in retour] return HttpResponse(json.dumps(retour), content_type='application/json') @@ -220,7 +218,7 @@ def costcenters_by_year(request, ypk): from accounting_core.models import CostCenter retour = CostCenter.objects.filter(accounting_year__pk=ypk, deleted=False).order_by('account_number') - retour = map(lambda ac: {'value': ac.pk, 'text': ac.__unicode__()}, retour) + retour = [{'value': ac.pk, 'text': ac.__str__()} for ac in retour] return HttpResponse(json.dumps(retour), content_type='application/json') @@ -235,15 +233,15 @@ def users_available_list_by_unit(request, upk): users = [request.user] if request.user.rights_in_unit(request.user, unit, ['TRESORERIE', 'SECRETARIAT']) or request.user.is_superuser: unit_users = unit.users_with_access(no_parent=True) - unit_users_pk = map(lambda user: user.pk, unit_users) - unit_users = filter(lambda user: user != request.user, unit_users) + unit_users_pk = [user.pk for user in unit_users] + unit_users = [user for user in unit_users if user != request.user] users += sorted(unit_users, key=lambda user: user.first_name) other_users = TruffeUser.objects.exclude(Q(pk=request.user.pk) | Q(pk__in=unit_users_pk)).order_by('first_name') users += list(other_users) - retour = [{'pk': user.pk, 'name': user.__unicode__()} for user in users] + retour = [{'pk': user.pk, 'name': user.__str__()} for user in users] return HttpResponse(json.dumps(retour), content_type='application/json') @@ -261,6 +259,6 @@ def account_available_list(request): accounts = filter(lambda acc: acc.rights_can('SHOW', request.user), list(accounts)) - retour = {'data': [{'pk': account.pk, 'name': account.__unicode__()} for account in accounts]} + retour = {'data': [{'pk': account.pk, 'name': account.__str__()} for account in accounts]} return HttpResponse(json.dumps(retour), content_type='application/json') diff --git a/truffe2/accounting_main/forms2.py b/truffe2/accounting_main/forms2.py index 76ed8536..98e4790d 100644 --- a/truffe2/accounting_main/forms2.py +++ b/truffe2/accounting_main/forms2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from django import forms -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from accounting_core.models import AccountingYear diff --git a/truffe2/accounting_main/migrations/0001_initial.py b/truffe2/accounting_main/migrations/0001_initial.py index c0a09a4e..aae46c66 100644 --- a/truffe2/accounting_main/migrations/0001_initial.py +++ b/truffe2/accounting_main/migrations/0001_initial.py @@ -1,147 +1,205 @@ # -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals +from django.db import models, migrations +import accounting_core.models +import generic.models +import generic.search +import rights.utils +import accounting_core.utils +from django.conf import settings -class Migration(SchemaMigration): - def forwards(self, orm): - # Adding model 'AccountingLine' - db.create_table(u'accounting_main_accountingline', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('deleted', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('date', self.gf('django.db.models.fields.DateField')()), - ('tva', self.gf('django.db.models.fields.DecimalField')(max_digits=20, decimal_places=2)), - ('text', self.gf('django.db.models.fields.CharField')(max_length=2048)), - ('output', self.gf('django.db.models.fields.DecimalField')(max_digits=20, decimal_places=2)), - ('input', self.gf('django.db.models.fields.DecimalField')(max_digits=20, decimal_places=2)), - ('current_sum', self.gf('django.db.models.fields.DecimalField')(max_digits=20, decimal_places=2)), - ('status', self.gf('django.db.models.fields.CharField')(default='0_imported', max_length=255)), - ('accounting_year', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['accounting_core.AccountingYear'])), - ('costcenter', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['accounting_core.CostCenter'])), - )) - db.send_create_signal(u'accounting_main', ['AccountingLine']) +class Migration(migrations.Migration): - # Adding model 'AccountingLineLogging' - db.create_table(u'accounting_main_accountinglinelogging', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('extra_data', self.gf('django.db.models.fields.TextField')(blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('what', self.gf('django.db.models.fields.CharField')(max_length=64)), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='logs', to=orm['accounting_main.AccountingLine'])), - )) - db.send_create_signal(u'accounting_main', ['AccountingLineLogging']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('units', '__first__'), + ('accounting_core', '0001_initial'), + ] - - def backwards(self, orm): - # Deleting model 'AccountingLine' - db.delete_table(u'accounting_main_accountingline') - - # Deleting model 'AccountingLineLogging' - db.delete_table(u'accounting_main_accountinglinelogging') - - - models = { - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}), - 'subvention_deadline': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.costcenter': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountingline': { - 'Meta': {'object_name': 'AccountingLine'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'current_sum': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'date': ('django.db.models.fields.DateField', [], {}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'input': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'output': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_imported'", 'max_length': '255'}), - 'text': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), - 'tva': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}) - }, - u'accounting_main.accountinglinelogging': { - 'Meta': {'object_name': 'AccountingLineLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingLine']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_main'] \ No newline at end of file + operations = [ + migrations.CreateModel( + name='AccountingError', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('deleted', models.BooleanField(default=False)), + ('linked_line_cache', models.CharField(max_length=4096)), + ('initial_remark', models.TextField(help_text='D\xe9crit le probl\xe8me', verbose_name='Remarque initiale')), + ('status', models.CharField(default=b'0_drafting', max_length=255, choices=[(b'2_fixed', 'Correction effectu\xe9e'), (b'1_fixing', 'En attente de correction'), (b'0_drafting', '\xc9tablisement du probl\xe8me')])), + ('accounting_year', models.ForeignKey(verbose_name='Ann\xe9e comptable', to='accounting_core.AccountingYear', on_delete=models.deletion.PROTECT)), + ('costcenter', models.ForeignKey(verbose_name='Centre de co\xfbt', to='accounting_core.CostCenter', on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model, generic.models.GenericStateModel, accounting_core.utils.AccountingYearLinked, accounting_core.utils.CostCenterLinked, generic.models.GenericGroupsModel, accounting_core.models.AccountingGroupModels, generic.models.GenericContactableModel, rights.utils.UnitEditableModel, generic.search.SearchableModel), + ), + migrations.CreateModel( + name='AccountingErrorLogging', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('extra_data', models.TextField(blank=True)), + ('what', models.CharField(max_length=64, choices=[(b'imported', 'Import\xe9 depuis Truffe 1'), (b'created', 'Creation'), (b'edited', 'Edit\xe9'), (b'deleted', 'Supprim\xe9'), (b'restored', 'Restaur\xe9'), (b'state_changed', 'Statut chang\xe9'), (b'file_added', 'Fichier ajout\xe9'), (b'file_removed', 'Fichier supprim\xe9')])), + ('object', models.ForeignKey(related_name='logs', to='accounting_main.AccountingError', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='AccountingErrorMessage', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('message', models.TextField()), + ('author', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ('error', models.ForeignKey(to='accounting_main.AccountingError', on_delete=models.deletion.PROTECT)), + ], + options={ + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='AccountingErrorViews', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('object', models.ForeignKey(related_name='views', to='accounting_main.AccountingError', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='AccountingLine', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('deleted', models.BooleanField(default=False)), + ('date', models.DateField()), + ('tva', models.DecimalField(verbose_name='VAT', max_digits=20, decimal_places=2)), + ('text', models.CharField(max_length=2048)), + ('output', models.DecimalField(verbose_name='D\xe9bit', max_digits=20, decimal_places=2)), + ('input', models.DecimalField(verbose_name='Cr\xe9dit', max_digits=20, decimal_places=2)), + ('current_sum', models.DecimalField(verbose_name='Situation', max_digits=20, decimal_places=2)), + ('document_id', models.PositiveIntegerField(null=True, verbose_name='Num\xe9ro de pi\xe8ce comptable', blank=True)), + ('order', models.PositiveIntegerField(default=0)), + ('status', models.CharField(default=b'0_imported', max_length=255, choices=[(b'0_imported', 'En attente'), (b'2_error', 'Erreur'), (b'1_validated', 'Valid\xe9')])), + ('account', models.ForeignKey(verbose_name='Compte de CG', to='accounting_core.Account', on_delete=models.deletion.PROTECT)), + ('accounting_year', models.ForeignKey(verbose_name='Ann\xe9e comptable', to='accounting_core.AccountingYear', on_delete=models.deletion.PROTECT)), + ('costcenter', models.ForeignKey(verbose_name='Centre de co\xfbt', to='accounting_core.CostCenter', on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model, generic.models.GenericStateModel, accounting_core.utils.AccountingYearLinked, accounting_core.utils.CostCenterLinked, generic.models.GenericGroupsModel, accounting_core.models.AccountingGroupModels, generic.models.GenericContactableModel, rights.utils.UnitEditableModel, generic.search.SearchableModel), + ), + migrations.CreateModel( + name='AccountingLineLogging', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('extra_data', models.TextField(blank=True)), + ('what', models.CharField(max_length=64, choices=[(b'imported', 'Import\xe9 depuis Truffe 1'), (b'created', 'Creation'), (b'edited', 'Edit\xe9'), (b'deleted', 'Supprim\xe9'), (b'restored', 'Restaur\xe9'), (b'state_changed', 'Statut chang\xe9'), (b'file_added', 'Fichier ajout\xe9'), (b'file_removed', 'Fichier supprim\xe9')])), + ('object', models.ForeignKey(related_name='logs', to='accounting_main.AccountingLine', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='AccountingLineViews', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('object', models.ForeignKey(related_name='views', to='accounting_main.AccountingLine', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='Budget', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('deleted', models.BooleanField(default=False)), + ('name', models.CharField(max_length=255, verbose_name='Titre du budget')), + ('status', models.CharField(default=b'0_draft', max_length=255, choices=[(b'0_correct', 'A corriger'), (b'0_draft', 'Brouillon'), (b'1_private', 'Budget priv\xe9'), (b'1_submited', 'Budget soumis'), (b'2_treated', 'Budget valid\xe9')])), + ('accounting_year', models.ForeignKey(verbose_name='Ann\xe9e comptable', to='accounting_core.AccountingYear', on_delete=models.deletion.PROTECT)), + ('costcenter', models.ForeignKey(verbose_name='Centre de co\xfbt', to='accounting_core.CostCenter', on_delete=models.deletion.PROTECT)), + ('unit', models.ForeignKey(to='units.Unit', on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model, generic.models.GenericStateModel, accounting_core.utils.AccountingYearLinked, accounting_core.utils.CostCenterLinked, rights.utils.UnitEditableModel, generic.models.GenericContactableModel, generic.models.GenericTaggableObject, accounting_core.models.AccountingGroupModels, generic.search.SearchableModel), + ), + migrations.CreateModel( + name='BudgetLine', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('amount', models.DecimalField(verbose_name='Montant', max_digits=20, decimal_places=2)), + ('description', models.CharField(max_length=250)), + ('account', models.ForeignKey(verbose_name='Account', to='accounting_core.Account', on_delete=models.deletion.PROTECT)), + ('budget', models.ForeignKey(verbose_name='Budget', to='accounting_main.Budget', on_delete=models.deletion.PROTECT)), + ], + options={ + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='BudgetLogging', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('extra_data', models.TextField(blank=True)), + ('what', models.CharField(max_length=64, choices=[(b'imported', 'Import\xe9 depuis Truffe 1'), (b'created', 'Creation'), (b'edited', 'Edit\xe9'), (b'deleted', 'Supprim\xe9'), (b'restored', 'Restaur\xe9'), (b'state_changed', 'Statut chang\xe9'), (b'file_added', 'Fichier ajout\xe9'), (b'file_removed', 'Fichier supprim\xe9')])), + ('object', models.ForeignKey(related_name='logs', to='accounting_main.Budget', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='BudgetTag', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('tag', models.CharField(max_length=255)), + ('object', models.ForeignKey(related_name='tags', to='accounting_main.Budget', on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='BudgetViews', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('object', models.ForeignKey(related_name='views', to='accounting_main.Budget', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.AddField( + model_name='accountingerror', + name='linked_line', + field=models.ForeignKey(verbose_name='Ligne li\xe9e', blank=True, to='accounting_main.AccountingLine', null=True, on_delete=models.deletion.SET_NULL), + preserve_default=True, + ), + ] diff --git a/truffe2/accounting_main/migrations/0002_auto_20201104_1311-3.py b/truffe2/accounting_main/migrations/0002_auto_20201104_1311-3.py new file mode 100644 index 00000000..0dae9ea6 --- /dev/null +++ b/truffe2/accounting_main/migrations/0002_auto_20201104_1311-3.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2020-11-04 12:11 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('accounting_main', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='accountingline', + name='tva', + field=models.DecimalField(decimal_places=2, max_digits=20, verbose_name='TVA'), + ), + migrations.AlterField( + model_name='budgetline', + name='account', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='accounting_core.Account', verbose_name='Compte'), + ), + ] diff --git a/truffe2/accounting_main/migrations/0002_auto__add_field_accountingline_unit.py b/truffe2/accounting_main/migrations/0002_auto__add_field_accountingline_unit.py deleted file mode 100644 index b22dc708..00000000 --- a/truffe2/accounting_main/migrations/0002_auto__add_field_accountingline_unit.py +++ /dev/null @@ -1,123 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'AccountingLine.unit' - db.add_column(u'accounting_main_accountingline', 'unit', - self.gf('django.db.models.fields.related.ForeignKey')(default=1, to=orm['units.Unit']), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'AccountingLine.unit' - db.delete_column(u'accounting_main_accountingline', 'unit_id') - - - models = { - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}), - 'subvention_deadline': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.costcenter': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountingline': { - 'Meta': {'object_name': 'AccountingLine'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'current_sum': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'date': ('django.db.models.fields.DateField', [], {}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'input': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'output': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_imported'", 'max_length': '255'}), - 'text': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), - 'tva': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountinglinelogging': { - 'Meta': {'object_name': 'AccountingLineLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingLine']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_main'] \ No newline at end of file diff --git a/truffe2/accounting_main/migrations/0003_auto_20201104_1648.py b/truffe2/accounting_main/migrations/0003_auto_20201104_1648.py new file mode 100644 index 00000000..1a5f2a98 --- /dev/null +++ b/truffe2/accounting_main/migrations/0003_auto_20201104_1648.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2020-11-04 15:48 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('accounting_main', '0002_auto_20201104_1311-3'), + ] + + operations = [ + migrations.AlterField( + model_name='budget', + name='name', + field=models.CharField(default=b'---', max_length=255, verbose_name='Titre du budget'), + ), + ] diff --git a/truffe2/accounting_main/migrations/0003_auto__add_field_accountingline_account.py b/truffe2/accounting_main/migrations/0003_auto__add_field_accountingline_account.py deleted file mode 100644 index 4187d7af..00000000 --- a/truffe2/accounting_main/migrations/0003_auto__add_field_accountingline_account.py +++ /dev/null @@ -1,145 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'AccountingLine.account' - db.add_column(u'accounting_main_accountingline', 'account', - self.gf('django.db.models.fields.related.ForeignKey')(default=1, to=orm['accounting_core.Account']), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'AccountingLine.account' - db.delete_column(u'accounting_main_accountingline', 'account_id') - - - models = { - u'accounting_core.account': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'Account'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'visibility': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'accounting_core.accountcategory': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'AccountCategory'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}), - 'subvention_deadline': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.costcenter': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountingline': { - 'Meta': {'object_name': 'AccountingLine'}, - 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.Account']"}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'current_sum': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'date': ('django.db.models.fields.DateField', [], {}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'input': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'output': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_imported'", 'max_length': '255'}), - 'text': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), - 'tva': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountinglinelogging': { - 'Meta': {'object_name': 'AccountingLineLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingLine']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_main'] \ No newline at end of file diff --git a/truffe2/accounting_main/migrations/0004_auto_20210210_1832.py b/truffe2/accounting_main/migrations/0004_auto_20210210_1832.py new file mode 100644 index 00000000..4906e71d --- /dev/null +++ b/truffe2/accounting_main/migrations/0004_auto_20210210_1832.py @@ -0,0 +1,90 @@ +# Generated by Django 2.2.18 on 2021-02-10 17:32 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('accounting_main', '0003_auto_20201104_1648'), + ] + + operations = [ + migrations.AlterField( + model_name='accountingerror', + name='linked_line', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='accounting_main.AccountingLine', verbose_name='Ligne liée'), + ), + migrations.AlterField( + model_name='accountingerror', + name='status', + field=models.CharField(choices=[('0_drafting', 'Établisement du problème'), ('1_fixing', 'En attente de correction'), ('2_fixed', 'Correction effectuée')], default='0_drafting', max_length=255), + ), + migrations.AlterField( + model_name='accountingerrorlogging', + name='what', + field=models.CharField(choices=[('imported', 'Importé depuis Truffe 1'), ('created', 'Creation'), ('edited', 'Edité'), ('deleted', 'Supprimé'), ('restored', 'Restauré'), ('state_changed', 'Statut changé'), ('file_added', 'Fichier ajouté'), ('file_removed', 'Fichier supprimé')], max_length=64), + ), + migrations.AlterField( + model_name='accountingerrorlogging', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='accountingerrormessage', + name='author', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='accountingerrorviews', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='accountingline', + name='status', + field=models.CharField(choices=[('0_imported', 'En attente'), ('1_validated', 'Validé'), ('2_error', 'Erreur')], default='0_imported', max_length=255), + ), + migrations.AlterField( + model_name='accountinglinelogging', + name='what', + field=models.CharField(choices=[('imported', 'Importé depuis Truffe 1'), ('created', 'Creation'), ('edited', 'Edité'), ('deleted', 'Supprimé'), ('restored', 'Restauré'), ('state_changed', 'Statut changé'), ('file_added', 'Fichier ajouté'), ('file_removed', 'Fichier supprimé')], max_length=64), + ), + migrations.AlterField( + model_name='accountinglinelogging', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='accountinglineviews', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='budget', + name='name', + field=models.CharField(default='---', max_length=255, verbose_name='Titre du budget'), + ), + migrations.AlterField( + model_name='budget', + name='status', + field=models.CharField(choices=[('0_draft', 'Brouillon'), ('0_correct', 'A corriger'), ('1_submited', 'Budget soumis'), ('1_private', 'Budget privé'), ('2_treated', 'Budget validé')], default='0_draft', max_length=255), + ), + migrations.AlterField( + model_name='budgetlogging', + name='what', + field=models.CharField(choices=[('imported', 'Importé depuis Truffe 1'), ('created', 'Creation'), ('edited', 'Edité'), ('deleted', 'Supprimé'), ('restored', 'Restauré'), ('state_changed', 'Statut changé'), ('file_added', 'Fichier ajouté'), ('file_removed', 'Fichier supprimé')], max_length=64), + ), + migrations.AlterField( + model_name='budgetlogging', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='budgetviews', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/truffe2/accounting_main/migrations/0004_auto__add_accountingerrorlogging__add_accountingerror.py b/truffe2/accounting_main/migrations/0004_auto__add_accountingerrorlogging__add_accountingerror.py deleted file mode 100644 index 26e88272..00000000 --- a/truffe2/accounting_main/migrations/0004_auto__add_accountingerrorlogging__add_accountingerror.py +++ /dev/null @@ -1,191 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'AccountingErrorLogging' - db.create_table(u'accounting_main_accountingerrorlogging', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('extra_data', self.gf('django.db.models.fields.TextField')(blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('what', self.gf('django.db.models.fields.CharField')(max_length=64)), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='logs', to=orm['accounting_main.AccountingError'])), - )) - db.send_create_signal(u'accounting_main', ['AccountingErrorLogging']) - - # Adding model 'AccountingError' - db.create_table(u'accounting_main_accountingerror', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('deleted', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('linked_line_text', self.gf('django.db.models.fields.CharField')(max_length=4096)), - ('initial_remark', self.gf('django.db.models.fields.TextField')()), - ('status', self.gf('django.db.models.fields.CharField')(default='0_drafting', max_length=255)), - ('accounting_year', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['accounting_core.AccountingYear'])), - ('costcenter', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['accounting_core.CostCenter'])), - ('account', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['accounting_core.Account'])), - ('linked_line', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['accounting_main.AccountingLine'], null=True, blank=True)), - ('unit', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['units.Unit'])), - )) - db.send_create_signal(u'accounting_main', ['AccountingError']) - - - def backwards(self, orm): - # Deleting model 'AccountingErrorLogging' - db.delete_table(u'accounting_main_accountingerrorlogging') - - # Deleting model 'AccountingError' - db.delete_table(u'accounting_main_accountingerror') - - - models = { - u'accounting_core.account': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'Account'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'visibility': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'accounting_core.accountcategory': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'AccountCategory'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}), - 'subvention_deadline': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.costcenter': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountingerror': { - 'Meta': {'object_name': 'AccountingError'}, - 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.Account']"}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'initial_remark': ('django.db.models.fields.TextField', [], {}), - 'linked_line': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.AccountingLine']", 'null': 'True', 'blank': 'True'}), - 'linked_line_text': ('django.db.models.fields.CharField', [], {'max_length': '4096'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_drafting'", 'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountingerrorlogging': { - 'Meta': {'object_name': 'AccountingErrorLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingError']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_main.accountingline': { - 'Meta': {'object_name': 'AccountingLine'}, - 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.Account']"}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'current_sum': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'date': ('django.db.models.fields.DateField', [], {}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'input': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'output': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_imported'", 'max_length': '255'}), - 'text': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), - 'tva': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountinglinelogging': { - 'Meta': {'object_name': 'AccountingLineLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingLine']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_main'] \ No newline at end of file diff --git a/truffe2/accounting_main/migrations/0005_auto__del_field_accountingerror_account.py b/truffe2/accounting_main/migrations/0005_auto__del_field_accountingerror_account.py deleted file mode 100644 index 2974db61..00000000 --- a/truffe2/accounting_main/migrations/0005_auto__del_field_accountingerror_account.py +++ /dev/null @@ -1,166 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting field 'AccountingError.account' - db.delete_column(u'accounting_main_accountingerror', 'account_id') - - - def backwards(self, orm): - # Adding field 'AccountingError.account' - db.add_column(u'accounting_main_accountingerror', 'account', - self.gf('django.db.models.fields.related.ForeignKey')(default=1, to=orm['accounting_core.Account']), - keep_default=False) - - - models = { - u'accounting_core.account': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'Account'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'visibility': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'accounting_core.accountcategory': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'AccountCategory'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}), - 'subvention_deadline': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.costcenter': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountingerror': { - 'Meta': {'object_name': 'AccountingError'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'initial_remark': ('django.db.models.fields.TextField', [], {}), - 'linked_line': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.AccountingLine']", 'null': 'True', 'blank': 'True'}), - 'linked_line_text': ('django.db.models.fields.CharField', [], {'max_length': '4096'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_drafting'", 'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountingerrorlogging': { - 'Meta': {'object_name': 'AccountingErrorLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingError']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_main.accountingline': { - 'Meta': {'object_name': 'AccountingLine'}, - 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.Account']"}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'current_sum': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'date': ('django.db.models.fields.DateField', [], {}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'input': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'output': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_imported'", 'max_length': '255'}), - 'text': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), - 'tva': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountinglinelogging': { - 'Meta': {'object_name': 'AccountingLineLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingLine']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_main'] \ No newline at end of file diff --git a/truffe2/accounting_main/migrations/0006_auto__add_accountingerrormessage.py b/truffe2/accounting_main/migrations/0006_auto__add_accountingerrormessage.py deleted file mode 100644 index 5600e3d5..00000000 --- a/truffe2/accounting_main/migrations/0006_auto__add_accountingerrormessage.py +++ /dev/null @@ -1,179 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'AccountingErrorMessage' - db.create_table(u'accounting_main_accountingerrormessage', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('author', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('message', self.gf('django.db.models.fields.TextField')()), - ('error', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['accounting_main.AccountingError'])), - )) - db.send_create_signal(u'accounting_main', ['AccountingErrorMessage']) - - - def backwards(self, orm): - # Deleting model 'AccountingErrorMessage' - db.delete_table(u'accounting_main_accountingerrormessage') - - - models = { - u'accounting_core.account': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'Account'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'visibility': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'accounting_core.accountcategory': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'AccountCategory'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}), - 'subvention_deadline': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.costcenter': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountingerror': { - 'Meta': {'object_name': 'AccountingError'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'initial_remark': ('django.db.models.fields.TextField', [], {}), - 'linked_line': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.AccountingLine']", 'null': 'True', 'blank': 'True'}), - 'linked_line_text': ('django.db.models.fields.CharField', [], {'max_length': '4096'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_drafting'", 'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountingerrorlogging': { - 'Meta': {'object_name': 'AccountingErrorLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingError']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_main.accountingerrormessage': { - 'Meta': {'object_name': 'AccountingErrorMessage'}, - 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}), - 'error': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.AccountingError']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'message': ('django.db.models.fields.TextField', [], {}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - u'accounting_main.accountingline': { - 'Meta': {'object_name': 'AccountingLine'}, - 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.Account']"}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'current_sum': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'date': ('django.db.models.fields.DateField', [], {}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'input': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'output': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_imported'", 'max_length': '255'}), - 'text': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), - 'tva': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountinglinelogging': { - 'Meta': {'object_name': 'AccountingLineLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingLine']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_main'] \ No newline at end of file diff --git a/truffe2/accounting_main/migrations/0007_auto__add_field_accountingline_document_id.py b/truffe2/accounting_main/migrations/0007_auto__add_field_accountingline_document_id.py deleted file mode 100644 index a069783a..00000000 --- a/truffe2/accounting_main/migrations/0007_auto__add_field_accountingline_document_id.py +++ /dev/null @@ -1,175 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'AccountingLine.document_id' - db.add_column(u'accounting_main_accountingline', 'document_id', - self.gf('django.db.models.fields.PositiveIntegerField')(null=True, blank=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'AccountingLine.document_id' - db.delete_column(u'accounting_main_accountingline', 'document_id') - - - models = { - u'accounting_core.account': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'Account'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'visibility': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'accounting_core.accountcategory': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'AccountCategory'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}), - 'subvention_deadline': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.costcenter': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountingerror': { - 'Meta': {'object_name': 'AccountingError'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'initial_remark': ('django.db.models.fields.TextField', [], {}), - 'linked_line': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.AccountingLine']", 'null': 'True', 'blank': 'True'}), - 'linked_line_text': ('django.db.models.fields.CharField', [], {'max_length': '4096'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_drafting'", 'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountingerrorlogging': { - 'Meta': {'object_name': 'AccountingErrorLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingError']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_main.accountingerrormessage': { - 'Meta': {'object_name': 'AccountingErrorMessage'}, - 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}), - 'error': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.AccountingError']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'message': ('django.db.models.fields.TextField', [], {}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - u'accounting_main.accountingline': { - 'Meta': {'object_name': 'AccountingLine'}, - 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.Account']"}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'current_sum': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'date': ('django.db.models.fields.DateField', [], {}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'document_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'input': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'output': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_imported'", 'max_length': '255'}), - 'text': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), - 'tva': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountinglinelogging': { - 'Meta': {'object_name': 'AccountingLineLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingLine']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_main'] \ No newline at end of file diff --git a/truffe2/accounting_main/migrations/0008_auto__del_field_accountingerror_linked_line_text__add_field_accounting.py b/truffe2/accounting_main/migrations/0008_auto__del_field_accountingerror_linked_line_text__add_field_accounting.py deleted file mode 100644 index 408d2b38..00000000 --- a/truffe2/accounting_main/migrations/0008_auto__del_field_accountingerror_linked_line_text__add_field_accounting.py +++ /dev/null @@ -1,183 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting field 'AccountingError.linked_line_text' - db.delete_column(u'accounting_main_accountingerror', 'linked_line_text') - - # Adding field 'AccountingError.linked_line_cache' - db.add_column(u'accounting_main_accountingerror', 'linked_line_cache', - self.gf('django.db.models.fields.CharField')(default='', max_length=4096), - keep_default=False) - - - def backwards(self, orm): - # Adding field 'AccountingError.linked_line_text' - db.add_column(u'accounting_main_accountingerror', 'linked_line_text', - self.gf('django.db.models.fields.CharField')(default='', max_length=4096), - keep_default=False) - - # Deleting field 'AccountingError.linked_line_cache' - db.delete_column(u'accounting_main_accountingerror', 'linked_line_cache') - - - models = { - u'accounting_core.account': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'Account'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'visibility': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'accounting_core.accountcategory': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'AccountCategory'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}), - 'subvention_deadline': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.costcenter': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountingerror': { - 'Meta': {'object_name': 'AccountingError'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'initial_remark': ('django.db.models.fields.TextField', [], {}), - 'linked_line': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.AccountingLine']", 'null': 'True', 'blank': 'True'}), - 'linked_line_cache': ('django.db.models.fields.CharField', [], {'max_length': '4096'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_drafting'", 'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountingerrorlogging': { - 'Meta': {'object_name': 'AccountingErrorLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingError']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_main.accountingerrormessage': { - 'Meta': {'object_name': 'AccountingErrorMessage'}, - 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}), - 'error': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.AccountingError']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'message': ('django.db.models.fields.TextField', [], {}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - u'accounting_main.accountingline': { - 'Meta': {'object_name': 'AccountingLine'}, - 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.Account']"}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'current_sum': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'date': ('django.db.models.fields.DateField', [], {}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'document_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'input': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'output': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_imported'", 'max_length': '255'}), - 'text': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), - 'tva': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountinglinelogging': { - 'Meta': {'object_name': 'AccountingLineLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingLine']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_main'] \ No newline at end of file diff --git a/truffe2/accounting_main/migrations/0009_auto__add_budget__add_budgetline__add_budgetlogging.py b/truffe2/accounting_main/migrations/0009_auto__add_budget__add_budgetline__add_budgetlogging.py deleted file mode 100644 index 3fb99479..00000000 --- a/truffe2/accounting_main/migrations/0009_auto__add_budget__add_budgetline__add_budgetlogging.py +++ /dev/null @@ -1,236 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'Budget' - db.create_table(u'accounting_main_budget', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('deleted', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('name', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('status', self.gf('django.db.models.fields.CharField')(default='0_draft', max_length=255)), - ('accounting_year', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['accounting_core.AccountingYear'])), - ('costcenter', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['accounting_core.CostCenter'])), - ('unit', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['units.Unit'])), - )) - db.send_create_signal(u'accounting_main', ['Budget']) - - # Adding model 'BudgetLine' - db.create_table(u'accounting_main_budgetline', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('budget', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['accounting_main.Budget'])), - ('compte', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['accounting_core.Account'])), - ('amount', self.gf('django.db.models.fields.DecimalField')(max_digits=20, decimal_places=2)), - ('description', self.gf('django.db.models.fields.CharField')(max_length=250)), - )) - db.send_create_signal(u'accounting_main', ['BudgetLine']) - - # Adding model 'BudgetLogging' - db.create_table(u'accounting_main_budgetlogging', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('extra_data', self.gf('django.db.models.fields.TextField')(blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('what', self.gf('django.db.models.fields.CharField')(max_length=64)), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='logs', to=orm['accounting_main.Budget'])), - )) - db.send_create_signal(u'accounting_main', ['BudgetLogging']) - - - def backwards(self, orm): - # Deleting model 'Budget' - db.delete_table(u'accounting_main_budget') - - # Deleting model 'BudgetLine' - db.delete_table(u'accounting_main_budgetline') - - # Deleting model 'BudgetLogging' - db.delete_table(u'accounting_main_budgetlogging') - - - models = { - u'accounting_core.account': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'Account'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'visibility': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'accounting_core.accountcategory': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'AccountCategory'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}), - 'subvention_deadline': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.costcenter': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountingerror': { - 'Meta': {'object_name': 'AccountingError'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'initial_remark': ('django.db.models.fields.TextField', [], {}), - 'linked_line': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.AccountingLine']", 'null': 'True', 'blank': 'True'}), - 'linked_line_cache': ('django.db.models.fields.CharField', [], {'max_length': '4096'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_drafting'", 'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountingerrorlogging': { - 'Meta': {'object_name': 'AccountingErrorLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingError']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_main.accountingerrormessage': { - 'Meta': {'object_name': 'AccountingErrorMessage'}, - 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}), - 'error': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.AccountingError']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'message': ('django.db.models.fields.TextField', [], {}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - u'accounting_main.accountingline': { - 'Meta': {'object_name': 'AccountingLine'}, - 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.Account']"}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'current_sum': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'date': ('django.db.models.fields.DateField', [], {}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'document_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'input': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'output': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_imported'", 'max_length': '255'}), - 'text': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), - 'tva': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountinglinelogging': { - 'Meta': {'object_name': 'AccountingLineLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingLine']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_main.budget': { - 'Meta': {'object_name': 'Budget'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_draft'", 'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.budgetline': { - 'Meta': {'object_name': 'BudgetLine'}, - 'amount': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'budget': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.Budget']"}), - 'compte': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.Account']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '250'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - u'accounting_main.budgetlogging': { - 'Meta': {'object_name': 'BudgetLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.Budget']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_main'] \ No newline at end of file diff --git a/truffe2/accounting_main/migrations/0009_auto__add_field_accountingline_order.py b/truffe2/accounting_main/migrations/0009_auto__add_field_accountingline_order.py deleted file mode 100644 index b6059ce8..00000000 --- a/truffe2/accounting_main/migrations/0009_auto__add_field_accountingline_order.py +++ /dev/null @@ -1,176 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'AccountingLine.order' - db.add_column(u'accounting_main_accountingline', 'order', - self.gf('django.db.models.fields.PositiveIntegerField')(default=0), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'AccountingLine.order' - db.delete_column(u'accounting_main_accountingline', 'order') - - - models = { - u'accounting_core.account': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'Account'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'visibility': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'accounting_core.accountcategory': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'AccountCategory'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}), - 'subvention_deadline': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.costcenter': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountingerror': { - 'Meta': {'object_name': 'AccountingError'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'initial_remark': ('django.db.models.fields.TextField', [], {}), - 'linked_line': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.AccountingLine']", 'null': 'True', 'blank': 'True'}), - 'linked_line_cache': ('django.db.models.fields.CharField', [], {'max_length': '4096'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_drafting'", 'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountingerrorlogging': { - 'Meta': {'object_name': 'AccountingErrorLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingError']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_main.accountingerrormessage': { - 'Meta': {'object_name': 'AccountingErrorMessage'}, - 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}), - 'error': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.AccountingError']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'message': ('django.db.models.fields.TextField', [], {}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - u'accounting_main.accountingline': { - 'Meta': {'object_name': 'AccountingLine'}, - 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.Account']"}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'current_sum': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'date': ('django.db.models.fields.DateField', [], {}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'document_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'input': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), - 'output': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_imported'", 'max_length': '255'}), - 'text': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), - 'tva': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountinglinelogging': { - 'Meta': {'object_name': 'AccountingLineLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingLine']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_main'] \ No newline at end of file diff --git a/truffe2/accounting_main/migrations/0010_auto__del_field_budgetline_compte__add_field_budgetline_account.py b/truffe2/accounting_main/migrations/0010_auto__del_field_budgetline_compte__add_field_budgetline_account.py deleted file mode 100644 index 794d8db7..00000000 --- a/truffe2/accounting_main/migrations/0010_auto__del_field_budgetline_compte__add_field_budgetline_account.py +++ /dev/null @@ -1,199 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Renaming field 'ExpenseClaim.account_id' - db.rename_column(u'accounting_main_budgetline', 'compte_id', 'account_id') - - def backwards(self, orm): - # Renaming field 'ExpenseClaim.compte_id' - db.rename_column(u'accounting_main_budgetline', 'account_id', 'compte_id') - - - models = { - u'accounting_core.account': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'Account'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'visibility': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'accounting_core.accountcategory': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'AccountCategory'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}), - 'subvention_deadline': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.costcenter': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountingerror': { - 'Meta': {'object_name': 'AccountingError'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'initial_remark': ('django.db.models.fields.TextField', [], {}), - 'linked_line': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.AccountingLine']", 'null': 'True', 'blank': 'True'}), - 'linked_line_cache': ('django.db.models.fields.CharField', [], {'max_length': '4096'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_drafting'", 'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountingerrorlogging': { - 'Meta': {'object_name': 'AccountingErrorLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingError']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_main.accountingerrormessage': { - 'Meta': {'object_name': 'AccountingErrorMessage'}, - 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}), - 'error': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.AccountingError']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'message': ('django.db.models.fields.TextField', [], {}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - u'accounting_main.accountingline': { - 'Meta': {'object_name': 'AccountingLine'}, - 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.Account']"}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'current_sum': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'date': ('django.db.models.fields.DateField', [], {}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'document_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'input': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'output': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_imported'", 'max_length': '255'}), - 'text': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), - 'tva': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountinglinelogging': { - 'Meta': {'object_name': 'AccountingLineLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingLine']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_main.budget': { - 'Meta': {'object_name': 'Budget'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_draft'", 'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.budgetline': { - 'Meta': {'object_name': 'BudgetLine'}, - 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.Account']"}), - 'amount': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'budget': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.Budget']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '250'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - u'accounting_main.budgetlogging': { - 'Meta': {'object_name': 'BudgetLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.Budget']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_main'] \ No newline at end of file diff --git a/truffe2/accounting_main/migrations/0011_auto__add_budgettag__add_field_accountingline_order.py b/truffe2/accounting_main/migrations/0011_auto__add_budgettag__add_field_accountingline_order.py deleted file mode 100644 index cd4b7107..00000000 --- a/truffe2/accounting_main/migrations/0011_auto__add_budgettag__add_field_accountingline_order.py +++ /dev/null @@ -1,212 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'BudgetTag' - db.create_table(u'accounting_main_budgettag', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('tag', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='tags', to=orm['accounting_main.Budget'])), - )) - db.send_create_signal(u'accounting_main', ['BudgetTag']) - - def backwards(self, orm): - # Deleting model 'BudgetTag' - db.delete_table(u'accounting_main_budgettag') - - - models = { - u'accounting_core.account': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'Account'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'visibility': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'accounting_core.accountcategory': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'AccountCategory'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'last_accounting_import': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}), - 'subvention_deadline': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.costcenter': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountingerror': { - 'Meta': {'object_name': 'AccountingError'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'initial_remark': ('django.db.models.fields.TextField', [], {}), - 'linked_line': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.AccountingLine']", 'null': 'True', 'blank': 'True'}), - 'linked_line_cache': ('django.db.models.fields.CharField', [], {'max_length': '4096'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_drafting'", 'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountingerrorlogging': { - 'Meta': {'object_name': 'AccountingErrorLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingError']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_main.accountingerrormessage': { - 'Meta': {'object_name': 'AccountingErrorMessage'}, - 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}), - 'error': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.AccountingError']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'message': ('django.db.models.fields.TextField', [], {}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - u'accounting_main.accountingline': { - 'Meta': {'object_name': 'AccountingLine'}, - 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.Account']"}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'current_sum': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'date': ('django.db.models.fields.DateField', [], {}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'document_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'input': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), - 'output': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_imported'", 'max_length': '255'}), - 'text': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), - 'tva': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountinglinelogging': { - 'Meta': {'object_name': 'AccountingLineLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingLine']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_main.budget': { - 'Meta': {'object_name': 'Budget'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_draft'", 'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.budgetline': { - 'Meta': {'object_name': 'BudgetLine'}, - 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.Account']"}), - 'amount': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'budget': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.Budget']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '250'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - u'accounting_main.budgetlogging': { - 'Meta': {'object_name': 'BudgetLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.Budget']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_main.budgettag': { - 'Meta': {'object_name': 'BudgetTag'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'tags'", 'to': u"orm['accounting_main.Budget']"}), - 'tag': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_main'] \ No newline at end of file diff --git a/truffe2/accounting_main/migrations/0012_auto__del_field_accountingline_unit__del_field_accountingerror_unit.py b/truffe2/accounting_main/migrations/0012_auto__del_field_accountingline_unit__del_field_accountingerror_unit.py deleted file mode 100644 index ecdffbbc..00000000 --- a/truffe2/accounting_main/migrations/0012_auto__del_field_accountingline_unit__del_field_accountingerror_unit.py +++ /dev/null @@ -1,225 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting field 'AccountingLine.unit' - db.delete_column(u'accounting_main_accountingline', 'unit_id') - - # Deleting field 'AccountingError.unit' - db.delete_column(u'accounting_main_accountingerror', 'unit_id') - - - def backwards(self, orm): - - # User chose to not deal with backwards NULL issues for 'AccountingLine.unit' - raise RuntimeError("Cannot reverse this migration. 'AccountingLine.unit' and its values cannot be restored.") - - # The following code is provided here to aid in writing a correct migration # Adding field 'AccountingLine.unit' - db.add_column(u'accounting_main_accountingline', 'unit', - self.gf('django.db.models.fields.related.ForeignKey')(to=orm['units.Unit']), - keep_default=False) - - - # User chose to not deal with backwards NULL issues for 'AccountingError.unit' - raise RuntimeError("Cannot reverse this migration. 'AccountingError.unit' and its values cannot be restored.") - - # The following code is provided here to aid in writing a correct migration # Adding field 'AccountingError.unit' - db.add_column(u'accounting_main_accountingerror', 'unit', - self.gf('django.db.models.fields.related.ForeignKey')(to=orm['units.Unit']), - keep_default=False) - - - models = { - u'accounting_core.account': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'Account'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'visibility': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'accounting_core.accountcategory': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'AccountCategory'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'last_accounting_import': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}), - 'subvention_deadline': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.costcenter': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountingerror': { - 'Meta': {'object_name': 'AccountingError'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'initial_remark': ('django.db.models.fields.TextField', [], {}), - 'linked_line': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.AccountingLine']", 'null': 'True', 'blank': 'True'}), - 'linked_line_cache': ('django.db.models.fields.CharField', [], {'max_length': '4096'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_drafting'", 'max_length': '255'}) - }, - u'accounting_main.accountingerrorlogging': { - 'Meta': {'object_name': 'AccountingErrorLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingError']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_main.accountingerrormessage': { - 'Meta': {'object_name': 'AccountingErrorMessage'}, - 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}), - 'error': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.AccountingError']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'message': ('django.db.models.fields.TextField', [], {}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - u'accounting_main.accountingline': { - 'Meta': {'object_name': 'AccountingLine'}, - 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.Account']"}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'current_sum': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'date': ('django.db.models.fields.DateField', [], {}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'document_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'input': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), - 'output': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_imported'", 'max_length': '255'}), - 'text': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), - 'tva': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}) - }, - u'accounting_main.accountinglinelogging': { - 'Meta': {'object_name': 'AccountingLineLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingLine']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_main.budget': { - 'Meta': {'object_name': 'Budget'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_draft'", 'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.budgetline': { - 'Meta': {'object_name': 'BudgetLine'}, - 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.Account']"}), - 'amount': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'budget': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.Budget']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '250'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - u'accounting_main.budgetlogging': { - 'Meta': {'object_name': 'BudgetLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.Budget']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_main.budgettag': { - 'Meta': {'object_name': 'BudgetTag'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'tags'", 'to': u"orm['accounting_main.Budget']"}), - 'tag': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_betatester': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_main'] \ No newline at end of file diff --git a/truffe2/accounting_main/migrations/0013_auto__add_budgetviews__add_accountingerrorviews__add_accountinglinevie.py b/truffe2/accounting_main/migrations/0013_auto__add_budgetviews__add_accountingerrorviews__add_accountinglinevie.py deleted file mode 100644 index 5c7f0bdc..00000000 --- a/truffe2/accounting_main/migrations/0013_auto__add_budgetviews__add_accountingerrorviews__add_accountinglinevie.py +++ /dev/null @@ -1,260 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'BudgetViews' - db.create_table(u'accounting_main_budgetviews', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='views', to=orm['accounting_main.Budget'])), - )) - db.send_create_signal(u'accounting_main', ['BudgetViews']) - - # Adding model 'AccountingErrorViews' - db.create_table(u'accounting_main_accountingerrorviews', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='views', to=orm['accounting_main.AccountingError'])), - )) - db.send_create_signal(u'accounting_main', ['AccountingErrorViews']) - - # Adding model 'AccountingLineViews' - db.create_table(u'accounting_main_accountinglineviews', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='views', to=orm['accounting_main.AccountingLine'])), - )) - db.send_create_signal(u'accounting_main', ['AccountingLineViews']) - - - def backwards(self, orm): - # Deleting model 'BudgetViews' - db.delete_table(u'accounting_main_budgetviews') - - # Deleting model 'AccountingErrorViews' - db.delete_table(u'accounting_main_accountingerrorviews') - - # Deleting model 'AccountingLineViews' - db.delete_table(u'accounting_main_accountinglineviews') - - - models = { - u'accounting_core.account': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'Account'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'visibility': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'accounting_core.accountcategory': { - 'Meta': {'unique_together': "(('name', 'accounting_year'),)", 'object_name': 'AccountCategory'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.accountingyear': { - 'Meta': {'object_name': 'AccountingYear'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'last_accounting_import': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_preparing'", 'max_length': '255'}), - 'subvention_deadline': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'accounting_core.costcenter': { - 'Meta': {'unique_together': "(('name', 'accounting_year'), ('account_number', 'accounting_year'))", 'object_name': 'CostCenter'}, - 'account_number': ('django.db.models.fields.CharField', [], {'max_length': '10'}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.accountingerror': { - 'Meta': {'object_name': 'AccountingError'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'initial_remark': ('django.db.models.fields.TextField', [], {}), - 'linked_line': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.AccountingLine']", 'null': 'True', 'blank': 'True'}), - 'linked_line_cache': ('django.db.models.fields.CharField', [], {'max_length': '4096'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_drafting'", 'max_length': '255'}) - }, - u'accounting_main.accountingerrorlogging': { - 'Meta': {'object_name': 'AccountingErrorLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingError']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_main.accountingerrormessage': { - 'Meta': {'object_name': 'AccountingErrorMessage'}, - 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}), - 'error': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.AccountingError']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'message': ('django.db.models.fields.TextField', [], {}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - u'accounting_main.accountingerrorviews': { - 'Meta': {'object_name': 'AccountingErrorViews'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': u"orm['accounting_main.AccountingError']"}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_main.accountingline': { - 'Meta': {'object_name': 'AccountingLine'}, - 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.Account']"}), - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'current_sum': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'date': ('django.db.models.fields.DateField', [], {}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'document_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'input': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), - 'output': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_imported'", 'max_length': '255'}), - 'text': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), - 'tva': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}) - }, - u'accounting_main.accountinglinelogging': { - 'Meta': {'object_name': 'AccountingLineLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.AccountingLine']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_main.accountinglineviews': { - 'Meta': {'object_name': 'AccountingLineViews'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': u"orm['accounting_main.AccountingLine']"}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_main.budget': { - 'Meta': {'object_name': 'Budget'}, - 'accounting_year': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.AccountingYear']"}), - 'costcenter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.CostCenter']"}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_draft'", 'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'accounting_main.budgetline': { - 'Meta': {'object_name': 'BudgetLine'}, - 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_core.Account']"}), - 'amount': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '2'}), - 'budget': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting_main.Budget']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '250'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - u'accounting_main.budgetlogging': { - 'Meta': {'object_name': 'BudgetLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['accounting_main.Budget']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'accounting_main.budgettag': { - 'Meta': {'object_name': 'BudgetTag'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'tags'", 'to': u"orm['accounting_main.Budget']"}), - 'tag': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'accounting_main.budgetviews': { - 'Meta': {'object_name': 'BudgetViews'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': u"orm['accounting_main.Budget']"}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'homepage': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_betatester': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['accounting_main'] \ No newline at end of file diff --git a/truffe2/accounting_main/models.py b/truffe2/accounting_main/models.py index 23a9de82..cc335f6c 100644 --- a/truffe2/accounting_main/models.py +++ b/truffe2/accounting_main/models.py @@ -5,17 +5,16 @@ from django.contrib import messages from django.db import models from django.db.models import Q +from django.db.models.deletion import PROTECT from django.forms import CharField, Form, Textarea, BooleanField from django.shortcuts import get_object_or_404 -from django.utils.translation import ugettext_lazy as _ - +from django.utils.translation import gettext_lazy as _ import collections from copy import deepcopy import json from math import copysign - from accounting_core.utils import AccountingYearLinked, CostCenterLinked from accounting_core.models import AccountingGroupModels from app.utils import get_current_year, get_current_unit @@ -208,7 +207,7 @@ def rights_can_DISPLAY_LOG(self, user): """Always display log, even if current state dosen't allow edit""" return super(_AccountingLine, self).rights_can_EDIT(user) - def __unicode__(self): + def __str__(self): if self.output and self.input: return u'{}: {} (-{}/+{})'.format(self.date, self.text, intcomma(floatformat(self.output, 2)), intcomma(floatformat(self.input, 2))) elif self.output: @@ -270,7 +269,7 @@ def switch_status_signal(self, request, old_status, dest_status): error.status = '2_fixed' error.save() - AccountingErrorLogging(who=request.user, what='state_changed', object=error, extra_data=json.dumps({'old': unicode(error.MetaState.states.get(old_status)), 'new': unicode(error.MetaState.states.get('2_fixed'))})).save() + AccountingErrorLogging(who=request.user, what='state_changed', object=error, extra_data=json.dumps({'old': str(error.MetaState.states.get(old_status)), 'new': str(error.MetaState.states.get('2_fixed'))})).save() unotify_people(u'AccountingError.{}.created'.format(self.costcenter.unit), error) notify_people(request, u'AccountingError.{}.fixed'.format(self.costcenter.unit), 'accounting_error_fixed', error, error.build_group_members_for_compta_everyone_with_messages()) @@ -428,7 +427,7 @@ def rights_can_DISPLAY_LOG(self, user): """Always display log, even if current state dosen't allow edit""" return super(_AccountingError, self).rights_can_EDIT(user) - def __unicode__(self): + def __str__(self): return u'Erreur: {}'.format(self.get_linked_line()) def genericFormExtraInit(self, form, current_user, *args, **kwargs): @@ -437,7 +436,7 @@ def genericFormExtraInit(self, form, current_user, *args, **kwargs): def get_linked_line(self): if self.linked_line: - return self.linked_line.__unicode__() + return self.linked_line.__str__() elif self.linked_line_cache: return u'{} (Cache)'.format(self.linked_line_cache) else: @@ -446,7 +445,7 @@ def get_linked_line(self): def save(self, *args, **kwargs): if not self.linked_line_cache and self.linked_line: - self.linked_line_cache = self.linked_line.__unicode__() + self.linked_line_cache = self.linked_line.__str__() return super(_AccountingError, self).save(*args, **kwargs) @@ -487,7 +486,7 @@ def switch_status_signal(self, request, old_status, dest_status): self.linked_line.status = '1_validated' self.linked_line.save() - AccountingLineLogging(who=request.user, what='state_changed', object=self.linked_line, extra_data=json.dumps({'old': unicode(self.linked_line.MetaState.states.get(old_status)), 'new': unicode(self.linked_line.MetaState.states.get('1_validated'))})).save() + AccountingLineLogging(who=request.user, what='state_changed', object=self.linked_line, extra_data=json.dumps({'old': str(self.linked_line.MetaState.states.get(old_status)), 'new': str(self.linked_line.MetaState.states.get('1_validated'))})).save() unotify_people(u'AccountingLine.{}.error'.format(self.costcenter.unit), self.linked_line) notify_people(request, u'AccountingLine.{}.fixed'.format(self.costcenter.unit), 'accounting_line_fixed', self.linked_line, self.linked_line.build_group_members_for_compta_everyone()) @@ -511,10 +510,10 @@ def build_group_members_for_compta_everyone_with_messages(self): class AccountingErrorMessage(models.Model): - author = models.ForeignKey(TruffeUser) + author = models.ForeignKey(TruffeUser, on_delete=PROTECT) when = models.DateTimeField(auto_now_add=True) message = models.TextField() - error = models.ForeignKey('AccountingError') + error = models.ForeignKey('AccountingError', on_delete=PROTECT) class _Budget(GenericModel, GenericStateModel, AccountingYearLinked, CostCenterLinked, UnitEditableModel, GenericContactableModel, GenericTaggableObject, AccountingGroupModels, SearchableModel): @@ -524,7 +523,7 @@ class MetaRightsUnit(UnitEditableModel.MetaRightsUnit): access = ['TRESORERIE', 'SECRETARIAT'] unit_ro_access = True - name = models.CharField(_(u'Titre du budget'), max_length=255) + name = models.CharField(_(u'Titre du budget'), max_length=255, default='---') unit = FalseFK('units.models.Unit') class MetaData: @@ -556,6 +555,7 @@ class Meta: abstract = True class MetaEdit: + @staticmethod def do_extra_post_actions(obj, request, post_request, form_is_valid): """Edit budget lines on edit""" @@ -563,10 +563,10 @@ def do_extra_post_actions(obj, request, post_request, form_is_valid): from accounting_main.models import BudgetLine old_lines = collections.defaultdict(list) # {account: [{'amount', 'description'}, ...], ...} - map(lambda line: old_lines[line.account.pk].append({'amount': line.amount, 'description': line.description}), obj.budgetline_set.all()) + list(map(lambda line: old_lines[line.account.pk].append({'amount': line.amount, 'description': line.description}), obj.budgetline_set.all())) lines = collections.defaultdict(dict) # {id: {type, account_pk, entries: {id1: {description, amount}, id2:{}, ...}}, ...} - for (field, value) in post_request.iteritems(): + for (field, value) in post_request.items(): if field.startswith('account-'): field_arr = field.split('-') @@ -595,7 +595,7 @@ def do_extra_post_actions(obj, request, post_request, form_is_valid): try: account = Account.objects.get(pk=line_object['account_pk']) coeff = line_object['type'] # -1 for outcomes, 1 for incomes - entries = sorted(line_object['entries'].items(), key=lambda (x, y): x) + entries = sorted(line_object['entries'].items(), key=lambda x, y: x) for entry in entries: if entry[1]['amount']: new_lines[account.pk].append({'amount': coeff * abs(float(entry[1]['amount'])), 'description': entry[1].get('description', '')}) @@ -643,14 +643,14 @@ def do_extra_post_actions(obj, request, post_request, form_is_valid): BudgetLine.objects.filter(budget=obj, account=acc, description=entry['description'], amount=entry['amount']).first().delete() for (title, lines) in [('log_add', new_lines), ('log_update', modif_lines), ('log_delete', old_lines)]: - map(lambda key: lines.pop(key), filter(lambda key: not lines[key], lines.keys())) + list(map(lambda key: lines.pop(key), list(filter(lambda key: not lines[key], lines.keys())))) if title == 'log_update': - result[title] = dict(map(lambda (acc, entries): (u'{}'.format(Account.objects.get(pk=acc)), - (u', '.join(map(lambda ent: u'{} : {}'.format(ent['description'], ent['old_amount']), entries)), - u', '.join(map(lambda ent: u'{} : {}'.format(ent['description'], ent['amount']), entries)))), lines.items())) + result[title] = dict(map(lambda line_item: (u'{}'.format(Account.objects.get(pk=line_item[0])), + (u', '.join(map(lambda ent: u'{} : {}'.format(ent['description'], ent['old_amount']), line_item[1])), + u', '.join(map(lambda ent: u'{} : {}'.format(ent['description'], ent['amount']), line_item[1])))), lines.items())) else: - result[title] = dict(map(lambda (acc, entries): (u'{}'.format(Account.objects.get(pk=acc)), - u', '.join(map(lambda ent: u'{} : {}'.format(ent['description'], ent['amount']), entries))), lines.items())) + result[title] = dict(map(lambda line_item: (u'{}'.format(Account.objects.get(pk=line_item[0])), + u', '.join(map(lambda ent: u'{} : {}'.format(ent['description'], ent['amount']), line_item[1]))), lines.items())) return result class MetaState: @@ -758,7 +758,7 @@ def rights_can_SHOW(self, user): return super(_Budget, self).rights_can_SHOW(user) - def __unicode__(self): + def __str__(self): return u"{} ({})".format(self.name, self.costcenter) def get_total_incomes(self): @@ -782,11 +782,11 @@ def get_total(self): class BudgetLine(models.Model): - budget = models.ForeignKey('Budget', verbose_name=_('Budget')) - account = models.ForeignKey('accounting_core.Account', verbose_name=_('Compte')) + budget = models.ForeignKey('Budget', verbose_name=_('Budget'), on_delete=PROTECT) + account = models.ForeignKey('accounting_core.Account', verbose_name=_('Compte'), on_delete=PROTECT) amount = models.DecimalField(_('Montant'), max_digits=20, decimal_places=2) description = models.CharField(max_length=250) - def __unicode__(self): + def __str__(self): return "{} : {} ({} - {})".format(self.budget, self.amount, self.description, self.account.account_number) diff --git a/truffe2/accounting_main/templates/accounting_main/accountingerror/show.html b/truffe2/accounting_main/templates/accounting_main/accountingerror/show.html index 3417050c..0be9e839 100644 --- a/truffe2/accounting_main/templates/accounting_main/accountingerror/show.html +++ b/truffe2/accounting_main/templates/accounting_main/accountingerror/show.html @@ -12,7 +12,7 @@
    {% for message in obj.get_messages %}
  • - +
    - +
    @@ -281,7 +280,7 @@

    {% trans "Facture" %}
    {% t
    - +
    {% trans "Attention: Ce BVR ne peut pas être utilisé pour un paiement aux guichets de la poste ou d'une banque" %} diff --git a/truffe2/accounting_tools/templates/accounting_tools/invoice/show.html b/truffe2/accounting_tools/templates/accounting_tools/invoice/show.html index f6b65592..3f91dfb2 100644 --- a/truffe2/accounting_tools/templates/accounting_tools/invoice/show.html +++ b/truffe2/accounting_tools/templates/accounting_tools/invoice/show.html @@ -3,7 +3,7 @@ {% block bonus_buttons %} {% ifhasright obj user 'DOWNLOAD_PDF' %} - PDF + PDF {% endifhasright %} {% endblock %} diff --git a/truffe2/accounting_tools/templates/accounting_tools/providerinvoice/edit.html b/truffe2/accounting_tools/templates/accounting_tools/providerinvoice/edit.html index f27b507c..87948a47 100644 --- a/truffe2/accounting_tools/templates/accounting_tools/providerinvoice/edit.html +++ b/truffe2/accounting_tools/templates/accounting_tools/providerinvoice/edit.html @@ -37,7 +37,7 @@ $('#id_currency').removeClass('form-control'); $('#id_currency').css('width', '100%').select2(); - $('#id_provider').parent().before().append(' Ajouter un fournisseur'); + $('#id_provider').parent().before().append(' Ajouter un fournisseur'); update_accounts(); update_provider(); @@ -45,7 +45,7 @@ function update_accounts() { - $.ajax('{% url 'accounting_core.views.account_available_list' %}?ypk=' + $('#input_ypk').val()).done(function (data) { + $.ajax('{% url 'accounting_core-views-account_available_list' %}?ypk=' + $('#input_ypk').val()).done(function (data) { var options = ''; $.each(data.data, function (index, option) { @@ -67,7 +67,7 @@ } function update_provider() { - $.ajax('{% url 'accounting_tools.views.provider_available_list' %}').done(function (data) { + $.ajax('{% url 'accounting_tools-views-provider_available_list' %}').done(function (data) { var old_value = $('#id_provider').val(); diff --git a/truffe2/accounting_tools/templates/accounting_tools/providerinvoice/list_json.html b/truffe2/accounting_tools/templates/accounting_tools/providerinvoice/list_json.html index 38f869f8..d07f998e 100644 --- a/truffe2/accounting_tools/templates/accounting_tools/providerinvoice/list_json.html +++ b/truffe2/accounting_tools/templates/accounting_tools/providerinvoice/list_json.html @@ -2,5 +2,5 @@ {% load i18n %} {% block bonus_buttons %} - + {% endblock %} diff --git a/truffe2/accounting_tools/templates/accounting_tools/providerinvoice/pdf.html b/truffe2/accounting_tools/templates/accounting_tools/providerinvoice/pdf.html index ada83933..70be6cd1 100644 --- a/truffe2/accounting_tools/templates/accounting_tools/providerinvoice/pdf.html +++ b/truffe2/accounting_tools/templates/accounting_tools/providerinvoice/pdf.html @@ -33,19 +33,19 @@

    {% trans "Fa {% trans "Visa de l'unité : " %} - {% if object.get_unit_signer %}  {{ object.get_unit_signer.first_name }} {{ object.get_unit_signer.last_name }}{% endif %} + {% if object.get_unit_signer %}  {{ object.get_unit_signer.first_name }} {{ object.get_unit_signer.last_name }}{% endif %}    {% trans "Visa AGEPoly (1): " %} - {% if object.get_root_unit_signer_1 %}  {{ object.get_root_unit_signer_1.first_name }} {{ object.get_root_unit_signer_1.last_name }}{% endif %} + {% if object.get_root_unit_signer_1 %}  {{ object.get_root_unit_signer_1.first_name }} {{ object.get_root_unit_signer_1.last_name }}{% endif %}    {% trans "Visa AGEPoly (2): " %} - {% if object.get_root_unit_signer_2 %}  {{ object.get_root_unit_signer_2.first_name }} {{ object.get_root_unit_signer_2.last_name }}{% endif %} + {% if object.get_root_unit_signer_2 %}  {{ object.get_root_unit_signer_2.first_name }} {{ object.get_root_unit_signer_2.last_name }}{% endif %} diff --git a/truffe2/accounting_tools/templates/accounting_tools/providerinvoice/show.html b/truffe2/accounting_tools/templates/accounting_tools/providerinvoice/show.html index 32ea110b..d40a8861 100644 --- a/truffe2/accounting_tools/templates/accounting_tools/providerinvoice/show.html +++ b/truffe2/accounting_tools/templates/accounting_tools/providerinvoice/show.html @@ -2,7 +2,7 @@ {% load i18n humanize %} {% block bonus_buttons %} - PDF + PDF {% endblock %} {% block post_lines %} diff --git a/truffe2/accounting_tools/templates/accounting_tools/subvention/edit.html b/truffe2/accounting_tools/templates/accounting_tools/subvention/edit.html index 8397aabd..85e72e05 100644 --- a/truffe2/accounting_tools/templates/accounting_tools/subvention/edit.html +++ b/truffe2/accounting_tools/templates/accounting_tools/subvention/edit.html @@ -62,7 +62,7 @@ }); function update_budget() { - $.ajax('{% url 'accounting_main.views.budget_available_list' %}?ypk=' + $('#input_ypk').val() + '&upk=' + $('#input_upk').val()).done(function (data) { + $.ajax('{% url 'accounting_main-views-budget_available_list' %}?ypk=' + $('#input_ypk').val() + '&upk=' + $('#input_upk').val()).done(function (data) { $('#id_linked_budget option').remove(); $('#id_linked_budget').append( $('').val('').html('---------') diff --git a/truffe2/accounting_tools/templates/accounting_tools/subvention/list.html b/truffe2/accounting_tools/templates/accounting_tools/subvention/list.html index 0fb04da7..79d32d65 100644 --- a/truffe2/accounting_tools/templates/accounting_tools/subvention/list.html +++ b/truffe2/accounting_tools/templates/accounting_tools/subvention/list.html @@ -2,18 +2,18 @@ {% load i18n rights_extras %} {% block bonus_year_updated %} - $('#export-year').attr('href', '{% url 'accounting_tools.views.export_demands_yearly' 9999429999 %}'.replace(9999429999, pk)); + $('#export-year').attr('href', '{% url 'accounting_tools-views-export_demands_yearly' 9999429999 %}'.replace(9999429999, pk)); {% endblock %} {% block extrabuttons %} {% ifhasright Model user 'EXPORT' %} - + {% trans "Exporter cette année" %} {% endifhasright %} {% ifhasright Model user 'EXPORT' %} - + {% trans "Tout exporter" %} diff --git a/truffe2/accounting_tools/templates/accounting_tools/withdrawal/list_json.html b/truffe2/accounting_tools/templates/accounting_tools/withdrawal/list_json.html index c2c7e9d1..5f39e232 100644 --- a/truffe2/accounting_tools/templates/accounting_tools/withdrawal/list_json.html +++ b/truffe2/accounting_tools/templates/accounting_tools/withdrawal/list_json.html @@ -2,5 +2,5 @@ {% load i18n %} {% block bonus_buttons %} - + {% endblock %} diff --git a/truffe2/accounting_tools/templates/accounting_tools/withdrawal/show.html b/truffe2/accounting_tools/templates/accounting_tools/withdrawal/show.html index 5ced4ff7..e366dc5a 100644 --- a/truffe2/accounting_tools/templates/accounting_tools/withdrawal/show.html +++ b/truffe2/accounting_tools/templates/accounting_tools/withdrawal/show.html @@ -3,6 +3,6 @@ {% block bonus_buttons %} -{% trans "Voir le PDF" %} +{% trans "Voir le PDF" %} {% endblock %} diff --git a/truffe2/accounting_tools/tests.py b/truffe2/accounting_tools/tests.py index 7ce503c2..3ab449dc 100644 --- a/truffe2/accounting_tools/tests.py +++ b/truffe2/accounting_tools/tests.py @@ -1,3 +1,209 @@ -from django.test import TestCase +# -*- coding: utf-8 -*- +""" +This file demonstrates writing tests using the unittest module. These will pass +when you run "manage.py test". -# Create your tests here. +Replace this with more appropriate tests for your application. +""" + +from main.test_tools import TruffeTestAbstract +from os.path import join, dirname + + +class AccountingToolsNoLoginTest(TruffeTestAbstract): + + def test_subvention_list(self): + self.call_check_redirect('/accounting/tools/subvention/') + + def test_subvention_mayi(self): + self.call_check_redirect('/accounting/tools/subvention/mayi') + + def test_subvention_json(self): + self.call_check_redirect('/accounting/tools/subvention/json') + + def test_subvention_deleted(self): + self.call_check_redirect('/accounting/tools/subvention/deleted') + + def test_subvention_logs(self): + self.call_check_redirect('/accounting/tools/subvention/logs') + + def test_subvention_logs_json(self): + self.call_check_redirect('/accounting/tools/subvention/logs/json') + + def test_subvention_add(self): + self.call_check_redirect('/accounting/tools/subvention/~/edit') + + def test_subvention_edit(self): + self.call_check_redirect('/accounting/tools/subvention/1/edit') + + def test_subvention_delete(self): + self.call_check_redirect('/accounting/tools/subvention/1/delete') + + def test_subvention_show(self): + self.call_check_redirect('/accounting/tools/subvention/1/') + + def test_subvention_export(self): + self.call_check_redirect('/accounting/tools/subvention/1/export') + + def test_subvention_export_all(self): + self.call_check_redirect('/accounting/tools/subvention/export_all') + + def test_invoice_pdf(self): + self.call_check_redirect('/accounting/tools/invoice/1/pdf/') + + def test_invoice_bvr(self): + self.call_check_redirect('/accounting/tools/invoice/1/bvr/') + + def test_withdrawal_pdf(self): + self.call_check_redirect('/accounting/tools/withdrawal/1/pdf/') + + def test_withdrawal_list(self): + self.call_check_redirect('/accounting/tools/withdrawal/list/') + + def test_withdrawal_infos(self): + self.call_check_redirect('/accounting/tools/withdrawal/1/infos/') + + def test_internaltransfer_pdf(self): + self.call_check_redirect('/accounting/tools/internaltransfer/1/pdf/') + + def test_expenseclaim_pdf(self): + self.call_check_redirect('/accounting/tools/expenseclaim/1/pdf/') + + def test_cashbook_pdf(self): + self.call_check_redirect('/accounting/tools/cashbook/1/pdf/') + + def test_financialprovider_list(self): + self.call_check_redirect('/accounting/tools/financialprovider/list/') + + def test_providerinvoice_pdf(self): + self.call_check_redirect('/accounting/tools/providerinvoice/1/pdf/') + + def test_internaltransfer_csv(self): + self.call_check_redirect('/accounting/tools/internaltransfer/1/csv/') + + def test_expenseclaim_csv(self): + self.call_check_redirect('/accounting/tools/expenseclaim/1/csv/') + + def test_cashbook_csv(self): + self.call_check_redirect('/accounting/tools/cashbook/1/csv/') + + def test_subventionfile_upload(self): + self.call_check_redirect('/accounting/tools/subventionfile/upload') + + def test_subventionfile_delete(self): + self.call_check_redirect('/accounting/tools/subventionfile/1/delete') + + def test_subventionfile_get(self): + self.call_check_redirect('/accounting/tools/subventionfile/1/get/') + + def test_subventionfile_thumbnail(self): + self.call_check_redirect('/accounting/tools/subventionfile/1/thumbnail') + + +class AccountingToolsWithLoginTest(TruffeTestAbstract): + + login_username = 'admin' + + def test_subvention_mayi(self): + self.call_check_json('/accounting/tools/subvention/mayi') + + def test_subvention_json(self): + self.call_check_json('/accounting/tools/subvention/json', data={'upk':1}) + + def test_subvention_deleted(self): + from accounting_tools.models import Subvention + Subvention(id=2, name='bad subvention', amount_asked=456, kind='subvention', linked_budget_id=1, accounting_year_id=1, unit_id=1, deleted=True).save() + self.call_check_html('/accounting/tools/subvention/deleted', data={'upk':1}) + self.call_check_redirect('/accounting/tools/subvention/deleted', method='post', data={'upk':1, 'pk':2}, redirect_url='/accounting/tools/subvention/') + + def test_subvention_logs(self): + self.call_check_html('/accounting/tools/subvention/logs') + + def test_subvention_logs_json(self): + self.call_check_json('/accounting/tools/subvention/logs/json') + + def test_subvention_add(self): + from accounting_tools.models import Subvention + Subvention.objects.get(id=1).delete() + self.call_check_html('/accounting/tools/subvention/~/edit', data={'ypk':1}) + self.call_check_redirect('/accounting/tools/subvention/~/edit', method='post', redirect_url='/accounting/tools/subvention/2/', + data={'ypk':1, "name":"new", "amount_asked":123, "kind":"subvention", 'linked_budget':1, 'unit':1}) + + def test_subvention_edit(self): + self.call_check_html('/accounting/tools/subvention/1/edit', data={'ypk':1}) + self.call_check_redirect('/accounting/tools/subvention/1/edit', method='post', redirect_url='/accounting/tools/subvention/1/', + data={'ypk':1, "name":"new", "amount_asked":123, "kind":"subvention", 'linked_budget':1, 'unit':1}) + + def test_subvention_delete(self): + self.call_check_html('/accounting/tools/subvention/1/delete') + self.call_check_redirect('/accounting/tools/subvention/1/delete', method='post', data={'do':'it'}, redirect_url='/accounting/tools/subvention/') + + def test_subvention_show(self): + self.call_check_html('/accounting/tools/subvention/1/') + + def test_subvention_export(self): + self.call_check_pdf('/accounting/tools/subvention/1/export') + + def test_subvention_export_all(self): + self.call_check_pdf('/accounting/tools/subvention/export_all') + + def test_invoice_pdf(self): + self.call_check_pdf('/accounting/tools/invoice/1/pdf/') + + def test_invoice_bvr(self): + self.call('/accounting/tools/invoice/1/bvr/') + self.assertEqual(self.content_type, "image/png") + + def test_withdrawal_pdf(self): + self.call_check_pdf('/accounting/tools/withdrawal/1/pdf/') + + def test_withdrawal_list(self): + self.call_check_json('/accounting/tools/withdrawal/list/', data={'upk':1, 'ypk':1}) + + def test_withdrawal_infos(self): + self.call_check_json('/accounting/tools/withdrawal/1/infos/') + + def test_internaltransfer_pdf(self): + self.call_check_pdf('/accounting/tools/internaltransfer/1/pdf/') + + def test_expenseclaim_pdf(self): + self.call_check_pdf('/accounting/tools/expenseclaim/1/pdf/') + + def test_cashbook_pdf(self): + self.call_check_pdf('/accounting/tools/cashbook/1/pdf/') + + def test_financialprovider_list(self): + self.call_check_json('/accounting/tools/financialprovider/list/') + + def test_providerinvoice_pdf(self): + self.call_check_pdf('/accounting/tools/providerinvoice/1/pdf/') + + def test_internaltransfer_csv(self): + self.call_check_text('/accounting/tools/internaltransfer/1/csv/') + + def test_expenseclaim_csv(self): + self.call_check_text('/accounting/tools/expenseclaim/1/csv/') + + def test_cashbook_csv(self): + self.call_check_text('/accounting/tools/cashbook/1/csv/') + + def test_subventionfile_upload(self): + sess = self.session + sess.update({'pca_files_abc': []}) + sess.save() + with open(join(dirname(dirname(__file__)), 'media', 'uploads', 'files', 'bigbox.mp3'), 'rb') as file_upload: + self.call_check_json('/accounting/tools/subventionfile/upload?key=abc', data={'files[]':file_upload}, method="post") + + def test_subventionfile_delete(self): + sess = self.session + sess.update({'pca_files_abc': [1]}) + sess.save() + self.call_check_text('/accounting/tools/subventionfile/1/delete?key=abc') + + def test_subventionfile_get(self): + self.call('/accounting/tools/subventionfile/1/get/', data={'down':1}) + self.assertEqual(self.content_type, "image/png") + + def test_subventionfile_thumbnail(self): + self.call('/accounting/tools/subventionfile/1/thumbnail') + self.assertEqual(self.content_type, "image/jpeg") diff --git a/truffe2/accounting_tools/urls.py b/truffe2/accounting_tools/urls.py index 743a2ebc..470f863e 100644 --- a/truffe2/accounting_tools/urls.py +++ b/truffe2/accounting_tools/urls.py @@ -1,29 +1,31 @@ # -*- coding: utf-8 -*- -from django.conf.urls import patterns, url - - -urlpatterns = patterns( - 'accounting_tools.views', - - url(r'^subvention/(?P[0-9]+)/export$', 'export_demands_yearly'), - url(r'^subvention/export_all$', 'export_all_demands'), - - url(r'^invoice/(?P[0-9]+)/pdf/', 'invoice_pdf'), - url(r'^invoice/(?P[0-9]+)/bvr/', 'invoice_bvr'), - - url(r'^withdrawal/(?P[0-9]+)/pdf/', 'withdrawal_pdf'), - url(r'^withdrawal/list/', 'withdrawal_available_list'), - url(r'^withdrawal/(?P[0-9]+)/infos/', 'get_withdrawal_infos'), - - url(r'^internaltransfer/(?P[0-9,]+)/pdf/', 'internaltransfer_pdf'), - url(r'^expenseclaim/(?P[0-9]+)/pdf/', 'expenseclaim_pdf'), - url(r'^cashbook/(?P[0-9]+)/pdf/', 'cashbook_pdf'), - - url(r'^financialprovider/list/', 'provider_available_list'), - url(r'^providerinvoice/(?P[0-9]+)/pdf/', 'provider_invoice_pdf'), +from django.urls import re_path +from accounting_tools.views import cashbook_csv, expenseclaim_csv, \ + internaltransfer_csv, provider_invoice_pdf, export_demands_yearly, \ + export_all_demands, provider_available_list, \ + cashbook_pdf, expenseclaim_pdf, internaltransfer_pdf, get_withdrawal_infos, \ + withdrawal_available_list, withdrawal_pdf, invoice_bvr, invoice_pdf + +urlpatterns = [ + re_path(r'^subvention/(?P[0-9]+)/export$', export_demands_yearly, name='accounting_tools-views-export_demands_yearly'), + re_path(r'^subvention/export_all$', export_all_demands, name='accounting_tools-views-export_all_demands'), + + re_path(r'^invoice/(?P[0-9]+)/pdf/', invoice_pdf, name='accounting_tools-views-invoice_pdf'), + re_path(r'^invoice/(?P[0-9]+)/bvr/', invoice_bvr, name='accounting_tools-views-invoice_bvr'), + + re_path(r'^withdrawal/(?P[0-9]+)/pdf/', withdrawal_pdf, name='accounting_tools-views-withdrawal_pdf'), + re_path(r'^withdrawal/list/', withdrawal_available_list, name='accounting_tools-views-withdrawal_available_list'), + re_path(r'^withdrawal/(?P[0-9]+)/infos/', get_withdrawal_infos, name='accounting_tools-views-get_withdrawal_infos'), + + re_path(r'^internaltransfer/(?P[0-9,]+)/pdf/', internaltransfer_pdf, name='accounting_tools-views-internaltransfer_pdf'), + re_path(r'^expenseclaim/(?P[0-9]+)/pdf/', expenseclaim_pdf, name='accounting_tools-views-expenseclaim_pdf'), + re_path(r'^cashbook/(?P[0-9]+)/pdf/', cashbook_pdf, name='accounting_tools-views-cashbook_pdf'), + + re_path(r'^financialprovider/list/', provider_available_list, name='accounting_tools-views-provider_available_list'), + re_path(r'^providerinvoice/(?P[0-9]+)/pdf/', provider_invoice_pdf, name='accounting_tools-views-provider_invoice_pdf'), - url(r'^internaltransfer/(?P[0-9,]+)/csv/', 'internaltransfer_csv'), - url(r'^expenseclaim/(?P[0-9,]+)/csv/', 'expenseclaim_csv'), - url(r'^cashbook/(?P[0-9,]+)/csv/', 'cashbook_csv'), -) + re_path(r'^internaltransfer/(?P[0-9,]+)/csv/', internaltransfer_csv, name='accounting_tools-views-internaltransfer_csv'), + re_path(r'^expenseclaim/(?P[0-9,]+)/csv/', expenseclaim_csv, name='accounting_tools-views-expenseclaim_csv'), + re_path(r'^cashbook/(?P[0-9,]+)/csv/', cashbook_csv, name='accounting_tools-views-cashbook_csv'), +] diff --git a/truffe2/accounting_tools/views.py b/truffe2/accounting_tools/views.py index 1cd2e065..e472e36e 100644 --- a/truffe2/accounting_tools/views.py +++ b/truffe2/accounting_tools/views.py @@ -4,7 +4,7 @@ from django.db.models import Q, Sum from django.http import Http404, HttpResponse from django.utils.text import slugify -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.shortcuts import get_object_or_404, redirect from django.conf import settings from django.contrib import messages @@ -110,7 +110,7 @@ def invoice_bvr(request, pk): img = invoice.generate_bvr() - response = HttpResponse(mimetype="image/png") + response = HttpResponse(content_type="image/png") img.save(response, 'png') return response @@ -133,7 +133,7 @@ def internaltransfer_pdf(request, pk): from accounting_tools.models import InternalTransfer transfers = [get_object_or_404(InternalTransfer, pk=pk_, deleted=False) for pk_ in filter(lambda x: x, pk.split(','))] - transfers = filter(lambda tr: tr.rights_can('SHOW', request.user), transfers) + transfers = [tr for tr in transfers if tr.rights_can('SHOW', request.user)] if not transfers: raise Http404 @@ -149,11 +149,11 @@ def internaltransfer_csv(request, pk): from app.utils import UnicodeCSVWriter transfers = [get_object_or_404(InternalTransfer, pk=pk_, deleted=False) for pk_ in filter(lambda x: x, pk.split(','))] - transfers = filter(lambda tr: tr.rights_can('SHOW', request.user), transfers) + transfers = [tr for tr in transfers if tr.rights_can('SHOW', request.user)] response = HttpResponse(content_type='text/csv; charset=cp1252') if len(transfers) == 1: - response['Content-Disposition'] = 'attachment; filename="Transfert Interne {0} .csv"'.format(slugify(unicode(transfers[0]))) + response['Content-Disposition'] = 'attachment; filename="Transfert Interne {0} .csv"'.format(slugify(str(transfers[0]))) else: response['Content-Disposition'] = 'attachment; filename="transfers_internes_{0}.csv"'.format(datetime.date.today().strftime("%d-%m-%Y")) @@ -164,15 +164,15 @@ def internaltransfer_csv(request, pk): line_number = 1 for transfer in transfers: if not transfer.status[0] in ['2', '3']: - messages.warning(request, _(u'Internal Transfer {0} pas à l\'état à comptabiliser/en comptabilisation').format(unicode(transfer))) + messages.warning(request, _(u'Internal Transfer {0} pas à l\'état à comptabiliser/en comptabilisation').format(str(transfer))) if len(transfers) == 1: - return redirect('accounting_tools.views.internaltransfer_show', transfer.pk) + return redirect('accounting_tools-views-internaltransfer_show', transfer.pk) else: - return redirect('accounting_tools.views.internaltransfer_list') + return redirect('accounting_tools-views-internaltransfer_list') - header_row = [u'0', line_number, transfer.transfert_date.strftime(u"%d.%m.%Y"), 100000 + transfer.pk, transfer.name, transfer.amount, transfer.amount, '', '', u'CHF', 0, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', u'INT_TF#{0}'.format(unicode(transfer.pk)), ''] - debit_row = [u'1', '', '', '', '', '', '', '', '', '', '', '', u'1', line_number, transfer.account.account_number, u'CHF', u'{0} - Débit'.format(transfer.name), transfer.amount, '', 0, '', u'Non Soumis à la TVA', u'Débit', '', transfer.transfert_date.strftime(u"%d.%m.%Y"), 0, transfer.amount, transfer.amount, 0, u'INT_TF#{0}'.format(unicode(transfer.pk)), transfer.cost_center_from.account_number] - credit_row = [u'2', '', '', '', '', '', '', '', '', '', '', '', u'2', line_number, transfer.account.account_number, u'CHF', u'{0} - Crédit'.format(transfer.name), transfer.amount, '', 0, '', u'Non Soumis à la TVA', u'Crédit', '', transfer.transfert_date.strftime(u"%d.%m.%Y"), 0, transfer.amount, transfer.amount, 0, u'INT_TF#{0}'.format(unicode(transfer.pk)), transfer.cost_center_to.account_number] + header_row = [u'0', line_number, transfer.transfert_date.strftime(u"%d.%m.%Y"), 100000 + transfer.pk, transfer.name, transfer.amount, transfer.amount, '', '', u'CHF', 0, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', u'INT_TF#{0}'.format(str(transfer.pk)), ''] + debit_row = [u'1', '', '', '', '', '', '', '', '', '', '', '', u'1', line_number, transfer.account.account_number, u'CHF', u'{0} - Débit'.format(transfer.name), transfer.amount, '', 0, '', u'Non Soumis à la TVA', u'Débit', '', transfer.transfert_date.strftime(u"%d.%m.%Y"), 0, transfer.amount, transfer.amount, 0, u'INT_TF#{0}'.format(str(transfer.pk)), transfer.cost_center_from.account_number] + credit_row = [u'2', '', '', '', '', '', '', '', '', '', '', '', u'2', line_number, transfer.account.account_number, u'CHF', u'{0} - Crédit'.format(transfer.name), transfer.amount, '', 0, '', u'Non Soumis à la TVA', u'Crédit', '', transfer.transfert_date.strftime(u"%d.%m.%Y"), 0, transfer.amount, transfer.amount, 0, u'INT_TF#{0}'.format(str(transfer.pk)), transfer.cost_center_to.account_number] writer.writerows([header_row, debit_row, credit_row]) line_number = line_number + 1 return response @@ -200,7 +200,7 @@ def expenseclaim_csv(request, pk): response = HttpResponse(content_type='text/csv; charset=cp1252') if len(expenseclaims) == 1: - response['Content-Disposition'] = 'attachment; filename="NDF - {0}.csv"'.format(slugify(unicode(expenseclaims[0]))) + response['Content-Disposition'] = 'attachment; filename="NDF - {0}.csv"'.format(slugify(str(expenseclaims[0]))) else: response['Content-Disposition'] = 'attachment; filename="notes_de_frais_{0}.csv"'.format(datetime.date.today().strftime("%d-%m-%Y")) @@ -215,13 +215,13 @@ def expenseclaim_csv(request, pk): if not expenseclaim.rights_can('SHOW', request.user): raise Http404 if not expenseclaim.status[0] in ['4', '5', '6']: - messages.warning(request, _(u'NDF {0} pas à l\'état à comptabiliser/en comptabilisation').format(unicode(expenseclaim))) + messages.warning(request, _(u'NDF {0} pas à l\'état à comptabiliser/en comptabilisation').format(str(expenseclaim))) if len(expenseclaims) == 1: - return redirect('accounting_tools.views.expenseclaim_show', expenseclaim.pk) + return redirect('accounting_tools-views-expenseclaim_show', expenseclaim.pk) else: - return redirect('accounting_tools.views.expenseclaim_list') + return redirect('accounting_tools-views-expenseclaim_list') - writer.writerow([u'0', expenseclaim_count, u'Crédit', 300000 + expenseclaim.pk, expenseclaim.logs.first().when.strftime(u"%d.%m.%Y"), expenseclaim.user.username, u'CHF', 0, u'2000', u'NDF - {0}'.format(unicode(expenseclaim)), expenseclaim.logs.first().when.strftime(u"%d.%m.%Y"), '', '', '', '', '', '', '', '', u'NDF#{0}'.format(unicode(expenseclaim.pk))]) + writer.writerow([u'0', expenseclaim_count, u'Crédit', 300000 + expenseclaim.pk, expenseclaim.logs.first().when.strftime(u"%d.%m.%Y"), expenseclaim.user.username, u'CHF', 0, u'2000', u'NDF - {0}'.format(str(expenseclaim)), expenseclaim.logs.first().when.strftime(u"%d.%m.%Y"), '', '', '', '', '', '', '', '', u'NDF#{0}'.format(str(expenseclaim.pk))]) provider_to_export.append(expenseclaim.user) first = True line_count = 1 @@ -246,7 +246,7 @@ def expenseclaim_csv(request, pk): address_complete = u'' for adr in address_lines: - address_complete += unicode(adr) + address_complete += str(adr) writer.writerow([provider.first_name, provider.last_name, address_lines[0], city, zip, provider.username, provider.email, provider.nom_banque, provider.iban_ou_ccp, address_complete]) return response @@ -265,7 +265,7 @@ def expenseclaim_line_write(writer, expenseclaim, line, line_number, last_line, tva_string = u'Soumis' tva.code = 'TOSET' - row = [u'1', '', '', '', '', '', '', '', '', '', '', expenseclaim_number * 10000 + line_number, line_number, line.value, u'NDF - {0} - {1}'.format(unicode(expenseclaim), line.label), line.account.account_number, tva_string, tva.code, tva.value, u'OK', u'NDF#{0}'.format(unicode(expenseclaim.pk)), expenseclaim.costcenter.account_number] + row = [u'1', '', '', '', '', '', '', '', '', '', '', expenseclaim_number * 10000 + line_number, line_number, line.value, u'NDF - {0} - {1}'.format(str(expenseclaim), line.label), line.account.account_number, tva_string, tva.code, tva.value, u'OK', u'NDF#{0}'.format(str(expenseclaim.pk)), expenseclaim.costcenter.account_number] if last_line: # la dernière écriture doit être de type 2 row[0] = u'2' @@ -297,7 +297,7 @@ def cashbook_csv(request, pk): response = HttpResponse(content_type='text/csv; charset=cp1252') if len(cashbooks) == 1: - response['Content-Disposition'] = 'attachment; filename="JDC - {0}.csv"'.format(slugify(unicode(cashbooks[0]))) + response['Content-Disposition'] = 'attachment; filename="JDC - {0}.csv"'.format(slugify(str(cashbooks[0]))) else: response['Content-Disposition'] = 'attachment; filename="journaux_de_caisse_{0}.csv"'.format(datetime.date.today().strftime("%d-%m-%Y")) @@ -311,19 +311,19 @@ def cashbook_csv(request, pk): if not cashbook.rights_can('SHOW', request.user): raise Http404 if not cashbook.status[0] in ['4', '5', '6']: - messages.warning(request, _(u'JDC {0} pas à l\'état à comptabiliser/en comptabilisation').format(unicode(cashbook))) + messages.warning(request, _(u'JDC {0} pas à l\'état à comptabiliser/en comptabilisation').format(str(cashbook))) if len(cashbooks) == 1: - return redirect('accounting_tools.views.cashbook_show', cashbook.pk) + return redirect('accounting_tools-views-cashbook_show', cashbook.pk) else: - return redirect('accounting_tools.views.cashbook_list') + return redirect('accounting_tools-views-cashbook_list') if not cashbook.total_incomes() == cashbook.total_outcomes(): - messages.warning(request, _(u'JDC {0} pas a 0, merci de le mettre a 0').format(unicode(cashbook))) + messages.warning(request, _(u'JDC {0} pas a 0, merci de le mettre a 0').format(str(cashbook))) if len(cashbooks) == 1: - return redirect('accounting_tools.views.cashbook_show', cashbook.pk) + return redirect('accounting_tools-views-cashbook_show', cashbook.pk) else: - return redirect('accounting_tools.views.cashbook_list') + return redirect('accounting_tools-views-cashbook_list') - writer.writerow([u'0', cashbook_count, cashbook.get_lines()[0].date.strftime(u"%d.%m.%Y"), 200000 + cashbook.pk, cashbook.name, cashbook.total_incomes(), cashbook.total_incomes(), '', '', u'CHF', 0, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', u'CASHBOOK#{0}'.format(unicode(cashbook.pk))]) + writer.writerow([u'0', cashbook_count, cashbook.get_lines()[0].date.strftime(u"%d.%m.%Y"), 200000 + cashbook.pk, cashbook.name, cashbook.total_incomes(), cashbook.total_incomes(), '', '', u'CHF', 0, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', u'CASHBOOK#{0}'.format(str(cashbook.pk))]) first = True line_count = 1 firstline = CashBookLine() @@ -358,7 +358,7 @@ def cashbook_line_write(writer, cashbook, line, line_number, last_line, cashbook tva_string = u'Soumis' tva.code = 'TOSET' - row = [u'1', '', '', '', '', '', '', '', '', '', '', '', line_number, cashbook_number, line.account.account_number, u'CHF', u'{0} {1}'.format(cashbook.name, line.label), line.value_ttc, tva.code, tva.value, '', tva_string, type, '', line.date.strftime(u"%d.%m.%Y"), 0, line.value_ttc, line.value_ttc, 100, u'CASHBOOK#{0}'.format(unicode(cashbook.pk)), cashbook.costcenter.account_number] + row = [u'1', '', '', '', '', '', '', '', '', '', '', '', line_number, cashbook_number, line.account.account_number, u'CHF', u'{0} {1}'.format(cashbook.name, line.label), line.value_ttc, tva.code, tva.value, '', tva_string, type, '', line.date.strftime(u"%d.%m.%Y"), 0, line.value_ttc, line.value_ttc, 100, u'CASHBOOK#{0}'.format(str(cashbook.pk)), cashbook.costcenter.account_number] line_number = line_number + 1 @@ -400,7 +400,7 @@ def withdrawal_available_list(request): withdrawals = filter(lambda withdrawal: withdrawal.rights_can('SHOW', request.user), list(withdrawals)) - retour = {'data': [{'pk': withdrawal.pk, 'name': withdrawal.__unicode__(), 'used': withdrawal.status == '3_used'} for withdrawal in withdrawals]} + retour = {'data': [{'pk': withdrawal.pk, 'name': withdrawal.__str__(), 'used': withdrawal.status == '3_used'} for withdrawal in withdrawals]} return HttpResponse(json.dumps(retour), content_type='application/json') diff --git a/truffe2/app/ldaputils.py b/truffe2/app/ldaputils.py index 7b04c6a0..ed070f3d 100644 --- a/truffe2/app/ldaputils.py +++ b/truffe2/app/ldaputils.py @@ -19,7 +19,7 @@ def get_attrs_of_sciper(sciper): email = someone[1].get('mail', [''])[0] if not name: - print "No user in LDAP with sciper {}".format(sciper) + print("No user in LDAP with sciper {}".format(sciper)) return (name, firstname, email) diff --git a/truffe2/app/settings.py b/truffe2/app/settings.py index 52f28f06..20556bc9 100644 --- a/truffe2/app/settings.py +++ b/truffe2/app/settings.py @@ -2,20 +2,12 @@ # Django settings for truffe2 project. -from django.utils.translation import ugettext_lazy as _ - -from os.path import abspath, dirname, join, normpath -DJANGO_ROOT = dirname(abspath(__file__)) + '/../' +from django.utils.translation import gettext_lazy as _ +from os.path import abspath, dirname, join +DJANGO_ROOT = dirname(dirname(abspath(__file__))) DEBUG = True -TEMPLATE_DEBUG = DEBUG - -ADMINS = ( - # ('Your Name', 'your_email@example.com'), -) - -MANAGERS = ADMINS # Hosts/domain names that are valid for this site; required if DEBUG is False # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts @@ -28,7 +20,7 @@ TIME_ZONE = 'Europe/Zurich' # Language code for this installation. All choices can be found here: -# http://www.i18nguy.com/unicode/language-identifiers.html +# http://www.i18nguy.com/str/language-identifiers.html LANGUAGE_CODE = 'fr-ch' LANGUAGES = ( @@ -37,7 +29,7 @@ ) LOCALE_PATHS = ( - normpath(join(DJANGO_ROOT, 'locale')) + '/', + join(DJANGO_ROOT, 'locale'), ) SITE_ID = 1 @@ -55,7 +47,7 @@ # Absolute filesystem path to the directory that will hold user-uploaded files. # Example: "/var/www/example.com/media/" -MEDIA_ROOT = normpath(join(DJANGO_ROOT, 'media')) + '/' +MEDIA_ROOT = join(DJANGO_ROOT, 'media') # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash. @@ -66,7 +58,7 @@ # Don't put anything in this directory yourself; store your static files # in apps' "static/" subdirectories and in STATICFILES_DIRS. # Example: "/var/www/example.com/static/" -STATIC_ROOT = normpath(join(DJANGO_ROOT, 'static')) + '/' +STATIC_ROOT = join(DJANGO_ROOT, 'static') # URL prefix for static files. # Example: "http://example.com/static/", "http://static.example.com/" @@ -87,16 +79,38 @@ # 'django.contrib.staticfiles.finders.DefaultStorageFinder', ) -# List of callables that know how to import templates from various sources. -TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.Loader', - 'django.template.loaders.app_directories.Loader', -# 'django.template.loaders.eggs.Loader', -) +# TEMPLATE configuration +TEMPLATES = [{ + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. + 'DIRS' : (join(DJANGO_ROOT, 'templates'),), + 'OPTIONS' : { + 'debug' : DEBUG, + 'loaders' : ( + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', + # 'django.template.loaders.eggs.Loader', + ), + 'context_processors' : ("django.contrib.auth.context_processors.auth", + "django.template.context_processors.debug", + "django.template.context_processors.i18n", + "django.template.context_processors.media", + "django.template.context_processors.static", + "django.template.context_processors.request", + "django.template.context_processors.tz", + "django.contrib.messages.context_processors.messages", + "app.utils.add_current_unit", + "app.utils.add_current_year", + "notifications.views.notifications_count", + ), + } +}] -MIDDLEWARE_CLASSES = ( - 'django.middleware.common.CommonMiddleware', +MIDDLEWARE = ( 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', @@ -110,13 +124,6 @@ # Python dotted path to the WSGI application used by Django's runserver. WSGI_APPLICATION = 'app.wsgi.application' -TEMPLATE_DIRS = ( - # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". - # Always use forward slashes, even on Windows. - # Don't forget to use absolute paths, not relative paths. - normpath(join(DJANGO_ROOT, 'templates')) + '/' -) - INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', @@ -126,7 +133,6 @@ 'django.contrib.messages', 'django.contrib.staticfiles', - 'south', 'bootstrap3', 'impersonate', 'multiselectfield', @@ -136,7 +142,7 @@ 'celery_haystack', 'truffe', - + 'generic', 'main', 'users', 'units', @@ -147,11 +153,8 @@ 'accounting_core', 'accounting_main', 'accounting_tools', - 'members', 'vehicles', - - 'generic', ) SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer' @@ -191,6 +194,7 @@ TEQUILA_SERVICE = 'Truffe2 - L\'intranet de l\'AGEPoly' # Title used in tequila TEQUILA_AUTOCREATE = True # Auto create users ? TEQUILA_FAILURE = '/users/login' # Where to redirect user if there is a problem +TEQUILA_ALLOW_GUEST = False # allow EPFL guest (GXXXXX) to connect (used for test) LOGIN_REDIRECT_URL = '/' @@ -209,19 +213,6 @@ DATETIME_FORMAT = "d.m.Y H:i:s" USE_TZ = True -TEMPLATE_CONTEXT_PROCESSORS = ("django.contrib.auth.context_processors.auth", - "django.core.context_processors.debug", - "django.core.context_processors.i18n", - "django.core.context_processors.media", - "django.core.context_processors.static", - "django.core.context_processors.request", - "django.core.context_processors.tz", - "django.contrib.messages.context_processors.messages", - "app.utils.add_current_unit", - "app.utils.add_current_year", - "notifications.views.notifications_count", -) - LDAP = 'ldap://ldap.epfl.ch:389' ROOT_UNIT_PK = 1 @@ -229,20 +220,14 @@ PRESIDENT_ROLE_PK = 1 CS_ACCOUNT_NUMBER = "1020 -" # Label of account for Credit Suisse - AUTO_RLC_UNIT_PK = 7 # The EPFL "Acces RLC" unit truffe's pk AUTO_RLC_TAG = u"[Auto]" # The tag to identify our accreds AUTO_RLC_COMS_ROLES = [1, 3] # The roles used to give access for commissions AUTO_RLC_ROOT_ROLES = [1, ] # The roles used to give access for root unit AUTO_RLC_GIVEN_ROLE = 15 - -SOUTH_MIGRATION_MODULES = { - 'easy_thumbnails': 'easy_thumbnails.south_migrations', -} - -SENDFILE_BACKEND = 'sendfile.backends.simple' - +SENDFILE_BACKEND = 'django_sendfile.backends.simple' +SENDFILE_ROOT = '/' THUMBNAIL_PROCESSORS = ( 'easy_thumbnails.processors.colorspace', @@ -257,7 +242,6 @@ FORMAT_MODULE_PATH = 'app.formats' - HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine', @@ -274,7 +258,7 @@ EMAIL_FROM = 'truffe2@epfl.ch' try: - from settingsLocal import * + from app.settingsLocal import * except ImportError: raise diff --git a/truffe2/app/tequila.py b/truffe2/app/tequila.py index bd74f3ef..1f5d5650 100644 --- a/truffe2/app/tequila.py +++ b/truffe2/app/tequila.py @@ -4,14 +4,14 @@ # (C) Maximilien Cuony 2010 # BSD License -import urllib +import urllib.request import re from django.http import HttpResponseRedirect from django.contrib.auth import get_user_model from django.contrib.auth import login as auth_login, authenticate from django.conf import settings -from django.utils.http import is_safe_url - +from django.utils.http import url_has_allowed_host_and_scheme +from django.utils.timezone import now User = get_user_model() @@ -20,8 +20,10 @@ def get_request_key(request): """Ask tequla server for the key""" params = "urlaccess=" + request.build_absolute_uri() + "\nservice=" + settings.TEQUILA_SERVICE + "\nrequest=name,firstname,email,uniqueid" - f = urllib.urlopen(settings.TEQUILA_SERVER + '/cgi-bin/tequila/createrequest', params) - return re.search('key=(.*)', f.read()).group(1) + if settings.TEQUILA_ALLOW_GUEST: + params += '\nallows=categorie=epfl-guests' + f = urllib.request.urlopen(settings.TEQUILA_SERVER + '/cgi-bin/tequila/createrequest', params.encode()) + return re.search('key=(.*)', f.read().decode()).group(1) class Backend: @@ -37,8 +39,8 @@ def authenticate(self, token=None): # Check if token is valid params = 'key=' + token - f = urllib.urlopen(settings.TEQUILA_SERVER + '/cgi-bin/tequila/fetchattributes', params) - data = f.read() + f = urllib.request.urlopen(settings.TEQUILA_SERVER + '/cgi-bin/tequila/fetchattributes', params.encode()) + data = f.read().decode() if data.find('status=ok') == -1: return None @@ -61,6 +63,8 @@ def authenticate(self, token=None): user.first_name = firstName.split(',')[0] user.last_name = name.split(',')[0] user.email = email + user.last_login = now() + user.password = "" user.save() else: user = None @@ -91,7 +95,7 @@ def login(request): else: goTo = settings.LOGIN_REDIRECT_URL - if not is_safe_url(goTo): + if not url_has_allowed_host_and_scheme(goTo): goTo = settings.LOGIN_REDIRECT_URL return HttpResponseRedirect(goTo) @@ -103,8 +107,8 @@ def login(request): r = HttpResponseRedirect(settings.TEQUILA_SERVER + '/cgi-bin/tequila/requestauth?requestkey=' + get_request_key(request)) # Set the cookie to be redirected when auth is done - next = request.GET.get('next', settings.LOGIN_REDIRECT_URL) - r.set_cookie('login_redirect', next) + next_url = request.GET.get('next', settings.LOGIN_REDIRECT_URL) + r.set_cookie('login_redirect', next_url) return r diff --git a/truffe2/app/urls.py b/truffe2/app/urls.py index 0a9a72e1..ab60620a 100644 --- a/truffe2/app/urls.py +++ b/truffe2/app/urls.py @@ -1,22 +1,24 @@ -from django.conf.urls import patterns, include, url + +import django.views.static +from django.urls import include, re_path from django.conf import settings -urlpatterns = patterns('', - url(r'', include('main.urls')), - url(r'^accounting/core/', include('accounting_core.urls')), - url(r'^accounting/tools/', include('accounting_tools.urls')), - url(r'^accounting/main/', include('accounting_main.urls')), - url(r'^users/', include('users.urls')), - url(r'^members/', include('members.urls')), - url(r'^units/', include('units.urls')), - url(r'^communication/', include('communication.urls')), - url(r'^notifications/', include('notifications.urls')), - url(r'^logistics/', include('logistics.urls')), - url(r'^vehicles/', include('vehicles.urls')), - url(r'^generic/', include('generic.urls')), +urlpatterns = [ + re_path(r'', include('main.urls')), + re_path(r'^accounting/core/', include('accounting_core.urls')), + re_path(r'^accounting/tools/', include('accounting_tools.urls')), + re_path(r'^accounting/main/', include('accounting_main.urls')), + re_path(r'^users/', include('users.urls')), + re_path(r'^members/', include('members.urls')), + re_path(r'^units/', include('units.urls')), + re_path(r'^communication/', include('communication.urls')), + re_path(r'^notifications/', include('notifications.urls')), + re_path(r'^logistics/', include('logistics.urls')), + re_path(r'^vehicles/', include('vehicles.urls')), + re_path(r'^generic/', include('generic.urls')), - url(r'^impersonate/', include('impersonate.urls')), + re_path(r'^impersonate/', include('impersonate.urls')), - (r'^' + settings.MEDIA_URL[1:] + '(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), # In prod, use apache ! - (r'^' + settings.STATIC_URL[1:] + '(?P.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}), # In prod, use apache ! -) + re_path(r'^' + settings.MEDIA_URL[1:] + '(?P.*)$', django.views.static.serve, {'document_root': settings.MEDIA_ROOT}), # In prod, use apache ! + re_path(r'^' + settings.STATIC_URL[1:] + '(?P.*)$', django.views.static.serve, {'document_root': settings.STATIC_ROOT}), # In prod, use apache ! +] diff --git a/truffe2/app/utils.py b/truffe2/app/utils.py index 1a16c095..b8b10c9a 100644 --- a/truffe2/app/utils.py +++ b/truffe2/app/utils.py @@ -1,21 +1,19 @@ # -*- coding: utf-8 -*- from django.conf import settings -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.template.loader import get_template -from django.template import Context from django import http from django.core.mail import EmailMultiAlternatives from django.utils.timezone import now -from django.contrib.sites.models import get_current_site +from django.contrib.sites.shortcuts import get_current_site from django.shortcuts import render - import logging import cgi -import ho.pisa as pisa -import cStringIO as StringIO -from pyPdf import PdfFileWriter, PdfFileReader +from xhtml2pdf import pisa +from io import BytesIO +from PIL import Image import traceback @@ -73,7 +71,7 @@ def add_current_year(request): current_year = get_current_year(request) - current_year_pk = current_year.pk if current_year else -1 + current_year_pk = current_year.pk if current_year else 0 current_year_name = current_year.name if current_year else _(u'?') return {'CURRENT_YEAR': current_year, 'CURRENT_YEAR_NAME': current_year_name, 'CURRENT_YEAR_PK': current_year_pk} @@ -109,14 +107,13 @@ def update_current_year(request, year_pk): def send_templated_mail(request, subject, email_from, emails_to, template, context): """Send a email using an template (both in text and html format)""" - plaintext = get_template('%s_plain.txt' % (template, )) - htmly = get_template('%s_html.html' % (template, )) + plaintext = get_template('%s_plain.txt' % (template,)) + htmly = get_template('%s_html.html' % (template,)) context.update({'site': get_current_site(request), 'subject': subject}) - d = Context(context) - text_content = plaintext.render(d) - html_content = htmly.render(d) + text_content = plaintext.render(context) + html_content = htmly.render(context) msg = EmailMultiAlternatives(subject, text_content, settings.EMAIL_FROM, emails_to) msg.attach_alternative(html_content, "text/html") @@ -158,38 +155,34 @@ def set_property(obj, prop, val): setattr(obj, prop.split('.')[-1], val) -def append_pdf(input, output): - [output.addPage(input.getPage(page_num)) for page_num in range(input.numPages)] +def append_pdf(input_pdf, output_pdf): + [output_pdf.addPage(input_pdf.getPage(page_num)) for page_num in range(input_pdf.numPages)] -def generate_pdf(template, request, contexte, extra_pdf_files=None): - template = get_template(template) +def generate_pdf(template_name, request, contexte, extra_pdf_files=None): + template = get_template(template_name) contexte.update({'MEDIA_ROOT': settings.MEDIA_ROOT, 'cdate': now(), 'user': request.user}) - context = Context(contexte) - - html = template.render(context) - - result = StringIO.StringIO() - pdf = pisa.pisaDocument(StringIO.StringIO(html.encode("UTF-8")), result) - - if extra_pdf_files: - - output = PdfFileWriter() - append_pdf(PdfFileReader(result), output) - - result = StringIO.StringIO() - - for pdf_file in extra_pdf_files: - try: - append_pdf(PdfFileReader(pdf_file), output) - except Exception as e: - return render(request, "pdf_error.html", {'pdf': pdf_file, 'error': traceback.format_exc()}) - - output.write(result) - - if not pdf.err: - return http.HttpResponse(result.getvalue(), mimetype='application/pdf') + html = template.render(contexte) + try: + result = BytesIO() + pisa_status = pisa.CreatePDF(html, result) + if not pisa_status.err: + if extra_pdf_files: + from PyPDF4 import PdfFileWriter, PdfFileReader + output = PdfFileWriter() + append_pdf(PdfFileReader(result), output) + result = BytesIO() + for pdf_file in extra_pdf_files: + try: + append_pdf(PdfFileReader(pdf_file), output) + except Exception: + return render(request, "pdf_error.html", {'pdf': pdf_file, 'error': traceback.format_exc()}) + output.write(result) + return http.HttpResponse(result.getvalue(), content_type='application/pdf') + except Exception as e: + logger = logging.getLogger(__name__) + logger.exception(e) return http.HttpResponse('Gremlins ate your pdf! %s' % cgi.escape(html)) @@ -202,22 +195,19 @@ def pad_image(image, **kwargs): fit = [float(img_size[i]) / des_size[i] for i in range(0, 2)] if fit[0] > fit[1]: - new_image = image.resize((image.size[0], int(round(des_size[1] * fit[0])))) + new_image = Image.new('RGB', (image.size[0], int(round(des_size[1] * fit[0]))), (255, 255, 255)) top = int((new_image.size[1] - image.size[1]) / 2) left = 0 elif fit[0] < fit[1]: - new_image = image.resize((int(round(des_size[0] * fit[1])), image.size[1])) + new_image = Image.new('RGB', (int(round(des_size[0] * fit[1])), image.size[1]), (255, 255, 255)) top = 0 left = int((new_image.size[0] - image.size[0]) / 2) else: return image - - # For white - new_image.paste((255, 255, 255, 255)) - new_image.paste(image, (left, top)) return new_image + class UnicodeCSVWriter: """ A CSV writer which will write rows to CSV stream "f", (formatted for sage import) @@ -228,8 +218,8 @@ def __init__(self, f): def writerow(self, row): for s in row: - if not isinstance(s, unicode): - s = unicode(s) + if not isinstance(s, str): + s = str(s) s = s.encode("cp1252") self.stream.write(s) self.stream.write(u';') @@ -237,4 +227,4 @@ def writerow(self, row): def writerows(self, rows): for row in rows: - self.writerow(row) \ No newline at end of file + self.writerow(row) diff --git a/truffe2/app/wsgi.py b/truffe2/app/wsgi.py index fc7ffca4..c0ad0509 100644 --- a/truffe2/app/wsgi.py +++ b/truffe2/app/wsgi.py @@ -21,9 +21,6 @@ # os.environ["DJANGO_SETTINGS_MODULE"] = "app.settings" os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.settings") -from generic.startup import startup -startup() - # This application object is used by any WSGI server configured to use this # file. This includes Django's development server, if the WSGI_APPLICATION # setting points here. diff --git a/truffe2/communication/migrations/0001_initial.py b/truffe2/communication/migrations/0001_initial.py index cc37afdf..dd4b7742 100644 --- a/truffe2/communication/migrations/0001_initial.py +++ b/truffe2/communication/migrations/0001_initial.py @@ -1,20 +1,271 @@ # -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals +from django.db import models, migrations +from django.conf import settings +import generic.models +import generic.search +import rights.utils -class Migration(SchemaMigration): - def forwards(self, orm): - pass +class Migration(migrations.Migration): - def backwards(self, orm): - pass + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('units', '__first__'), + ] - models = { - - } - - complete_apps = ['communication'] \ No newline at end of file + operations = [ + migrations.CreateModel( + name='AgepSlide', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('deleted', models.BooleanField(default=False)), + ('title', models.CharField(max_length=255, verbose_name='Titre')), + ('picture', models.ImageField(help_text="Pour des raisons de qualit\xe9, il est fortement recommand\xe9 d'envoyer une image en HD (1920x1080)", upload_to=b'uploads/slides/', verbose_name='Image')), + ('start_date', models.DateTimeField(null=True, verbose_name='Date de d\xe9but', blank=True)), + ('end_date', models.DateTimeField(null=True, verbose_name='Date de fin', blank=True)), + ('status', models.CharField(default=b'0_draft', max_length=255, choices=[(b'4_deny', 'Refus\xe9'), (b'4_canceled', 'Annul\xe9'), (b'0_draft', 'Brouillon'), (b'3_archive', 'Archiv\xe9'), (b'1_asking', 'Mod\xe9ration en cours'), (b'2_online', 'En ligne')])), + ('unit', models.ForeignKey(to='units.Unit', on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model, generic.models.GenericGroupsModerableModel, generic.models.GenericGroupsModel, generic.models.GenericContactableModel, generic.models.GenericStateRootModerable, generic.models.GenericStateModel, rights.utils.UnitEditableModel, generic.search.SearchableModel), + ), + migrations.CreateModel( + name='AgepSlideLogging', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('extra_data', models.TextField(blank=True)), + ('what', models.CharField(max_length=64, choices=[(b'imported', 'Import\xe9 depuis Truffe 1'), (b'created', 'Creation'), (b'edited', 'Edit\xe9'), (b'deleted', 'Supprim\xe9'), (b'restored', 'Restaur\xe9'), (b'state_changed', 'Statut chang\xe9'), (b'file_added', 'Fichier ajout\xe9'), (b'file_removed', 'Fichier supprim\xe9')])), + ('object', models.ForeignKey(related_name='logs', to='communication.AgepSlide', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='AgepSlideViews', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('object', models.ForeignKey(related_name='views', to='communication.AgepSlide', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='Display', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('deleted', models.BooleanField(default=False)), + ('title', models.CharField(max_length=255, verbose_name='Titre')), + ('description', models.TextField()), + ('active', models.BooleanField(default=True, help_text='Pour d\xe9sactiver temporairement la posibilit\xe9 de r\xe9server.', verbose_name='Actif')), + ('conditions', models.TextField(help_text="Si tu veux pr\xe9ciser les conditions de r\xe9servations pour l'affichage. Tu peux par exemple mettre un lien vers un contrat.", verbose_name='Conditions de r\xe9servation', blank=True)), + ('allow_externals', models.BooleanField(default=False, help_text="Permet aux externes (pas dans l'AGEPoly) de r\xe9server l'affichage.", verbose_name='Autoriser les externes')), + ('conditions_externals', models.TextField(help_text="Si tu veux pr\xe9ciser des informations sur la r\xe9servation de l'affichage pour les externes. Remplace le champ 'Conditions' pour les externe si rempli.", verbose_name='Conditions de r\xe9servation pour les externes', blank=True)), + ('allow_calendar', models.BooleanField(default=True, help_text="Permet \xe0 tout le monde d'afficher le calendrier des r\xe9servations de l'affichage", verbose_name='Autoriser tout le monde \xe0 voir le calendrier')), + ('allow_external_calendar', models.BooleanField(default=True, help_text="Permet aux externes d'afficher le calendrier des r\xe9servations de l'affichage. Le calendrier doit \xeatre visible.", verbose_name='Autoriser les externes \xe0 voir le calendrier')), + ('max_days', models.PositiveIntegerField(default=0, help_text='Si sup\xe9rieur \xe0 z\xe9ro, emp\xeache de demander une r\xe9servation si la longeur de la r\xe9servation dure plus longtemps que le nombre de jours d\xe9fini.', verbose_name='Nombre maximum de jours de r\xe9servation')), + ('max_days_externals', models.PositiveIntegerField(default=0, help_text='Si sup\xe9rieur \xe0 z\xe9ro, emp\xeache de demander une r\xe9servation si la longeur de la r\xe9servation dure plus longtemps que le nombre de jours d\xe9fini, pour les unit\xe9s externes.', verbose_name='Nombre maximum de jours de r\xe9servation (externes)')), + ('minimum_days_before', models.PositiveIntegerField(default=0, help_text="Si sup\xe9rieur \xe0 z\xe9ro, emp\xeache de demander une r\xe9servation si la r\xe9servation n'est pas au moins dans X jours.", verbose_name='Nombre de jours minimum avant r\xe9servation')), + ('minimum_days_before_externals', models.PositiveIntegerField(default=0, help_text="Si sup\xe9rieur \xe0 z\xe9ro, emp\xeache de demander une r\xe9servation si la r\xe9servation n'est pas au plus dans X jours, pour les externes.", verbose_name='Nombre de jours minimum avant r\xe9servation (externes)')), + ('maximum_days_before', models.PositiveIntegerField(default=0, help_text='Si sup\xe9rieur \xe0 z\xe9ro, emp\xeache de demander une r\xe9servation si la r\xe9servation est dans plus de X jours.', verbose_name='Nombre de jours maximum avant r\xe9servation')), + ('maximum_days_before_externals', models.PositiveIntegerField(default=0, help_text='Si sup\xe9rieur \xe0 z\xe9ro, emp\xeache de demander une r\xe9servation si la r\xe9servation est dans plus de X jours, pour les externes.', verbose_name='Nombre de jours maximum avant r\xe9servation (externes)')), + ('unit', models.ForeignKey(to='units.Unit', on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model, generic.models.GenericGroupsModel, rights.utils.UnitEditableModel, generic.models.GenericDelayValidableInfo, generic.search.SearchableModel), + ), + migrations.CreateModel( + name='DisplayLogging', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('extra_data', models.TextField(blank=True)), + ('what', models.CharField(max_length=64, choices=[(b'imported', 'Import\xe9 depuis Truffe 1'), (b'created', 'Creation'), (b'edited', 'Edit\xe9'), (b'deleted', 'Supprim\xe9'), (b'restored', 'Restaur\xe9'), (b'state_changed', 'Statut chang\xe9'), (b'file_added', 'Fichier ajout\xe9'), (b'file_removed', 'Fichier supprim\xe9')])), + ('object', models.ForeignKey(related_name='logs', to='communication.Display', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='DisplayReservation', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('deleted', models.BooleanField(default=False)), + ('title', models.CharField(max_length=255, verbose_name='Titre')), + ('start_date', models.DateTimeField(verbose_name='Date de d\xe9but')), + ('end_date', models.DateTimeField(verbose_name='Date de fin')), + ('reason', models.TextField(help_text='Explique pourquoi tu as besoin (manifestation par ex.)', verbose_name='Raison')), + ('remarks', models.TextField(null=True, verbose_name='Remarques', blank=True)), + ('status', models.CharField(default=b'0_draft', max_length=255, choices=[(b'4_deny', 'Refus\xe9'), (b'4_canceled', 'Annul\xe9'), (b'0_draft', 'Brouillon'), (b'3_archive', 'Archiv\xe9'), (b'1_asking', 'Validation en cours'), (b'2_online', 'Valid\xe9')])), + ('unit_blank_name', models.CharField(max_length=255, null=True, verbose_name="Nom de l'entit\xe9 externe", blank=True)), + ('display', models.ForeignKey(verbose_name='Affichage', to='communication.Display', on_delete=models.deletion.PROTECT)), + ('unit', models.ForeignKey(blank=True, to='units.Unit', null=True, on_delete=models.deletion.SET_NULL)), + ('unit_blank_user', models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, null=True, on_delete=models.deletion.SET_NULL)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model, generic.models.GenericDelayValidable, generic.models.GenericGroupsValidableModel, generic.models.GenericGroupsModel, generic.models.GenericContactableModel, generic.models.GenericStateUnitValidable, generic.models.GenericStateModel, generic.models.GenericExternalUnitAllowed, rights.utils.UnitExternalEditableModel, generic.search.SearchableModel), + ), + migrations.CreateModel( + name='DisplayReservationLogging', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('extra_data', models.TextField(blank=True)), + ('what', models.CharField(max_length=64, choices=[(b'imported', 'Import\xe9 depuis Truffe 1'), (b'created', 'Creation'), (b'edited', 'Edit\xe9'), (b'deleted', 'Supprim\xe9'), (b'restored', 'Restaur\xe9'), (b'state_changed', 'Statut chang\xe9'), (b'file_added', 'Fichier ajout\xe9'), (b'file_removed', 'Fichier supprim\xe9')])), + ('object', models.ForeignKey(related_name='logs', to='communication.DisplayReservation', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='DisplayReservationViews', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('object', models.ForeignKey(related_name='views', to='communication.DisplayReservation', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='DisplayViews', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('object', models.ForeignKey(related_name='views', to='communication.Display', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='Logo', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('deleted', models.BooleanField(default=False)), + ('name', models.CharField(max_length=255)), + ('visibility_level', models.CharField(default=b'default', help_text="Permet de rendre l'objet plus visible que les droits de base", max_length=32, verbose_name='Visibilit\xe9', choices=[(b'default', "De base (En fonction de l'objet et des droits)"), (b'unit', 'Unit\xe9 li\xe9e'), (b'unit_agep', "Unit\xe9 li\xe9e et Comit\xe9 de l'AGEPoly"), (b'all_agep', 'Toutes les personnes accr\xe9dit\xe9s dans une unit\xe9'), (b'all', 'Tout le monde')])), + ('unit', models.ForeignKey(to='units.Unit', on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model, generic.models.GenericModelWithFiles, rights.utils.AutoVisibilityLevel, rights.utils.UnitEditableModel, generic.search.SearchableModel), + ), + migrations.CreateModel( + name='LogoFile', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('upload_date', models.DateTimeField(auto_now_add=True)), + ('file', models.FileField(upload_to=b'uploads/_generic/Logo/')), + ('object', models.ForeignKey(related_name='files', blank=True, to='communication.Logo', null=True, on_delete=models.deletion.SET_NULL)), + ('uploader', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='LogoLogging', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('extra_data', models.TextField(blank=True)), + ('what', models.CharField(max_length=64, choices=[(b'imported', 'Import\xe9 depuis Truffe 1'), (b'created', 'Creation'), (b'edited', 'Edit\xe9'), (b'deleted', 'Supprim\xe9'), (b'restored', 'Restaur\xe9'), (b'state_changed', 'Statut chang\xe9'), (b'file_added', 'Fichier ajout\xe9'), (b'file_removed', 'Fichier supprim\xe9')])), + ('object', models.ForeignKey(related_name='logs', to='communication.Logo', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='LogoViews', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('object', models.ForeignKey(related_name='views', to='communication.Logo', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='WebsiteNews', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('deleted', models.BooleanField(default=False)), + ('title', models.CharField(max_length=255, verbose_name='Titre')), + ('title_en', models.CharField(max_length=255, null=True, verbose_name='Titre anglais', blank=True)), + ('content', models.TextField(verbose_name='Contenu')), + ('content_en', models.TextField(null=True, verbose_name='Contenu anglais', blank=True)), + ('url', models.URLField(max_length=255)), + ('start_date', models.DateTimeField(null=True, verbose_name='Date d\xe9but', blank=True)), + ('end_date', models.DateTimeField(null=True, verbose_name='Date fin', blank=True)), + ('status', models.CharField(default=b'0_draft', max_length=255, choices=[(b'4_deny', 'Refus\xe9'), (b'4_canceled', 'Annul\xe9'), (b'0_draft', 'Brouillon'), (b'3_archive', 'Archiv\xe9'), (b'1_asking', 'Mod\xe9ration en cours'), (b'2_online', 'En ligne')])), + ('unit', models.ForeignKey(to='units.Unit', on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model, generic.models.GenericGroupsModerableModel, generic.models.GenericGroupsModel, generic.models.GenericContactableModel, generic.models.GenericStateRootModerable, generic.models.GenericStateModel, rights.utils.UnitEditableModel, generic.search.SearchableModel), + ), + migrations.CreateModel( + name='WebsiteNewsLogging', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('extra_data', models.TextField(blank=True)), + ('what', models.CharField(max_length=64, choices=[(b'imported', 'Import\xe9 depuis Truffe 1'), (b'created', 'Creation'), (b'edited', 'Edit\xe9'), (b'deleted', 'Supprim\xe9'), (b'restored', 'Restaur\xe9'), (b'state_changed', 'Statut chang\xe9'), (b'file_added', 'Fichier ajout\xe9'), (b'file_removed', 'Fichier supprim\xe9')])), + ('object', models.ForeignKey(related_name='logs', to='communication.WebsiteNews', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='WebsiteNewsViews', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('when', models.DateTimeField(auto_now_add=True)), + ('object', models.ForeignKey(related_name='views', to='communication.WebsiteNews', on_delete=models.deletion.PROTECT)), + ('who', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.deletion.PROTECT)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + ] diff --git a/truffe2/communication/migrations/0002_auto_20201104_1648.py b/truffe2/communication/migrations/0002_auto_20201104_1648.py new file mode 100644 index 00000000..39fd1603 --- /dev/null +++ b/truffe2/communication/migrations/0002_auto_20201104_1648.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2020-11-04 15:48 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('communication', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='logo', + name='name', + field=models.CharField(default=b'---', max_length=255), + ), + ] diff --git a/truffe2/communication/migrations/0002_auto__add_websitenews__add_websitenewslogging.py b/truffe2/communication/migrations/0002_auto__add_websitenews__add_websitenewslogging.py deleted file mode 100644 index aeace111..00000000 --- a/truffe2/communication/migrations/0002_auto__add_websitenews__add_websitenewslogging.py +++ /dev/null @@ -1,121 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'WebsiteNews' - db.create_table(u'communication_websitenews', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('deleted', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('title', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('content', self.gf('django.db.models.fields.TextField')()), - ('url', self.gf('django.db.models.fields.URLField')(max_length=255)), - ('start_date', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)), - ('end_date', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)), - ('status', self.gf('django.db.models.fields.CharField')(default='0_draft', max_length=255)), - ('unit', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['units.Unit'])), - )) - db.send_create_signal(u'communication', ['WebsiteNews']) - - # Adding model 'WebsiteNewsLogging' - db.create_table(u'communication_websitenewslogging', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('extra_data', self.gf('django.db.models.fields.TextField')(blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('what', self.gf('django.db.models.fields.CharField')(max_length=64)), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='logs', to=orm['communication.WebsiteNews'])), - )) - db.send_create_signal(u'communication', ['WebsiteNewsLogging']) - - - def backwards(self, orm): - # Deleting model 'WebsiteNews' - db.delete_table(u'communication_websitenews') - - # Deleting model 'WebsiteNewsLogging' - db.delete_table(u'communication_websitenewslogging') - - - models = { - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'communication.websitenews': { - 'Meta': {'object_name': 'WebsiteNews'}, - 'content': ('django.db.models.fields.TextField', [], {}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_draft'", 'max_length': '255'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '255'}) - }, - u'communication.websitenewslogging': { - 'Meta': {'object_name': 'WebsiteNewsLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.WebsiteNews']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_herachique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['communication'] \ No newline at end of file diff --git a/truffe2/communication/migrations/0003_auto_20210210_1832.py b/truffe2/communication/migrations/0003_auto_20210210_1832.py new file mode 100644 index 00000000..8080228b --- /dev/null +++ b/truffe2/communication/migrations/0003_auto_20210210_1832.py @@ -0,0 +1,130 @@ +# Generated by Django 2.2.18 on 2021-02-10 17:32 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('communication', '0002_auto_20201104_1648'), + ] + + operations = [ + migrations.AlterField( + model_name='agepslide', + name='picture', + field=models.ImageField(help_text="Pour des raisons de qualité, il est fortement recommandé d'envoyer une image en HD (1920x1080)", upload_to='uploads/slides/', verbose_name='Image'), + ), + migrations.AlterField( + model_name='agepslide', + name='status', + field=models.CharField(choices=[('0_draft', 'Brouillon'), ('1_asking', 'Modération en cours'), ('2_online', 'En ligne'), ('3_archive', 'Archivé'), ('4_deny', 'Refusé'), ('4_canceled', 'Annulé')], default='0_draft', max_length=255), + ), + migrations.AlterField( + model_name='agepslidelogging', + name='what', + field=models.CharField(choices=[('imported', 'Importé depuis Truffe 1'), ('created', 'Creation'), ('edited', 'Edité'), ('deleted', 'Supprimé'), ('restored', 'Restauré'), ('state_changed', 'Statut changé'), ('file_added', 'Fichier ajouté'), ('file_removed', 'Fichier supprimé')], max_length=64), + ), + migrations.AlterField( + model_name='agepslidelogging', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='agepslideviews', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='displaylogging', + name='what', + field=models.CharField(choices=[('imported', 'Importé depuis Truffe 1'), ('created', 'Creation'), ('edited', 'Edité'), ('deleted', 'Supprimé'), ('restored', 'Restauré'), ('state_changed', 'Statut changé'), ('file_added', 'Fichier ajouté'), ('file_removed', 'Fichier supprimé')], max_length=64), + ), + migrations.AlterField( + model_name='displaylogging', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='displayreservation', + name='status', + field=models.CharField(choices=[('0_draft', 'Brouillon'), ('1_asking', 'Validation en cours'), ('2_online', 'Validé'), ('3_archive', 'Archivé'), ('4_deny', 'Refusé'), ('4_canceled', 'Annulé')], default='0_draft', max_length=255), + ), + migrations.AlterField( + model_name='displayreservationlogging', + name='what', + field=models.CharField(choices=[('imported', 'Importé depuis Truffe 1'), ('created', 'Creation'), ('edited', 'Edité'), ('deleted', 'Supprimé'), ('restored', 'Restauré'), ('state_changed', 'Statut changé'), ('file_added', 'Fichier ajouté'), ('file_removed', 'Fichier supprimé')], max_length=64), + ), + migrations.AlterField( + model_name='displayreservationlogging', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='displayreservationviews', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='displayviews', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='logo', + name='name', + field=models.CharField(default='---', max_length=255), + ), + migrations.AlterField( + model_name='logo', + name='visibility_level', + field=models.CharField(choices=[('default', "De base (En fonction de l'objet et des droits)"), ('unit', 'Unité liée'), ('unit_agep', "Unité liée et Comité de l'AGEPoly"), ('all_agep', 'Toutes les personnes accrédités dans une unité'), ('all', 'Tout le monde')], default='default', help_text="Permet de rendre l'objet plus visible que les droits de base", max_length=32, verbose_name='Visibilité'), + ), + migrations.AlterField( + model_name='logofile', + name='file', + field=models.FileField(upload_to='uploads/_generic/Logo/'), + ), + migrations.AlterField( + model_name='logofile', + name='uploader', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='logologging', + name='what', + field=models.CharField(choices=[('imported', 'Importé depuis Truffe 1'), ('created', 'Creation'), ('edited', 'Edité'), ('deleted', 'Supprimé'), ('restored', 'Restauré'), ('state_changed', 'Statut changé'), ('file_added', 'Fichier ajouté'), ('file_removed', 'Fichier supprimé')], max_length=64), + ), + migrations.AlterField( + model_name='logologging', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='logoviews', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='websitenews', + name='status', + field=models.CharField(choices=[('0_draft', 'Brouillon'), ('1_asking', 'Modération en cours'), ('2_online', 'En ligne'), ('3_archive', 'Archivé'), ('4_deny', 'Refusé'), ('4_canceled', 'Annulé')], default='0_draft', max_length=255), + ), + migrations.AlterField( + model_name='websitenewslogging', + name='what', + field=models.CharField(choices=[('imported', 'Importé depuis Truffe 1'), ('created', 'Creation'), ('edited', 'Edité'), ('deleted', 'Supprimé'), ('restored', 'Restauré'), ('state_changed', 'Statut changé'), ('file_added', 'Fichier ajouté'), ('file_removed', 'Fichier supprimé')], max_length=64), + ), + migrations.AlterField( + model_name='websitenewslogging', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='websitenewsviews', + name='who', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/truffe2/communication/migrations/0003_auto__add_agepslide__add_agepslidelogging.py b/truffe2/communication/migrations/0003_auto__add_agepslide__add_agepslidelogging.py deleted file mode 100644 index 1f2ddb3a..00000000 --- a/truffe2/communication/migrations/0003_auto__add_agepslide__add_agepslidelogging.py +++ /dev/null @@ -1,140 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'AgepSlide' - db.create_table(u'communication_agepslide', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('deleted', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('title', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('picture', self.gf('django.db.models.fields.files.ImageField')(max_length=100)), - ('start_date', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)), - ('end_date', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)), - ('status', self.gf('django.db.models.fields.CharField')(default='0_draft', max_length=255)), - ('unit', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['units.Unit'])), - )) - db.send_create_signal(u'communication', ['AgepSlide']) - - # Adding model 'AgepSlideLogging' - db.create_table(u'communication_agepslidelogging', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('extra_data', self.gf('django.db.models.fields.TextField')(blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('what', self.gf('django.db.models.fields.CharField')(max_length=64)), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='logs', to=orm['communication.AgepSlide'])), - )) - db.send_create_signal(u'communication', ['AgepSlideLogging']) - - - def backwards(self, orm): - # Deleting model 'AgepSlide' - db.delete_table(u'communication_agepslide') - - # Deleting model 'AgepSlideLogging' - db.delete_table(u'communication_agepslidelogging') - - - models = { - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'communication.agepslide': { - 'Meta': {'object_name': 'AgepSlide'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'picture': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_draft'", 'max_length': '255'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'communication.agepslidelogging': { - 'Meta': {'object_name': 'AgepSlideLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.AgepSlide']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.websitenews': { - 'Meta': {'object_name': 'WebsiteNews'}, - 'content': ('django.db.models.fields.TextField', [], {}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_draft'", 'max_length': '255'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '255'}) - }, - u'communication.websitenewslogging': { - 'Meta': {'object_name': 'WebsiteNewsLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.WebsiteNews']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_herachique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['communication'] \ No newline at end of file diff --git a/truffe2/communication/migrations/0004_auto__add_logo__add_logologging.py b/truffe2/communication/migrations/0004_auto__add_logo__add_logologging.py deleted file mode 100644 index 62012d32..00000000 --- a/truffe2/communication/migrations/0004_auto__add_logo__add_logologging.py +++ /dev/null @@ -1,154 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'Logo' - db.create_table(u'communication_logo', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('deleted', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('name', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('unit', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['units.Unit'])), - )) - db.send_create_signal(u'communication', ['Logo']) - - # Adding model 'LogoLogging' - db.create_table(u'communication_logologging', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('extra_data', self.gf('django.db.models.fields.TextField')(blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('what', self.gf('django.db.models.fields.CharField')(max_length=64)), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='logs', to=orm['communication.Logo'])), - )) - db.send_create_signal(u'communication', ['LogoLogging']) - - - def backwards(self, orm): - # Deleting model 'Logo' - db.delete_table(u'communication_logo') - - # Deleting model 'LogoLogging' - db.delete_table(u'communication_logologging') - - - models = { - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'communication.agepslide': { - 'Meta': {'object_name': 'AgepSlide'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'picture': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_draft'", 'max_length': '255'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'communication.agepslidelogging': { - 'Meta': {'object_name': 'AgepSlideLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.AgepSlide']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.logo': { - 'Meta': {'object_name': 'Logo'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'communication.logologging': { - 'Meta': {'object_name': 'LogoLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.Logo']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.websitenews': { - 'Meta': {'object_name': 'WebsiteNews'}, - 'content': ('django.db.models.fields.TextField', [], {}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_draft'", 'max_length': '255'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '255'}) - }, - u'communication.websitenewslogging': { - 'Meta': {'object_name': 'WebsiteNewsLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.WebsiteNews']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['communication'] \ No newline at end of file diff --git a/truffe2/communication/migrations/0005_auto__add_field_logo_visibility_level.py b/truffe2/communication/migrations/0005_auto__add_field_logo_visibility_level.py deleted file mode 100644 index a0d59a05..00000000 --- a/truffe2/communication/migrations/0005_auto__add_field_logo_visibility_level.py +++ /dev/null @@ -1,137 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'Logo.visibility_level' - db.add_column(u'communication_logo', 'visibility_level', - self.gf('django.db.models.fields.CharField')(default='default', max_length=32), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'Logo.visibility_level' - db.delete_column(u'communication_logo', 'visibility_level') - - - models = { - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'communication.agepslide': { - 'Meta': {'object_name': 'AgepSlide'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'picture': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_draft'", 'max_length': '255'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'communication.agepslidelogging': { - 'Meta': {'object_name': 'AgepSlideLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.AgepSlide']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.logo': { - 'Meta': {'object_name': 'Logo'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}), - 'visibility_level': ('django.db.models.fields.CharField', [], {'default': "'default'", 'max_length': '32'}) - }, - u'communication.logologging': { - 'Meta': {'object_name': 'LogoLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.Logo']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.websitenews': { - 'Meta': {'object_name': 'WebsiteNews'}, - 'content': ('django.db.models.fields.TextField', [], {}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_draft'", 'max_length': '255'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '255'}) - }, - u'communication.websitenewslogging': { - 'Meta': {'object_name': 'WebsiteNewsLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.WebsiteNews']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['communication'] \ No newline at end of file diff --git a/truffe2/communication/migrations/0006_auto__add_logofile.py b/truffe2/communication/migrations/0006_auto__add_logofile.py deleted file mode 100644 index 7002de68..00000000 --- a/truffe2/communication/migrations/0006_auto__add_logofile.py +++ /dev/null @@ -1,148 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'LogoFile' - db.create_table(u'communication_logofile', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('creation_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='files', to=orm['communication.Logo'])), - ('file', self.gf('django.db.models.fields.files.FileField')(max_length=100)), - )) - db.send_create_signal(u'communication', ['LogoFile']) - - - def backwards(self, orm): - # Deleting model 'LogoFile' - db.delete_table(u'communication_logofile') - - - models = { - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'communication.agepslide': { - 'Meta': {'object_name': 'AgepSlide'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'picture': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_draft'", 'max_length': '255'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'communication.agepslidelogging': { - 'Meta': {'object_name': 'AgepSlideLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.AgepSlide']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.logo': { - 'Meta': {'object_name': 'Logo'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}), - 'visibility_level': ('django.db.models.fields.CharField', [], {'default': "'default'", 'max_length': '32'}) - }, - u'communication.logofile': { - 'Meta': {'object_name': 'LogoFile'}, - 'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'files'", 'to': u"orm['communication.Logo']"}) - }, - u'communication.logologging': { - 'Meta': {'object_name': 'LogoLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.Logo']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.websitenews': { - 'Meta': {'object_name': 'WebsiteNews'}, - 'content': ('django.db.models.fields.TextField', [], {}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_draft'", 'max_length': '255'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '255'}) - }, - u'communication.websitenewslogging': { - 'Meta': {'object_name': 'WebsiteNewsLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.WebsiteNews']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['communication'] \ No newline at end of file diff --git a/truffe2/communication/migrations/0007_auto__del_field_logofile_creation_date__add_field_logofile_upload_date.py b/truffe2/communication/migrations/0007_auto__del_field_logofile_creation_date__add_field_logofile_upload_date.py deleted file mode 100644 index a60784f4..00000000 --- a/truffe2/communication/migrations/0007_auto__del_field_logofile_creation_date__add_field_logofile_upload_date.py +++ /dev/null @@ -1,175 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting field 'LogoFile.creation_date' - db.delete_column(u'communication_logofile', 'creation_date') - - # Adding field 'LogoFile.upload_date' - db.add_column(u'communication_logofile', 'upload_date', - self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, default=datetime.datetime(2015, 6, 27, 0, 0), blank=True), - keep_default=False) - - # Adding field 'LogoFile.uploader' - db.add_column(u'communication_logofile', 'uploader', - self.gf('django.db.models.fields.related.ForeignKey')(default=1, to=orm['users.TruffeUser']), - keep_default=False) - - - # Changing field 'LogoFile.object' - db.alter_column(u'communication_logofile', 'object_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['communication.Logo'])) - - def backwards(self, orm): - - # User chose to not deal with backwards NULL issues for 'LogoFile.creation_date' - raise RuntimeError("Cannot reverse this migration. 'LogoFile.creation_date' and its values cannot be restored.") - - # The following code is provided here to aid in writing a correct migration # Adding field 'LogoFile.creation_date' - db.add_column(u'communication_logofile', 'creation_date', - self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True), - keep_default=False) - - # Deleting field 'LogoFile.upload_date' - db.delete_column(u'communication_logofile', 'upload_date') - - # Deleting field 'LogoFile.uploader' - db.delete_column(u'communication_logofile', 'uploader_id') - - - # User chose to not deal with backwards NULL issues for 'LogoFile.object' - raise RuntimeError("Cannot reverse this migration. 'LogoFile.object' and its values cannot be restored.") - - # The following code is provided here to aid in writing a correct migration - # Changing field 'LogoFile.object' - db.alter_column(u'communication_logofile', 'object_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['communication.Logo'])) - - models = { - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'communication.agepslide': { - 'Meta': {'object_name': 'AgepSlide'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'picture': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_draft'", 'max_length': '255'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'communication.agepslidelogging': { - 'Meta': {'object_name': 'AgepSlideLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.AgepSlide']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.logo': { - 'Meta': {'object_name': 'Logo'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}), - 'visibility_level': ('django.db.models.fields.CharField', [], {'default': "'default'", 'max_length': '32'}) - }, - u'communication.logofile': { - 'Meta': {'object_name': 'LogoFile'}, - 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'files'", 'null': 'True', 'to': u"orm['communication.Logo']"}), - 'upload_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'uploader': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.logologging': { - 'Meta': {'object_name': 'LogoLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.Logo']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.websitenews': { - 'Meta': {'object_name': 'WebsiteNews'}, - 'content': ('django.db.models.fields.TextField', [], {}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_draft'", 'max_length': '255'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '255'}) - }, - u'communication.websitenewslogging': { - 'Meta': {'object_name': 'WebsiteNewsLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.WebsiteNews']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['communication'] \ No newline at end of file diff --git a/truffe2/communication/migrations/0008_auto__add_logoviews__add_websitenewsviews__add_agepslideviews.py b/truffe2/communication/migrations/0008_auto__add_logoviews__add_websitenewsviews__add_agepslideviews.py deleted file mode 100644 index 225e7eca..00000000 --- a/truffe2/communication/migrations/0008_auto__add_logoviews__add_websitenewsviews__add_agepslideviews.py +++ /dev/null @@ -1,197 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'LogoViews' - db.create_table(u'communication_logoviews', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='views', to=orm['communication.Logo'])), - )) - db.send_create_signal(u'communication', ['LogoViews']) - - # Adding model 'WebsiteNewsViews' - db.create_table(u'communication_websitenewsviews', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='views', to=orm['communication.WebsiteNews'])), - )) - db.send_create_signal(u'communication', ['WebsiteNewsViews']) - - # Adding model 'AgepSlideViews' - db.create_table(u'communication_agepslideviews', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='views', to=orm['communication.AgepSlide'])), - )) - db.send_create_signal(u'communication', ['AgepSlideViews']) - - - def backwards(self, orm): - # Deleting model 'LogoViews' - db.delete_table(u'communication_logoviews') - - # Deleting model 'WebsiteNewsViews' - db.delete_table(u'communication_websitenewsviews') - - # Deleting model 'AgepSlideViews' - db.delete_table(u'communication_agepslideviews') - - - models = { - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'communication.agepslide': { - 'Meta': {'object_name': 'AgepSlide'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'picture': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_draft'", 'max_length': '255'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'communication.agepslidelogging': { - 'Meta': {'object_name': 'AgepSlideLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.AgepSlide']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.agepslideviews': { - 'Meta': {'object_name': 'AgepSlideViews'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': u"orm['communication.AgepSlide']"}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.logo': { - 'Meta': {'object_name': 'Logo'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}), - 'visibility_level': ('django.db.models.fields.CharField', [], {'default': "'default'", 'max_length': '32'}) - }, - u'communication.logofile': { - 'Meta': {'object_name': 'LogoFile'}, - 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'files'", 'null': 'True', 'to': u"orm['communication.Logo']"}), - 'upload_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'uploader': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.logologging': { - 'Meta': {'object_name': 'LogoLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.Logo']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.logoviews': { - 'Meta': {'object_name': 'LogoViews'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': u"orm['communication.Logo']"}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.websitenews': { - 'Meta': {'object_name': 'WebsiteNews'}, - 'content': ('django.db.models.fields.TextField', [], {}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_draft'", 'max_length': '255'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '255'}) - }, - u'communication.websitenewslogging': { - 'Meta': {'object_name': 'WebsiteNewsLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.WebsiteNews']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.websitenewsviews': { - 'Meta': {'object_name': 'WebsiteNewsViews'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': u"orm['communication.WebsiteNews']"}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'homepage': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_betatester': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['communication'] \ No newline at end of file diff --git a/truffe2/communication/migrations/0009_auto__add_field_websitenews_title_en__add_field_websitenews_content_en.py b/truffe2/communication/migrations/0009_auto__add_field_websitenews_title_en__add_field_websitenews_content_en.py deleted file mode 100644 index 8ef1a418..00000000 --- a/truffe2/communication/migrations/0009_auto__add_field_websitenews_title_en__add_field_websitenews_content_en.py +++ /dev/null @@ -1,179 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'WebsiteNews.title_en' - db.add_column(u'communication_websitenews', 'title_en', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), - keep_default=False) - - # Adding field 'WebsiteNews.content_en' - db.add_column(u'communication_websitenews', 'content_en', - self.gf('django.db.models.fields.TextField')(null=True, blank=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'WebsiteNews.title_en' - db.delete_column(u'communication_websitenews', 'title_en') - - # Deleting field 'WebsiteNews.content_en' - db.delete_column(u'communication_websitenews', 'content_en') - - - models = { - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'communication.agepslide': { - 'Meta': {'object_name': 'AgepSlide'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'picture': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_draft'", 'max_length': '255'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'communication.agepslidelogging': { - 'Meta': {'object_name': 'AgepSlideLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.AgepSlide']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.agepslideviews': { - 'Meta': {'object_name': 'AgepSlideViews'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': u"orm['communication.AgepSlide']"}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.logo': { - 'Meta': {'object_name': 'Logo'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}), - 'visibility_level': ('django.db.models.fields.CharField', [], {'default': "'default'", 'max_length': '32'}) - }, - u'communication.logofile': { - 'Meta': {'object_name': 'LogoFile'}, - 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'files'", 'null': 'True', 'to': u"orm['communication.Logo']"}), - 'upload_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'uploader': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.logologging': { - 'Meta': {'object_name': 'LogoLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.Logo']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.logoviews': { - 'Meta': {'object_name': 'LogoViews'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': u"orm['communication.Logo']"}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.websitenews': { - 'Meta': {'object_name': 'WebsiteNews'}, - 'content': ('django.db.models.fields.TextField', [], {}), - 'content_en': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_draft'", 'max_length': '255'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'title_en': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '255'}) - }, - u'communication.websitenewslogging': { - 'Meta': {'object_name': 'WebsiteNewsLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.WebsiteNews']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.websitenewsviews': { - 'Meta': {'object_name': 'WebsiteNewsViews'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': u"orm['communication.WebsiteNews']"}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'homepage': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_betatester': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['communication'] \ No newline at end of file diff --git a/truffe2/communication/migrations/0010_auto__add_displayviews__add_displayreservationlogging__add_display__ad.py b/truffe2/communication/migrations/0010_auto__add_displayviews__add_displayreservationlogging__add_display__ad.py deleted file mode 100644 index f950c8a3..00000000 --- a/truffe2/communication/migrations/0010_auto__add_displayviews__add_displayreservationlogging__add_display__ad.py +++ /dev/null @@ -1,327 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'DisplayViews' - db.create_table(u'communication_displayviews', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='views', to=orm['communication.Display'])), - )) - db.send_create_signal(u'communication', ['DisplayViews']) - - # Adding model 'DisplayReservationLogging' - db.create_table(u'communication_displayreservationlogging', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('extra_data', self.gf('django.db.models.fields.TextField')(blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('what', self.gf('django.db.models.fields.CharField')(max_length=64)), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='logs', to=orm['communication.DisplayReservation'])), - )) - db.send_create_signal(u'communication', ['DisplayReservationLogging']) - - # Adding model 'Display' - db.create_table(u'communication_display', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('deleted', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('title', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('description', self.gf('django.db.models.fields.TextField')()), - ('active', self.gf('django.db.models.fields.BooleanField')(default=True)), - ('conditions', self.gf('django.db.models.fields.TextField')(blank=True)), - ('allow_externals', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('conditions_externals', self.gf('django.db.models.fields.TextField')(blank=True)), - ('allow_calendar', self.gf('django.db.models.fields.BooleanField')(default=True)), - ('allow_external_calendar', self.gf('django.db.models.fields.BooleanField')(default=True)), - ('max_days', self.gf('django.db.models.fields.PositiveIntegerField')(default=0)), - ('max_days_externals', self.gf('django.db.models.fields.PositiveIntegerField')(default=0)), - ('minimum_days_before', self.gf('django.db.models.fields.PositiveIntegerField')(default=0)), - ('minimum_days_before_externals', self.gf('django.db.models.fields.PositiveIntegerField')(default=0)), - ('maximum_days_before', self.gf('django.db.models.fields.PositiveIntegerField')(default=0)), - ('maximum_days_before_externals', self.gf('django.db.models.fields.PositiveIntegerField')(default=0)), - ('unit', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['units.Unit'])), - )) - db.send_create_signal(u'communication', ['Display']) - - # Adding model 'DisplayReservation' - db.create_table(u'communication_displayreservation', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('deleted', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('title', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('start_date', self.gf('django.db.models.fields.DateTimeField')()), - ('end_date', self.gf('django.db.models.fields.DateTimeField')()), - ('reason', self.gf('django.db.models.fields.TextField')()), - ('remarks', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('status', self.gf('django.db.models.fields.CharField')(default='0_draft', max_length=255)), - ('unit', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['units.Unit'], null=True, blank=True)), - ('unit_blank_user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'], null=True, blank=True)), - ('unit_blank_name', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True)), - ('display', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['communication.Display'])), - )) - db.send_create_signal(u'communication', ['DisplayReservation']) - - # Adding model 'DisplayLogging' - db.create_table(u'communication_displaylogging', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('extra_data', self.gf('django.db.models.fields.TextField')(blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('what', self.gf('django.db.models.fields.CharField')(max_length=64)), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='logs', to=orm['communication.Display'])), - )) - db.send_create_signal(u'communication', ['DisplayLogging']) - - # Adding model 'DisplayReservationViews' - db.create_table(u'communication_displayreservationviews', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('when', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.TruffeUser'])), - ('object', self.gf('django.db.models.fields.related.ForeignKey')(related_name='views', to=orm['communication.DisplayReservation'])), - )) - db.send_create_signal(u'communication', ['DisplayReservationViews']) - - - def backwards(self, orm): - # Deleting model 'DisplayViews' - db.delete_table(u'communication_displayviews') - - # Deleting model 'DisplayReservationLogging' - db.delete_table(u'communication_displayreservationlogging') - - # Deleting model 'Display' - db.delete_table(u'communication_display') - - # Deleting model 'DisplayReservation' - db.delete_table(u'communication_displayreservation') - - # Deleting model 'DisplayLogging' - db.delete_table(u'communication_displaylogging') - - # Deleting model 'DisplayReservationViews' - db.delete_table(u'communication_displayreservationviews') - - - models = { - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'communication.agepslide': { - 'Meta': {'object_name': 'AgepSlide'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'picture': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_draft'", 'max_length': '255'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'communication.agepslidelogging': { - 'Meta': {'object_name': 'AgepSlideLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.AgepSlide']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.agepslideviews': { - 'Meta': {'object_name': 'AgepSlideViews'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': u"orm['communication.AgepSlide']"}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.display': { - 'Meta': {'object_name': 'Display'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'allow_calendar': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'allow_external_calendar': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'allow_externals': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'conditions': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'conditions_externals': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'max_days': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), - 'max_days_externals': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), - 'maximum_days_before': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), - 'maximum_days_before_externals': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), - 'minimum_days_before': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), - 'minimum_days_before_externals': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}) - }, - u'communication.displaylogging': { - 'Meta': {'object_name': 'DisplayLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.Display']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.displayreservation': { - 'Meta': {'object_name': 'DisplayReservation'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'display': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['communication.Display']"}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'reason': ('django.db.models.fields.TextField', [], {}), - 'remarks': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_draft'", 'max_length': '255'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'unit_blank_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'unit_blank_user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']", 'null': 'True', 'blank': 'True'}) - }, - u'communication.displayreservationlogging': { - 'Meta': {'object_name': 'DisplayReservationLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.DisplayReservation']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.displayreservationviews': { - 'Meta': {'object_name': 'DisplayReservationViews'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': u"orm['communication.DisplayReservation']"}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.displayviews': { - 'Meta': {'object_name': 'DisplayViews'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': u"orm['communication.Display']"}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.logo': { - 'Meta': {'object_name': 'Logo'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}), - 'visibility_level': ('django.db.models.fields.CharField', [], {'default': "'default'", 'max_length': '32'}) - }, - u'communication.logofile': { - 'Meta': {'object_name': 'LogoFile'}, - 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'files'", 'null': 'True', 'to': u"orm['communication.Logo']"}), - 'upload_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'uploader': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.logologging': { - 'Meta': {'object_name': 'LogoLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.Logo']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.logoviews': { - 'Meta': {'object_name': 'LogoViews'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': u"orm['communication.Logo']"}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.websitenews': { - 'Meta': {'object_name': 'WebsiteNews'}, - 'content': ('django.db.models.fields.TextField', [], {}), - 'content_en': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'0_draft'", 'max_length': '255'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'title_en': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']"}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '255'}) - }, - u'communication.websitenewslogging': { - 'Meta': {'object_name': 'WebsiteNewsLogging'}, - 'extra_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['communication.WebsiteNews']"}), - 'what': ('django.db.models.fields.CharField', [], {'max_length': '64'}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'communication.websitenewsviews': { - 'Meta': {'object_name': 'WebsiteNewsViews'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': u"orm['communication.WebsiteNews']"}), - 'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'who': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.TruffeUser']"}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'units.unit': { - 'Meta': {'object_name': 'Unit'}, - 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'id_epfl': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), - 'is_commission': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_equipe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'parent_hierarchique': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['units.Unit']", 'null': 'True', 'blank': 'True'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'users.truffeuser': { - 'Meta': {'object_name': 'TruffeUser'}, - 'adresse': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), - 'body': ('django.db.models.fields.CharField', [], {'default': "'.'", 'max_length': '1'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '255'}), - 'email_perso': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - 'homepage': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'iban_ou_ccp': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_betatester': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}), - 'nom_banque': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) - } - } - - complete_apps = ['communication'] \ No newline at end of file diff --git a/truffe2/communication/models.py b/truffe2/communication/models.py index c692359f..ede4c5a6 100644 --- a/truffe2/communication/models.py +++ b/truffe2/communication/models.py @@ -2,11 +2,11 @@ from django.db import models from generic.models import GenericModel, GenericStateModel, GenericStateRootModerable, GenericStateUnitValidable, FalseFK, GenericGroupsValidableModel, GenericGroupsModerableModel, GenericGroupsModel, GenericContactableModel, GenericModelWithFiles, GenericExternalUnitAllowed, GenericDelayValidable, GenericDelayValidableInfo, SearchableModel, ModelUsedAsLine, GenericModelWithLines -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.utils.html import escape from django.utils.safestring import mark_safe from django.utils.timezone import localtime -from django.core.urlresolvers import reverse +from django.urls import reverse from rights.utils import UnitEditableModel, UnitExternalEditableModel, AutoVisibilityLevel @@ -71,7 +71,7 @@ class MetaSearch(SearchableModel.MetaSearch): class Meta: abstract = True - def __unicode__(self): + def __str__(self): return self.title @@ -130,7 +130,7 @@ class MetaSearch(SearchableModel.MetaSearch): class Meta: abstract = True - def __unicode__(self): + def __str__(self): return self.title def get_image_warning(self): @@ -143,7 +143,7 @@ class _Logo(GenericModel, GenericModelWithFiles, AutoVisibilityLevel, UnitEditab class MetaRightsUnit(UnitEditableModel.MetaRightsUnit): access = 'COMMUNICATION' - name = models.CharField(max_length=255) + name = models.CharField(max_length=255, default='---') unit = FalseFK('units.models.Unit') class MetaData: @@ -151,7 +151,7 @@ class MetaData: ('name', _('Nom')), ] details_display = list_display + [('get_visibility_level_display', _(u'Visibilité')), ] - filter_fields = ('name', ) + filter_fields = ('name',) base_title = _(u'Logo') list_title = _(u'Liste de tous les logos') @@ -184,7 +184,7 @@ class MetaSearch(SearchableModel.MetaSearch): class Meta: abstract = True - def __unicode__(self): + def __str__(self): return self.name def get_best_image(self): @@ -196,6 +196,7 @@ def get_best_image(self): return f + class _Display(GenericModel, GenericGroupsModel, UnitEditableModel, GenericDelayValidableInfo, SearchableModel): class MetaRightsUnit(UnitEditableModel.MetaRightsUnit): @@ -267,9 +268,10 @@ class MetaSearch(SearchableModel.MetaSearch): class Meta: abstract = True - def __unicode__(self): + def __str__(self): return self.title + class _DisplayReservation(GenericModel, GenericDelayValidable, GenericGroupsValidableModel, GenericGroupsModel, GenericContactableModel, GenericStateUnitValidable, GenericStateModel, GenericExternalUnitAllowed, UnitExternalEditableModel, SearchableModel): class MetaRightsUnit(UnitExternalEditableModel.MetaRightsUnit): @@ -357,8 +359,8 @@ class MetaEdit: datetime_fields = ('start_date', 'end_date') only_if = { - 'remarks': lambda (obj, user): obj.status == '2_online' and obj.rights_can('VALIDATE', user), - 'display': lambda (obj, user): obj.status == '0_draft', + 'remarks': lambda obj, user: obj.status == '2_online' and obj.rights_can('VALIDATE', user), + 'display': lambda obj, user: obj.status == '0_draft', } class MetaSearch(SearchableModel.MetaSearch): @@ -379,7 +381,7 @@ class MetaState(GenericStateUnitValidable.MetaState): unit_field = 'display.unit' linked_model = 'communication.models.Display' - def __unicode__(self): + def __str__(self): return self.title def genericFormExtraClean(self, data, form): @@ -426,7 +428,7 @@ def get_conflits(self): return retour def get_display_link(self): - return '{}'.format(reverse('communication.views.display_show', args=(self.display.pk,)), self.display) + return '{}'.format(reverse('communication-views-display_show', args=(self.display.pk,)), self.display) def get_conflits_list(self): diff --git a/truffe2/communication/templates/communication/displayreservation/edit.html b/truffe2/communication/templates/communication/displayreservation/edit.html index a5c17642..e16d8980 100644 --- a/truffe2/communication/templates/communication/displayreservation/edit.html +++ b/truffe2/communication/templates/communication/displayreservation/edit.html @@ -23,7 +23,7 @@ $('#id_display').width('92%').select2({ minimumInputLength: 0, ajax: { - url: "{% url 'communication.views.display_search' %}", + url: "{% url 'communication-views-display_search' %}", dataType: 'json', data: function (term, page) { return { @@ -36,7 +36,7 @@ }, }, initSelection : function (element, callback) { - $.ajax("{% url 'communication.views.display_search' %}?init=" + $(element).val() + '&unit_pk=' + $('#input_upk').val(), {'dataType': 'json'}).success(function (data) { + $.ajax("{% url 'communication-views-display_search' %}?init=" + $(element).val() + '&unit_pk=' + $('#input_upk').val(), {'dataType': 'json'}).success(function (data) { callback(data[0]); }); }, diff --git a/truffe2/communication/templates/communication/ecrans.html b/truffe2/communication/templates/communication/ecrans.html index 44d69a3a..021b51c7 100755 --- a/truffe2/communication/templates/communication/ecrans.html +++ b/truffe2/communication/templates/communication/ecrans.html @@ -40,7 +40,7 @@ function changeImage() { - ajax.open("GET","{% url 'communication.views.random_slide' %}?_" + Date(), false); + ajax.open("GET","{% url 'communication-views-random_slide' %}?_" + Date(), false); ajax.send(); if (last_image == 'image0') diff --git a/truffe2/communication/templates/communication/logo_public_list.html b/truffe2/communication/templates/communication/logo_public_list.html index 907b2741..81ea0156 100644 --- a/truffe2/communication/templates/communication/logo_public_list.html +++ b/truffe2/communication/templates/communication/logo_public_list.html @@ -54,7 +54,7 @@

    {% trans "Logos" %}

    {% for unit in units %} // function load_unit_data_{{forloop.counter}}() { - $.ajax('{% url 'communication.views.logo_public_load' %}?pk={{unit.pk}}').done(function (data) { + $.ajax('{% url 'communication-views-logo_public_load' %}?pk={{unit.pk}}').done(function (data) { $('#tab-{{unit.pk}}').html(data); // load_unit_data_{{forloop.counter|add:"1"}}(); diff --git a/truffe2/communication/templates/communication/logo_public_load.html b/truffe2/communication/templates/communication/logo_public_load.html index d742daae..79907093 100644 --- a/truffe2/communication/templates/communication/logo_public_load.html +++ b/truffe2/communication/templates/communication/logo_public_load.html @@ -2,11 +2,11 @@ {% for logo in logos %} - + {{logo.name|truncatechars:25}} {% if logo.files.count == 1 %} - + {% else %} @@ -18,7 +18,7 @@ diff --git a/truffe2/communication/tests.py b/truffe2/communication/tests.py index 7ce503c2..cb634b21 100644 --- a/truffe2/communication/tests.py +++ b/truffe2/communication/tests.py @@ -1,3 +1,56 @@ -from django.test import TestCase +# -*- coding: utf-8 -*- +""" +This file demonstrates writing tests using the unittest module. These will pass +when you run "manage.py test". -# Create your tests here. +Replace this with more appropriate tests for your application. +""" + +from main.test_tools import TruffeTestAbstract + + +class CommunicationNoLoginTest(TruffeTestAbstract): + + def test_ecrans(self): + self.call_check_text('/communication/ecrans') + + def test_random_slide(self): + self.call_check_text('/communication/random_slide') + + def test_website_news(self): + self.call_check_json('/communication/website_news') + + def test_public_list(self): + self.call_check_redirect('/communication/logo_public_list') + + def test_logo_public_load(self): + self.call_check_redirect('/communication/logo_public_load') + + def test_display_search(self): + self.call_check_redirect('/communication/display/search') + + +class CommunicationWithLoginTest(TruffeTestAbstract): + + login_username = "admin" + + def test_ecrans(self): + self.call_check_text('/communication/ecrans') + + def test_random_slide(self): + self.call_check_text('/communication/random_slide') + + def test_website_news(self): + self.call_check_json('/communication/website_news') + + def test_public_list(self): + self.call_check_html('/communication/logo_public_list') + + def test_logo_public_load(self): + self.call_check_text('/communication/logo_public_load', data={"pk":1}) + + def test_display_search(self): + self.call_check_json('/communication/display/search') + self.call_check_json('/communication/display/search', data={'q':'room'}) + self.call_check_json('/communication/display/search', data={'init':1}) + self.call_check_json('/communication/display/search', data={'unit_pk':2}) diff --git a/truffe2/communication/urls.py b/truffe2/communication/urls.py index 8203ea63..6f00825f 100644 --- a/truffe2/communication/urls.py +++ b/truffe2/communication/urls.py @@ -1,15 +1,14 @@ # -*- coding: utf-8 -*- -from django.conf.urls import patterns, url - - -urlpatterns = patterns( - 'communication.views', - - url(r'^ecrans$', 'ecrans'), - url(r'^random_slide$', 'random_slide'), - url(r'^website_news$', 'website_news'), - url(r'^logo_public_list$', 'logo_public_list'), - url(r'^logo_public_load$', 'logo_public_load'), - url('display/search', 'display_search'), -) +from django.urls import re_path +from communication.views import display_search, logo_public_load, \ + logo_public_list, website_news, random_slide, ecrans + +urlpatterns = [ + re_path(r'^ecrans$', ecrans, name='communication-views-ecrans'), + re_path(r'^random_slide$', random_slide, name='communication-views-random_slide'), + re_path(r'^website_news$', website_news, name='communication-views-website_news'), + re_path(r'^logo_public_list$', logo_public_list, name='communication-views-logo_public_list'), + re_path(r'^logo_public_load$', logo_public_load, name='communication-views-logo_public_load'), + re_path('display/search', display_search, name='communication-views-display_search'), +] diff --git a/truffe2/communication/views.py b/truffe2/communication/views.py index c2f29720..d12b8b50 100644 --- a/truffe2/communication/views.py +++ b/truffe2/communication/views.py @@ -12,6 +12,7 @@ from app.utils import update_current_unit from generic.templatetags.generic_extras import html_check_and_safe + def ecrans(request): """View to display the ecran page""" @@ -37,7 +38,7 @@ def website_news(request): for news in WebsiteNews.objects.filter(status='2_online').exclude(deleted=True).filter(Q(start_date=None) | Q(start_date__lt=now())).filter(Q(end_date=None) | Q(end_date__gt=now())).order_by('?'): if not request.GET.get('only') or request.GET.get('only')[5:] == str(news.pk): - retour.append({'id': 'T2V1N{}'.format(news.pk), 'title_fr': news.title, 'title_en': news.title_en or news.title, 'content_fr': news.content, 'content_en': news.content_en or news.content, 'url': news.url, 'unit': news.unit.__unicode__(), 'date': str(news.start_date or news.last_log().when)}) + retour.append({'id': 'T2V1N{}'.format(news.pk), 'title_fr': news.title, 'title_en': news.title_en or news.title, 'content_fr': news.content, 'content_en': news.content_en or news.content, 'url': news.url, 'unit': news.unit.__str__(), 'date': str(news.start_date or news.last_log().when)}) return HttpResponse(json.dumps(retour), content_type='application/json') @@ -68,6 +69,7 @@ def logo_public_load(request): return render(request, 'communication/logo_public_load.html', {'logos': logos, 'unit': unit}) + @login_required def display_search(request): @@ -77,7 +79,7 @@ def display_search(request): init = request.GET.get('init') unit_pk = request.GET.get('unit_pk', "-1") or "-1" - displays= Display.objects.filter(active=True, deleted=False).order_by('title') + displays = Display.objects.filter(active=True, deleted=False).order_by('title') if q: displays = displays.filter(title__icontains=q) @@ -101,6 +103,6 @@ def display_search(request): if not dummy.rights_can('CREATE', request.user): raise Http404 - retour = map(lambda display: {'id': display.pk, 'text': display.title, 'description': strip_tags(html_check_and_safe(display.description))[:100] + '...', 'unit': str(display.unit)}, displays) + retour = [{'id': display.pk, 'text': display.title, 'description': strip_tags(html_check_and_safe(display.description))[:100] + '...', 'unit': str(display.unit)} for display in displays] return HttpResponse(json.dumps(retour)) diff --git a/truffe2/data/pip-reqs.txt b/truffe2/data/pip-reqs.txt index 7d22803e..150344ea 100644 --- a/truffe2/data/pip-reqs.txt +++ b/truffe2/data/pip-reqs.txt @@ -1,30 +1,25 @@ -django<1.7 -south +Django==3.1.6 raven -Pillow<3 -django-bootstrap3<6 +django-bootstrap3==14.2.0 phonenumbers requests -django-impersonate<1 +django-impersonate==1.7.3 pytz git+https://github.com/goinnn/django-multiselectfield -easy_thumbnails<2.5 -bleach<1.5 +easy_thumbnails==2.7.1 +bleach==3.3.0 python-ldap -pisa -reportlab<3 -html5lib==1.0b8 -django-appconf<1.0.4 -django-jfu -django-sendfile -django-haystack==2.4.1 +xhtml2pdf +django-appconf==1.0.4 +django-sendfile2 +django-haystack==3.0 whoosh -pdfminer.six textract -celery==3.1.25 -celery-haystack<0.10 -pypdf -pyyaml +celery==5.0.5 +celery-haystack==0.10 +PyPDF4 wand schwifty -iso4217 # currency list \ No newline at end of file +iso4217 # currency list +enum34 +six==1.15.0 diff --git a/truffe2/generic/__init__.py b/truffe2/generic/__init__.py index e69de29b..ae264d66 100644 --- a/truffe2/generic/__init__.py +++ b/truffe2/generic/__init__.py @@ -0,0 +1,3 @@ + +default_app_config = 'generic.apps.GenericConfig' + diff --git a/truffe2/generic/apps.py b/truffe2/generic/apps.py new file mode 100644 index 00000000..eeaa6d08 --- /dev/null +++ b/truffe2/generic/apps.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +''' +apps.py +''' + +from django.apps import AppConfig + + +class GenericConfig(AppConfig): + name = 'generic' + verbose_name = "Generic" + + def ready(self): + from generic.models import GenericModel + GenericModel.startup() diff --git a/truffe2/generic/datatables.py b/truffe2/generic/datatables.py index ce3d6dca..168314bc 100644 --- a/truffe2/generic/datatables.py +++ b/truffe2/generic/datatables.py @@ -1,5 +1,4 @@ from django.db.models import Q -from django.template import RequestContext from django.shortcuts import render @@ -11,22 +10,30 @@ def generic_list_json(request, model, columns, templates, bonus_data={}, check_d not_sortable_columns_local = not_sortable_columns + (model.MetaData.not_sortable_columns if hasattr(model, 'MetaData') and hasattr(model.MetaData, 'not_sortable_columns') else []) columns_mapping_local = model.MetaData.trans_sort if hasattr(model, 'MetaData') and hasattr(model.MetaData, 'trans_sort') else (columns_mapping or {}) + + def request_get(key, default): + if key in request.GET: + return request.GET[key] + elif key in request.POST: + return request.POST[key] + else: + return default def do_ordering(qs): # Ordering try: - i_sorting_cols = int(request.REQUEST.get('iSortingCols', 0)) + i_sorting_cols = int(request_get('iSortingCols', 0)) except: i_sorting_cols = 0 order = [] for i in range(i_sorting_cols): try: - i_sort_col = int(request.REQUEST.get('iSortCol_%s' % i)) + i_sort_col = int(request_get('iSortCol_%s' % i, 0)) except ValueError: i_sort_col = 0 - s_sort_dir = request.REQUEST.get('sSortDir_%s' % i) + s_sort_dir = request_get('sSortDir_%s' % i, '') sdir = '-' if s_sort_dir == 'desc' else '' @@ -49,15 +56,15 @@ def do_ordering(qs): return qs def do_paging(qs): - limit = min(int(request.REQUEST.get('iDisplayLength', 10)), 500) + limit = min(int(request_get('iDisplayLength', 10)), 500) if limit == -1: return qs - start = int(request.REQUEST.get('iDisplayStart', 0)) + start = int(request_get('iDisplayStart', 0)) offset = start + limit return qs[start:offset] def do_filtering(qs): - sSearch = request.REQUEST.get('sSearch', None) + sSearch = request_get('sSearch', None) if sSearch: @@ -81,7 +88,7 @@ def do_filtering(qs): qs = qs.filter(general_base) if hasattr(model, 'MetaState') and hasattr(model.MetaState, 'status_col_id'): - status_search = request.REQUEST.get('sSearch_%s' % (model.MetaState.status_col_id + (0 if not deca_one_status else 0) + (0 if selector_column else 0),), None) + status_search = request_get('sSearch_%s' % (model.MetaState.status_col_id + (0 if not deca_one_status else 0) + (0 if selector_column else 0),), None) if status_search == "null": status_search = None @@ -118,7 +125,7 @@ def do_filtering(qs): qs = do_ordering(qs) qs = do_paging(qs) - data = {'iTotalRecords': total_records, 'iTotalDisplayRecords': total_display_records, 'sEcho': int(request.REQUEST.get('sEcho', 0)), 'list': qs.all()} + data = {'iTotalRecords': total_records, 'iTotalDisplayRecords': total_display_records, 'sEcho': int(request_get('sEcho', 0)), 'list': qs.all()} data.update(bonus_data) rep = render(request, templates, data, content_type='application/json') diff --git a/truffe2/generic/forms.py b/truffe2/generic/forms.py index b39fd7eb..1f3ddba7 100644 --- a/truffe2/generic/forms.py +++ b/truffe2/generic/forms.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- from django.forms import ModelForm, Form, CharField, ChoiceField, Textarea, BooleanField, ValidationError -from django.utils.translation import ugettext_lazy as _ - +from django.utils.translation import gettext_lazy as _ from app.utils import get_property class GenericForm(ModelForm): + class Meta: pass @@ -29,8 +29,8 @@ def __init__(self, current_user, *args, **kwargs): self.fields['unit'].queryset = Unit.objects.order_by('name') if hasattr(self.Meta.model, 'MetaEdit') and hasattr(self.Meta.model.MetaEdit, 'only_if'): - for key, test in self.Meta.model.MetaEdit.only_if.iteritems(): - if not test((self.instance, current_user)): + for key, test in self.Meta.model.MetaEdit.only_if.items(): + if not test(self.instance, current_user): if key in self.fields: del self.fields[key] @@ -59,8 +59,10 @@ def clean(self): if 'costcenter' not in cleaned_data: raise ValidationError(_(u'Aucun centre de coûts sélectionné !')) - if hasattr(self.instance, 'unit') and cleaned_data['costcenter'].unit.pk not in [self.instance.unit.pk] + map(lambda un: un.pk, self.instance.unit.sub_eqi() + self.instance.unit.sub_grp()): - raise ValidationError(_(u'Le centre de coût n\'est pas lié à l\'unité !')) + if hasattr(self.instance, 'unit'): + list_unit_pk = [self.instance.unit.pk] + [un.pk for un in self.instance.unit.sub_eqi() + self.instance.unit.sub_grp()] + if cleaned_data['costcenter'].unit.pk not in list_unit_pk: + raise ValidationError(_(u'Le centre de coût n\'est pas lié à l\'unité !')) if hasattr(self.instance, 'accounting_year') and self.instance.accounting_year != cleaned_data['costcenter'].accounting_year: raise ValidationError(_(u'Le centre de coût n\'est pas lié à l\'année comptable !')) @@ -77,6 +79,6 @@ class ContactForm(Form): def __init__(self, keys, *args, **kwargs): super(ContactForm, self).__init__(*args, **kwargs) - choices_key = [x for x in keys.iteritems()] + choices_key = [x for x in keys.items()] self.fields['key'] = ChoiceField(label=_('Destinataire(s)'), choices=choices_key) diff --git a/truffe2/generic/models.py b/truffe2/generic/models.py index cf024c01..2313a41d 100644 --- a/truffe2/generic/models.py +++ b/truffe2/generic/models.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- from django.db import models +from django.db.models.deletion import PROTECT, SET_NULL from django.conf import settings -from django.conf.urls import patterns, url -from django.core.urlresolvers import reverse -from django.contrib.contenttypes.models import ContentType +from django.urls import re_path from django.forms import CharField, Textarea, Form from django.utils.timezone import now -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ +from django.urls import reverse import json import copy @@ -21,15 +21,12 @@ import textract from celery_haystack.indexes import CelerySearchIndex -from users.models import TruffeUser from generic import views from generic.forms import GenericForm from generic.search import SearchableModel from app.utils import get_property -from notifications.utils import notify_people, unotify_people from rights.utils import AutoVisibilityLevel - moderable_things = [] copiable_things = [] @@ -49,6 +46,8 @@ def build_models_list_of(Class): retour = [] already_returned = [] for app in settings.INSTALLED_APPS: + if app in ('impersonate',): + continue try: module = importlib.import_module(app) models_module = importlib.import_module('.models', app) @@ -56,7 +55,8 @@ def build_models_list_of(Class): urls_module = importlib.import_module('.urls', app) forms_module = importlib.import_module('.forms', app) except Exception as e: - if str(e) not in ["No module named urls", "No module named views", "No module named forms", "No module named models"]: + message = str(e) + if ("No module named" not in message) and not (("urls" in message) or ("views" in message) or ("forms" in message) or ("models" in message)): raise try: @@ -118,9 +118,9 @@ def startup(): if issubclass(model_class, SpecificClass): extra_data.update(SpecificClass.do(module, models_module, model_class, cache)) - for key, value in model_class.__dict__.iteritems(): + for key, value in model_class.__dict__.items(): if hasattr(value, '__class__') and value.__class__ == FalseFK: - extra_data.update({key: models.ForeignKey(cache[value.model], *value.args, **value.kwargs)}) + extra_data.update({key: models.ForeignKey(cache[value.model], on_delete=PROTECT, *value.args, **value.kwargs)}) real_model_class = type(model_class.__name__[1:], (model_class,), extra_data) @@ -128,11 +128,11 @@ def startup(): cache['%s.%s' % (models_module.__name__, real_model_class.__name__)] = real_model_class # Add the logging model - logging_class = type('%sLogging' % (real_model_class.__name__,), (GenericLogEntry,), {'object': models.ForeignKey(real_model_class, related_name='logs'), '__module__': models_module.__name__}) + logging_class = type('%sLogging' % (real_model_class.__name__,), (GenericLogEntry,), {'object': models.ForeignKey(real_model_class, related_name='logs', on_delete=PROTECT), '__module__': models_module.__name__}) setattr(models_module, logging_class.__name__, logging_class) # Add the view model - views_class = type('%sViews' % (real_model_class.__name__,), (GenericObjectView,), {'object': models.ForeignKey(real_model_class, related_name='views'), '__module__': models_module.__name__}) + views_class = type('%sViews' % (real_model_class.__name__,), (GenericObjectView,), {'object': models.ForeignKey(real_model_class, related_name='views', on_delete=PROTECT), '__module__': models_module.__name__}) setattr(models_module, views_class.__name__, views_class) setattr(real_model_class, "_t2_views_class", views_class) @@ -141,26 +141,27 @@ def startup(): # Add the file model (if needed) if issubclass(model_class, GenericModelWithFiles): - file_class = type('%sFile' % (real_model_class.__name__,), (GenericFile,), {'object': models.ForeignKey(real_model_class, related_name='files', blank=True, null=True), 'file': models.FileField(upload_to='uploads/_generic/%s/' % (real_model_class.__name__,)), '__module__': models_module.__name__}) + file_class = type('%sFile' % (real_model_class.__name__,), (GenericFile,), {'object': models.ForeignKey(real_model_class, related_name='files', blank=True, null=True, on_delete=SET_NULL), 'file': models.FileField(upload_to='uploads/_generic/%s/' % (real_model_class.__name__,)), '__module__': models_module.__name__}) setattr(models_module, file_class.__name__, file_class) full_upload_path = '%s/uploads/_generic/%s/' % (settings.MEDIA_ROOT, real_model_class.__name__) if not os.path.isdir(full_upload_path): - print "[!] %s need to be a folder for file uplodad ! (And don\'t forget the gitignore)" % (full_upload_path,) + print("[!] %s need to be a folder for file uplodad ! (And don\'t forget the gitignore)" % (full_upload_path,)) else: file_class = None # Add the tag model (if needed) if issubclass(model_class, GenericTaggableObject): - tag_class = type('%sTag' % (real_model_class.__name__,), (GenericTag,), {'object': models.ForeignKey(real_model_class, related_name='tags'), '__module__': models_module.__name__}) + tag_class = type('%sTag' % (real_model_class.__name__,), (GenericTag,), {'object': models.ForeignKey(real_model_class, related_name='tags', on_delete=PROTECT), '__module__': models_module.__name__}) setattr(models_module, tag_class.__name__, tag_class) else: tag_class = None # Create the form module def generate_meta(Model): + class Meta(): model = Model exclude = ('deleted', 'status', 'accounting_year') @@ -199,43 +200,43 @@ class MetaNoUnitExternal(): setattr(views_module, '%s_mayi' % (base_views_name,), views.generate_mayi(module, base_views_name, real_model_class, logging_class)) # Add urls to views - urls_module.urlpatterns += patterns(views_module.__name__, - url(r'^%s/$' % (base_views_name,), '%s_list' % (base_views_name,)), - url(r'^%s/mayi$' % (base_views_name,), '%s_mayi' % (base_views_name,)), - url(r'^%s/json$' % (base_views_name,), '%s_list_json' % (base_views_name,)), - url(r'^%s/deleted$' % (base_views_name,), '%s_deleted' % (base_views_name,)), - url(r'^%s/logs$' % (base_views_name,), '%s_logs' % (base_views_name,)), - url(r'^%s/logs/json$' % (base_views_name,), '%s_logs_json' % (base_views_name,)), - url(r'^%s/(?P[0-9~]+)/edit$' % (base_views_name,), '%s_edit' % (base_views_name,)), - url(r'^%s/(?P[0-9,]+)/delete$' % (base_views_name,), '%s_delete' % (base_views_name,)), - url(r'^%s/(?P[0-9]+)/$' % (base_views_name,), '%s_show' % (base_views_name,)), - ) - - setattr(real_model_class, '_show_view', '%s.%s_show' % (views_module.__name__, base_views_name,)) + urls_module.urlpatterns.extend([ + re_path(r'^%s/$' % (base_views_name,), getattr(views_module, '%s_list' % (base_views_name,)), name='%s-%s_list' % (views_module.__name__.replace('.', '-') , base_views_name)), + re_path(r'^%s/mayi$' % (base_views_name,), getattr(views_module, '%s_mayi' % (base_views_name,)), name='%s-%s_mayi' % (views_module.__name__.replace('.', '-') , base_views_name)), + re_path(r'^%s/json$' % (base_views_name,), getattr(views_module, '%s_list_json' % (base_views_name,)), name='%s-%s_list_json' % (views_module.__name__.replace('.', '-') , base_views_name)), + re_path(r'^%s/deleted$' % (base_views_name,), getattr(views_module, '%s_deleted' % (base_views_name,)), name='%s-%s_deleted' % (views_module.__name__.replace('.', '-') , base_views_name)), + re_path(r'^%s/logs$' % (base_views_name,), getattr(views_module, '%s_logs' % (base_views_name,)), name='%s-%s_logs' % (views_module.__name__.replace('.', '-') , base_views_name)), + re_path(r'^%s/logs/json$' % (base_views_name,), getattr(views_module, '%s_logs_json' % (base_views_name,)), name='%s-%s_logs_json' % (views_module.__name__.replace('.', '-') , base_views_name)), + re_path(r'^%s/(?P[0-9~]+)/edit$' % (base_views_name,), getattr(views_module, '%s_edit' % (base_views_name,)), name='%s-%s_edit' % (views_module.__name__.replace('.', '-') , base_views_name)), + re_path(r'^%s/(?P[0-9,]+)/delete$' % (base_views_name,), getattr(views_module, '%s_delete' % (base_views_name,)), name='%s-%s_delete' % (views_module.__name__.replace('.', '-') , base_views_name)), + re_path(r'^%s/(?P[0-9]+)/$' % (base_views_name,), getattr(views_module, '%s_show' % (base_views_name,)), name='%s-%s_show' % (views_module.__name__.replace('.', '-') , base_views_name)), + ]) + + setattr(real_model_class, '_show_view', '%s-%s_show' % (views_module.__name__.replace('.', '-'), base_views_name,)) if issubclass(model_class, GenericStateModel): setattr(views_module, '%s_switch_status' % (base_views_name,), views.generate_switch_status(module, base_views_name, real_model_class, logging_class)) - urls_module.urlpatterns += patterns(views_module.__name__, - url(r'^%s/(?P[0-9,]+)/switch_status$' % (base_views_name,), '%s_switch_status' % (base_views_name,)), - ) + urls_module.urlpatterns.extend([ + re_path(r'^%s/(?P[0-9,]+)/switch_status$' % (base_views_name,), getattr(views_module, '%s_switch_status' % (base_views_name,)), name='%s-%s_switch_status' % (views_module.__name__.replace('.', '-') , base_views_name)) + ]) if hasattr(model_class.MetaData, 'menu_id_calendar'): setattr(views_module, '%s_calendar' % (base_views_name,), views.generate_calendar(module, base_views_name, real_model_class)) setattr(views_module, '%s_calendar_json' % (base_views_name,), views.generate_calendar_json(module, base_views_name, real_model_class)) - urls_module.urlpatterns += patterns(views_module.__name__, - url(r'^%s/calendar/$' % (base_views_name,), '%s_calendar' % (base_views_name,)), - url(r'^%s/calendar/json$' % (base_views_name,), '%s_calendar_json' % (base_views_name,)), - ) + urls_module.urlpatterns.extend([ + re_path(r'^%s/calendar/$' % (base_views_name,), getattr(views_module, '%s_calendar' % (base_views_name,)), name='%s-%s_calendar' % (views_module.__name__.replace('.', '-') , base_views_name)), + re_path(r'^%s/calendar/json$' % (base_views_name,), getattr(views_module, '%s_calendar_json' % (base_views_name,)), name='%s-%s_calendar_json' % (views_module.__name__.replace('.', '-') , base_views_name)), + ]) if hasattr(model_class.MetaData, 'menu_id_calendar_related'): setattr(views_module, '%s_calendar_related' % (base_views_name,), views.generate_calendar_related(module, base_views_name, real_model_class)) setattr(views_module, '%s_calendar_related_json' % (base_views_name,), views.generate_calendar_related_json(module, base_views_name, real_model_class)) - urls_module.urlpatterns += patterns(views_module.__name__, - url(r'^%s/related/calendar/$' % (base_views_name,), '%s_calendar_related' % (base_views_name,)), - url(r'^%s/related/calendar/json$' % (base_views_name,), '%s_calendar_related_json' % (base_views_name,)), - ) + urls_module.urlpatterns.extend([ + re_path(r'^%s/related/calendar/$' % (base_views_name,), getattr(views_module, '%s_calendar_related' % (base_views_name,)), name='%s-%s_calendar_related' % (views_module.__name__.replace('.', '-') , base_views_name)), + re_path(r'^%s/related/calendar/json$' % (base_views_name,), getattr(views_module, '%s_calendar_related_json' % (base_views_name,)), name='%s-%s_calendar_related_json' % (views_module.__name__.replace('.', '-') , base_views_name)), + ]) if issubclass(model_class, GenericStateUnitValidable): setattr(views_module, '%s_list_related' % (base_views_name,), views.generate_list_related(module, base_views_name, real_model_class)) @@ -244,14 +245,14 @@ class MetaNoUnitExternal(): setattr(views_module, '%s_calendar_specific_json' % (base_views_name,), views.generate_calendar_specific_json(module, base_views_name, real_model_class)) setattr(views_module, '%s_directory' % (base_views_name,), views.generate_directory(module, base_views_name, real_model_class)) - urls_module.urlpatterns += patterns(views_module.__name__, - url(r'^%s/related/$' % (base_views_name,), '%s_list_related' % (base_views_name,)), - url(r'^%s/related/json$' % (base_views_name,), '%s_list_related_json' % (base_views_name,)), + urls_module.urlpatterns.extend([ + re_path(r'^%s/related/$' % (base_views_name,), getattr(views_module, '%s_list_related' % (base_views_name,)), name='%s-%s_list_related' % (views_module.__name__.replace('.', '-') , base_views_name)), + re_path(r'^%s/related/json$' % (base_views_name,), getattr(views_module, '%s_list_related_json' % (base_views_name,)), name='%s-%s_list_related_json' % (views_module.__name__.replace('.', '-') , base_views_name)), - url(r'^%s/specific/(?P[0-9~]+)/calendar/$' % (base_views_name,), '%s_calendar_specific' % (base_views_name,)), - url(r'^%s/specific/(?P[0-9~]+)/calendar/json$' % (base_views_name,), '%s_calendar_specific_json' % (base_views_name,)), - url(r'^%s/directory/$' % (base_views_name,), '%s_directory' % (base_views_name,)), - ) + re_path(r'^%s/specific/(?P[0-9~]+)/calendar/$' % (base_views_name,), getattr(views_module, '%s_calendar_specific' % (base_views_name,)), name='%s-%s_calendar_specific' % (views_module.__name__.replace('.', '-') , base_views_name)), + re_path(r'^%s/specific/(?P[0-9~]+)/calendar/json$' % (base_views_name,), getattr(views_module, '%s_calendar_specific_json' % (base_views_name,)), name='%s-%s_calendar_specific_json' % (views_module.__name__.replace('.', '-') , base_views_name)), + re_path(r'^%s/directory/$' % (base_views_name,), getattr(views_module, '%s_directory' % (base_views_name,)), name='%s-%s_directory' % (views_module.__name__.replace('.', '-') , base_views_name)), + ]) if issubclass(model_class, GenericStateValidableOrModerable) and real_model_class not in moderable_things: moderable_things.append(real_model_class) @@ -261,28 +262,28 @@ class MetaNoUnitExternal(): if issubclass(model_class, GenericContactableModel): setattr(views_module, '%s_contact' % (base_views_name,), views.generate_contact(module, base_views_name, real_model_class, logging_class)) - urls_module.urlpatterns += patterns(views_module.__name__, - url(r'^%s/(?P[0-9]+)/contact/(?P.+)$' % (base_views_name,), '%s_contact' % (base_views_name,)), - ) + urls_module.urlpatterns.extend([ + re_path(r'^%s/(?P[0-9]+)/contact/(?P.+)$' % (base_views_name,), getattr(views_module, '%s_contact' % (base_views_name,)), name='%s-%s_contact' % (views_module.__name__.replace('.', '-') , base_views_name)), + ]) if file_class: setattr(views_module, '%s_file_upload' % (base_views_name,), views.generate_file_upload(module, base_views_name, real_model_class, logging_class, file_class)) setattr(views_module, '%s_file_delete' % (base_views_name,), views.generate_file_delete(module, base_views_name, real_model_class, logging_class, file_class)) setattr(views_module, '%s_file_get' % (base_views_name,), views.generate_file_get(module, base_views_name, real_model_class, logging_class, file_class)) setattr(views_module, '%s_file_get_thumbnail' % (base_views_name,), views.generate_file_get_thumbnail(module, base_views_name, real_model_class, logging_class, file_class)) - urls_module.urlpatterns += patterns(views_module.__name__, - url(r'^%sfile/upload$' % (base_views_name,), '%s_file_upload' % (base_views_name,)), - url(r'^%sfile/(?P[0-9]+)/delete$' % (base_views_name,), '%s_file_delete' % (base_views_name,)), - url(r'^%sfile/(?P[0-9]+)/get/.*$' % (base_views_name,), '%s_file_get' % (base_views_name,)), - url(r'^%sfile/(?P[0-9]+)/thumbnail$' % (base_views_name,), '%s_file_get_thumbnail' % (base_views_name,)), - ) + urls_module.urlpatterns.extend([ + re_path(r'^%sfile/upload$' % (base_views_name,), getattr(views_module, '%s_file_upload' % (base_views_name,)), name='%s-%s_file_upload' % (views_module.__name__.replace('.', '-') , base_views_name)), + re_path(r'^%sfile/(?P[0-9]+)/delete$' % (base_views_name,), getattr(views_module, '%s_file_delete' % (base_views_name,)), name='%s-%s_file_delete' % (views_module.__name__.replace('.', '-') , base_views_name)), + re_path(r'^%sfile/(?P[0-9]+)/get/.*$' % (base_views_name,), getattr(views_module, '%s_file_get' % (base_views_name,)), name='%s-%s_file_get' % (views_module.__name__.replace('.', '-') , base_views_name)), + re_path(r'^%sfile/(?P[0-9]+)/thumbnail$' % (base_views_name,), getattr(views_module, '%s_file_get_thumbnail' % (base_views_name,)), name='%s-%s_file_get_thumbnail' % (views_module.__name__.replace('.', '-') , base_views_name)), + ]) if tag_class: setattr(views_module, '%s_tag_search' % (base_views_name,), views.generate_tag_search(module, base_views_name, real_model_class, logging_class, tag_class)) - urls_module.urlpatterns += patterns(views_module.__name__, - url(r'^%stags/search$' % (base_views_name,), '%s_tag_search' % (base_views_name,)), - ) - + urls_module.urlpatterns.extend([ + re_path(r'^%stags/search$' % (base_views_name,), getattr(views_module, '%s_tag_search' % (base_views_name,)), name='%s-%s_tag_search' % (views_module.__name__.replace('.', '-') , base_views_name)), + ]) + if issubclass(model_class, SearchableModel): if not search_indexes_module: raise(Exception("{} need a search_indexes.py, please create it in {}/".format(model_class.__name__, module.__name__))) @@ -302,10 +303,10 @@ def build_state(self): loc = getattr(self, f.name).astimezone(timezone(settings.TIME_ZONE)) retour[f.name] = loc.strftime("%Y-%m-%d %H:%M:%S") elif isinstance(f, models.ManyToManyField): - retour[f.name] = u', '.join([unicode(x) for x in getattr(self, f.name).all()]) + retour[f.name] = u', '.join([str(x) for x in getattr(self, f.name).all()]) else: - retour[f.name] = unicode(getattr(self, f.name)) + retour[f.name] = str(getattr(self, f.name)) return retour @@ -332,10 +333,10 @@ def get_full_class_name(self): def is_new(self, user): """Return true is the model has unseen updates for a user""" - + last_log = self.last_log() try: view_obj = self.views.get(who=user) - return view_obj.when <= self.last_log().when + return view_obj.when <= last_log.when if last_log is not None else True except self._t2_views_class.DoesNotExist: return True @@ -373,7 +374,7 @@ class GenericFile(models.Model): # NB: The ForgienKey AND the file field are generated dynamicaly upload_date = models.DateTimeField(auto_now_add=True) - uploader = models.ForeignKey(TruffeUser) + uploader = models.ForeignKey('users.TruffeUser', on_delete=PROTECT) def basename(self): return os.path.basename(self.file.path) @@ -399,7 +400,7 @@ class GenericStateModel(object): def do(module, models_module, model_class, cache): """Execute code at startup""" - return {'status': models.CharField(max_length=255, choices=model_class.MetaState.states.iteritems(), default=model_class.MetaState.default)} + return {'status': models.CharField(max_length=255, choices=model_class.MetaState.states.items(), default=model_class.MetaState.default)} def status_color(self): return self.MetaState.states_colors.get(self.status, 'default') @@ -427,13 +428,13 @@ def states_links_with_ids(self): current_id = 0 - for elem, __ in self.MetaState.states.iteritems(): + for elem, __ in self.MetaState.states.items(): by_ids[elem] = current_id current_id += 1 retour_links = [] - for elem, __ in self.MetaState.states.iteritems(): + for elem, __ in self.MetaState.states.items(): tmp = [] for elem_dest in self.MetaState.states_links[elem]: @@ -448,7 +449,7 @@ def states_forced_pos_x(self): retour = {} - for k, (x, _) in self.MetaState.forced_pos.iteritems(): + for k, (x, _) in self.MetaState.forced_pos.items(): retour[k] = x return retour @@ -459,7 +460,7 @@ def states_forced_pos_y(self): retour = {} - for k, (_, y) in self.MetaState.forced_pos.iteritems(): + for k, (_, y) in self.MetaState.forced_pos.items(): retour[k] = y return retour @@ -469,7 +470,7 @@ class GenericLogEntry(models.Model): when = models.DateTimeField(auto_now_add=True) extra_data = models.TextField(blank=True) - who = models.ForeignKey(TruffeUser) + who = models.ForeignKey('users.TruffeUser', on_delete=PROTECT) LOG_TYPES = ( ('imported', _(u'Importé depuis Truffe 1')), @@ -494,7 +495,7 @@ class Meta: class GenericObjectView(models.Model): when = models.DateTimeField(auto_now_add=True) - who = models.ForeignKey(TruffeUser) + who = models.ForeignKey('users.TruffeUser', on_delete=PROTECT) class Meta: abstract = True @@ -659,6 +660,7 @@ def rights_can_DELETE(self, user): return super(GenericStateValidableOrModerable, self).rights_can_EDIT(user) def switch_status_signal(self, request, old_status, dest_status): + from notifications.utils import notify_people, unotify_people s = super(GenericStateValidableOrModerable, self) @@ -696,6 +698,7 @@ def build_group_members_for_cancel(self): return people def delete_signal(self, request): + from notifications.utils import notify_people if hasattr(super(GenericStateValidableOrModerable, self), 'delete_signal'): super(GenericStateValidableOrModerable, self).delete_signal(request) @@ -797,6 +800,7 @@ def switch_status_signal(self, request, old_status, dest_status): class GenericAccountingStateModel(object): """Un système de statut générique pour les pièces comptables""" + def get_unit_signer(self): return getattr(self.logs.filter(what='state_changed', extra_data__contains='"old_code": "1_unit_validable"').order_by('-when').first(), 'who', None) @@ -979,6 +983,7 @@ def rights_can_DELETE(self, user): return super(GenericAccountingStateModel, self).rights_can_EDIT(user) def switch_status_signal(self, request, old_status, dest_status): + from notifications.utils import notify_people, unotify_people s = super(GenericAccountingStateModel, self) if hasattr(s, 'switch_status_signal'): @@ -1039,7 +1044,14 @@ def get_linked_object(self): return getattr(self, self.MetaState.unit_field.split('.')[0]) -class GenericGroupsModel(): +class GenericSerializable(object): + + @classmethod + def deconstruct(cls): + return ('%s.%s' % (cls.__module__, cls.__name__), [], {}) + + +class GenericGroupsModel(GenericSerializable): class MetaGroups(object): groups = { @@ -1072,10 +1084,10 @@ def build_group_members_for_editors(self): return retour def build_group_members_for_canedit(self): - return self.rights_peoples_in_EDIT() + return self.rights_peoples_in_EDIT() -class GenericGroupsValidableOrModerableModel(object): +class GenericGroupsValidableOrModerableModel(GenericSerializable): generic_groups_moderable = True @@ -1104,13 +1116,13 @@ class GenericGroupsValidableModel(GenericGroupsValidableOrModerableModel): generic_groups_moderable = False -class GenericContactableModel(): +class GenericContactableModel(GenericSerializable): def contactables_groups(self): return self.MetaGroups.groups -class GenericExternalUnitAllowed(): +class GenericExternalUnitAllowed(GenericSerializable): """Rend l'utilisation d'unités externes possibles""" @staticmethod @@ -1118,8 +1130,8 @@ def do(module, models_module, model_class, cache): """Execute code at startup""" return { - 'unit': models.ForeignKey(cache['units.models.Unit'], blank=True, null=True), - 'unit_blank_user': models.ForeignKey(settings.AUTH_USER_MODEL, blank=True, null=True), + 'unit': models.ForeignKey(cache['units.models.Unit'], blank=True, null=True, on_delete=SET_NULL), + 'unit_blank_user': models.ForeignKey(settings.AUTH_USER_MODEL, blank=True, null=True, on_delete=SET_NULL), 'unit_blank_name': models.CharField(_(u'Nom de l\'entité externe'), max_length=255, blank=True, null=True), } @@ -1131,7 +1143,7 @@ def get_unit_name(self): return u'%s (Externe, par %s)' % (self.unit_blank_name, self.unit_blank_user) -class GenericDelayValidableInfo(): +class GenericDelayValidableInfo(GenericSerializable): @staticmethod def do(module, models_module, model_class, cache): @@ -1149,7 +1161,7 @@ def do(module, models_module, model_class, cache): } -class GenericDelayValidable(object): +class GenericDelayValidable(GenericSerializable): def can_switch_to(self, user, dest_state): @@ -1181,7 +1193,7 @@ def can_switch_to(self, user, dest_state): return super(GenericDelayValidable, self).can_switch_to(user, dest_state) -class GenericModelWithLines(object): +class GenericModelWithLines(GenericSerializable): class MetaLines(): lines_objects = [ @@ -1198,7 +1210,7 @@ class Meta: abstract = True -class GenericTaggableObject(object): +class GenericTaggableObject(GenericSerializable): """Un object taggable. Prend en compte l'année comptable et l'unité si présent pour la découverte de tag""" pass @@ -1211,7 +1223,7 @@ class Meta: abstract = True -class LinkedInfoModel(object): +class LinkedInfoModel(GenericSerializable): def __init__(self, *args, **kwargs): @@ -1221,6 +1233,7 @@ def __init__(self, *args, **kwargs): self.MetaEdit.set_linked_info = True def linked_info(self): + from django.contrib.contenttypes.models import ContentType from accounting_tools.models import LinkedInfo object_ct = ContentType.objects.get(app_label=self._meta.app_label, model=self._meta.model_name) @@ -1302,7 +1315,7 @@ def prepare_text(self, obj): text += u"{} {}\n".format(f.file.name.split('/')[-1], txt) if obj.MetaSearch.linked_lines: - for key, fields in obj.MetaSearch.linked_lines.iteritems(): + for key, fields in obj.MetaSearch.linked_lines.items(): for line_elem in getattr(obj, key).all(): for field in fields: diff --git a/truffe2/generic/startup.py b/truffe2/generic/startup.py index a5cf3a08..c0ba331e 100644 --- a/truffe2/generic/startup.py +++ b/truffe2/generic/startup.py @@ -1,5 +1,5 @@ -from generic.models import GenericModel, GenericStateModel +from generic.models import GenericModel def startup(): diff --git a/truffe2/generic/templates/generic/generic/edit.html b/truffe2/generic/templates/generic/generic/edit.html index 237ff79c..80227687 100644 --- a/truffe2/generic/templates/generic/generic/edit.html +++ b/truffe2/generic/templates/generic/generic/edit.html @@ -395,7 +395,7 @@

    {{Model.MetaEdit.files_title}}

    $('#id_unit_blank_name').parent().append(""); $('#id_unit_blank_name').on('change', function (elem) { - $.ajax('{% url 'generic.views.check_unit_name' %}?name=' + escape($('#id_unit_blank_name').val()), {dataType: 'json'}).success(function (data) { + $.ajax('{% url 'generic-views-check_unit_name' %}?name=' + escape($('#id_unit_blank_name').val()), {dataType: 'json'}).success(function (data) { if (data['result'] == 'ok') { $('#id_unit_blank_name_warning').hide(); } else { @@ -410,7 +410,7 @@

    {{Model.MetaEdit.files_title}}

    bonus = '?_{% if unit_mode %}&upk=' + $('#input_upk').val() + '{% endif %}{% if year_mode %}&ypk=' + $('#input_ypk').val() + '{% endif %}'; - $.ajax('{% url 'accounting_core.views.costcenter_available_list' %}' + bonus).success(function (data) { + $.ajax('{% url 'accounting_core-views-costcenter_available_list' %}' + bonus).success(function (data) { var old_value = $('#id_costcenter').val(); @@ -437,7 +437,7 @@

    {{Model.MetaEdit.files_title}}

    function switch_to_tva_field(field) { field.css('width', '100%').css('min-width', '100px').addClass('select2').removeClass('form-control').select2({ ajax: { - url: '{% url 'accounting_core.views.tva_available_list' %}', + url: '{% url 'accounting_core-views-tva_available_list' %}', dataType: "json", data: function(term, page) { return { @@ -452,7 +452,7 @@

    {{Model.MetaEdit.files_title}}

    }, initSelection: function (element, callback) { - $.ajax('{% url 'accounting_core.views.tva_available_list' %}?init=' + $(element).val()).success(function (data) { + $.ajax('{% url 'accounting_core-views-tva_available_list' %}?init=' + $(element).val()).success(function (data) { callback(data[0]); }); }, diff --git a/truffe2/generic/templates/generic/generic/show.html b/truffe2/generic/templates/generic/generic/show.html index 81240eaa..77edb163 100644 --- a/truffe2/generic/templates/generic/generic/show.html +++ b/truffe2/generic/templates/generic/generic/show.html @@ -154,13 +154,13 @@

    {% trans "Tags" %}

    - {% for field, value in log_entry.json_extra_data.added.iteritems %} + {% for field, value in log_entry.json_extra_data.added.items %} {{field}} {{value|html_check_and_safe|truncatewords_html:500|force_escape}} {% endfor %} - {% for field, value in log_entry.json_extra_data.edited.iteritems %} + {% for field, value in log_entry.json_extra_data.edited.items %} {{field}}{{value.0|html_check_and_safe|truncatewords_html:500|force_escape}}{{value.1|html_check_and_safe|truncatewords_html:500|force_escape}} {% endfor %} - {% for field, value in log_entry.json_extra_data.deleted.iteritems %} + {% for field, value in log_entry.json_extra_data.deleted.items %} {{field}}{{value|html_check_and_safe|truncatewords_html:500|force_escape}}  {% endfor %} @@ -241,7 +241,7 @@

    {% trans "Tags" %}

    diff --git a/truffe2/generic/templates/generic/generic/show_state_switcher.html b/truffe2/generic/templates/generic/generic/show_state_switcher.html index 4f5ab136..4a73226e 100644 --- a/truffe2/generic/templates/generic/generic/show_state_switcher.html +++ b/truffe2/generic/templates/generic/generic/show_state_switcher.html @@ -5,7 +5,7 @@ {% trans "Modifier" %}