summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--ishtar/.gitignore1
-rw-r--r--ishtar/__init__.py0
-rwxr-xr-xishtar/manage.py11
-rw-r--r--ishtar/materials/__init__.py0
-rw-r--r--ishtar/materials/models.py416
-rw-r--r--ishtar/materials/tests.py23
-rw-r--r--ishtar/materials/views.py1
-rw-r--r--ishtar/settings.py.example98
-rw-r--r--ishtar/urls.py16
-rw-r--r--media/images/logo.icobin0 -> 766 bytes
-rw-r--r--media/images/logo.pngbin0 -> 6198 bytes
12 files changed, 569 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000..be8613636
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+*.swp
+*.pyc
+*.mo
diff --git a/ishtar/.gitignore b/ishtar/.gitignore
new file mode 100644
index 000000000..fce19e421
--- /dev/null
+++ b/ishtar/.gitignore
@@ -0,0 +1 @@
+settings.py
diff --git a/ishtar/__init__.py b/ishtar/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/ishtar/__init__.py
diff --git a/ishtar/manage.py b/ishtar/manage.py
new file mode 100755
index 000000000..bcdd55e27
--- /dev/null
+++ b/ishtar/manage.py
@@ -0,0 +1,11 @@
+#!/usr/bin/python
+from django.core.management import execute_manager
+try:
+ import settings # Assumed to be in the same directory.
+except ImportError:
+ import sys
+ sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
+ sys.exit(1)
+
+if __name__ == "__main__":
+ execute_manager(settings)
diff --git a/ishtar/materials/__init__.py b/ishtar/materials/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/ishtar/materials/__init__.py
diff --git a/ishtar/materials/models.py b/ishtar/materials/models.py
new file mode 100644
index 000000000..1b791eb8b
--- /dev/null
+++ b/ishtar/materials/models.py
@@ -0,0 +1,416 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# Copyright (C) 2010 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet>
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# See the file COPYING for details.
+
+"""
+Models description
+"""
+
+from django.utils.translation import ugettext_lazy as _
+
+from django.contrib.gis.db import models
+from django.contrib import admin
+
+from ishtar import settings
+
+
+
+class PersonType(models.Model):
+ label = models.CharField(_(u"Label"), max_length=30)
+ comment = models.TextField(_(u"Comment"))
+
+ def __unicode__(self):
+ return self.label
+
+class Person(models.Model) :
+ TYPE = (('Mr', _(u'Mr')),
+ ('Ms', _(u'Miss')),
+ ('Md', _(u'Mrs')),
+ ('Dr', _(u'Doctor')),
+ )
+ title = models.CharField(_(u"Title"), max_length=1, choices=TYPE)
+ surname = models.CharField(_(u"Surname"), max_length=20)
+ name = models.CharField(_(u"Name"), max_length=30)
+ address = models.TextField(_(u"Address"))
+ address_complement = models.TextField(_(u"Address complement"))
+ postal_code = models.CharField(_(u"Postal code"), max_length=10)
+ town = models.CharField(_(u"Town"), max_length=30)
+ country = models.CharField(_(u"Country"), max_length=30)
+ phone = models.CharField(_(u"Phone"), max_length=18)
+ mobile_phone = models.CharField(_(u"Mobile phone"), max_length=18)
+ email = models.CharField(_(u"Email"), max_length=40)
+ person_type = models.ForeignKey(PersonType, verbose_name=_(u"Type"))
+ attached_to = models.ForeignKey('Person', verbose_name=_(u"Is attached to"))
+ author = models.BooleanField(_(u"Author"))
+ in_charge_storage = models.BooleanField(_(u"In charge of a storage"))
+
+ def __unicode__(self):
+ return u"%s %s" % (self.name, self.surname)
+
+
+class FileType(models.Model):
+ label = models.CharField(_(u"Label"), max_length=30)
+ comment = models.TextField(_(u"Comment"))
+
+ def __unicode__(self):
+ return self.label
+
+
+class File(models.Model) :
+ year = models.IntegerField(_(u"Year"))
+ number = models.IntegerField(_(u"Number"))
+ active = models.BooleanField(_(u"Active"))
+ reception_date = models.DateField(_(u'Reception date'))
+ creation_date = models.DateField(_(u"Creation date"))
+ modification_date = models.DateField(_(u"Modification date"))
+ folder_type = models.ForeignKey(FileType, verbose_name=_(u"File type"))
+ creation_person = models.ForeignKey(Person,
+ verbose_name=(u"Creation person"))
+ AMENAGEUR_ID_ID_PERSONNE = models.IntegerField()
+ if settings.COUNTRY == 'fr':
+ ar_date = models.DateField(u"Date d'envoi du courrier \
+avec accusé réception")
+ ar_signed_by = models.ForeignKey(Person, verbose_name=u"Signature de \
+l'accusé de réception par")
+
+ def __unicode__(self):
+ return u""
+
+class HistoryFile(models.Model):
+ person = models.ForeignKey('Person', verbose_name=_(u"Person"))
+ modif_date = models.DateField(_(u'Modification date'))
+ folder = models.ForeignKey(File, u"File")
+
+ def __unicode__(self):
+ return self.person + " - " + self.modif_date
+
+class Operation(models.Model):
+ start_date = models.DateField(_(u"Start date"))
+ end_date = models.DateField(_(u"End date"))
+ name = models.CharField(_(u"Name"))
+ in_charge = models.ForeignKey('Person', verbose_name=_(u"In charge"))
+ CODE_OPERATION = models.CharField('VIDE'::character varying)
+ DOSSIER = models.CharField('VIDE'::character varying)
+ TYPE = models.IntegerField('VIDE'::character varying)
+ if settings.COUNTRY == 'fr':
+ code_patriarche = models.IntegerField(u"Code PATRIARCHE")
+ code_pat = models.CharField(u"Code PAT", max_length=10)
+ code_dracar = models.CharField(u"Code DRACAR", max_length=10)
+
+ def __unicode__(self):
+ return self.name
+
+
+class Parcel(models.Model) :
+ operation = models.ForeignKey(Operation, verbose_name=_(u"Operation"))
+ SECTION = models.CharField()
+ NUM_PARCELLE = models.CharField()
+
+ def __unicode__(self):
+ return u""
+
+
+class UA(models.Model):
+ parcel = models.ForeignKey(Parcel, verbose_name=_(u"Parcel"))
+ OPERATION_ID_OPERATION = models.IntegerField()
+ LABEL = models.CharField()
+ DESCRO_UA = models.CharField()
+ LONGUEUR = models.IntegerField()
+ LARGEUR = models.IntegerField()
+ EPAISSEUR = models.IntegerField()
+ PRESENCE_MOB = models.IntegerField()
+ INTERPRETATION = models.CharField()
+ PROFONDEUR = models.IntegerField()
+ REMPLISSAGE = models.CharField()
+
+ def __unicode__(self):
+ return u""
+
+
+class DOC_ITEM(models.Model) :
+ SOURCES_ID_SOURCE = models.IntegerField('0'::character(1))
+ ITEM_ID_ITEM = models.IntegerField('0'::character(1))
+
+ def __unicode__(self):
+ return u""
+
+
+class UA_DATATION(models.Model) :
+ ID_UA_DATATION = models.IntegerField()
+ UA_ID_UA = models.IntegerField()
+ DATATION_ID_DATATION = models.IntegerField()
+ QUALITE = models.CharField()
+
+ def __unicode__(self):
+ return u""
+
+
+
+class ITEM(models.Model) :
+ ID_ITEM = models.IntegerField()
+ UA_ID_UA = models.IntegerField()
+ DESCRO_ITEM = models.CharField()
+ TYPO_MATERIAU_ID_TYPO_MATERIAU = models.IntegerField()
+ DATATION_DEB = models.IntegerField()
+ DATATION_FIN = models.IntegerField()
+ ISOLATION = models.IntegerField()
+ VOLUME_ITEM = models.FloatField()
+ POIDS_ITEM = models.IntegerField()
+ LABEL_ITEM = models.CharField()
+ NB_ITEM = models.IntegerField()
+
+ def __unicode__(self):
+ return u""
+
+
+class CHRONO(models.Model) :
+ ID_CHRONO = models.IntegerField()
+ ORDRE = models.IntegerField()
+ LABEL = models.CharField()
+ ANNEE_DEBUT = models.IntegerField()
+ ANNEE_FIN = models.IntegerField()
+
+ def __unicode__(self):
+ return u""
+
+
+class USERS(models.Model) :
+ ID_USERS = models.IntegerField()
+ LOGIN = models.CharField()
+ PASS = models.CharField()
+ MULTIPASS = models.IntegerField()
+ PERSONNE_ID_PERSONNE = models.IntegerField()
+
+ def __unicode__(self):
+ return u""
+
+
+class PROP_FONC(models.Model) :
+ ID_PROP_FONC = models.IntegerField()
+ PERSONNE_ID_PERSONNE = models.IntegerField()
+ PARCELLE_ID_PARCELLE = models.IntegerField()
+ DATE_DEBUT = models.DateField()
+ DATE_FIN = models.DateField()
+
+ def __unicode__(self):
+ return u""
+
+
+class OPE_DEPT(models.Model) :
+ ID_OPE_DEPT = models.IntegerField()
+ OPERATION_ID_OPERATION = models.IntegerField()
+ DEPT_ID_DEPT = models.IntegerField()
+
+ def __unicode__(self):
+ return u""
+
+
+class LIEU(models.Model) :
+ ID_LIEU = models.IntegerField()
+ ADRESSE_ID_PERSONNE = models.IntegerField()
+ TYPE_DEPOT_ID_TYPE_DEPOT = models.IntegerField()
+ COMMENTAIRE = models.CharField()
+ RESP_ID_PERSONNE = models.IntegerField()
+
+ def __unicode__(self):
+ return u""
+
+
+
+class TYPE_ACTE(models.Model) :
+ ID_TYPE_ACTE = models.IntegerField()
+ TYPE = models.CharField()
+
+ def __unicode__(self):
+ return u""
+
+
+
+class ACTE_ADMIN(models.Model) :
+ ID_ACTE = models.IntegerField()
+ OPERATION_ID_OPERATION = models.IntegerField()
+ REF_SRA = models.CharField()
+ DATE_SIGNATURE = models.DateField()
+ OBJET = models.CharField()
+ TYPE_ACTE = models.CharField()
+ PERSONNE_ID_PERSONNE = models.IntegerField()
+
+ def __unicode__(self):
+ return u""
+
+
+
+class TYPE_CONT(models.Model) :
+ ID_TYPE_CONT = models.IntegerField()
+ LABEL_CONT = models.CharField()
+ LONG_CONT = models.IntegerField()
+ LARG_CONT = models.IntegerField()
+ HAUTEUR_CONT = models.IntegerField()
+ REF_CONT = models.CharField()
+ VOLUME_CONT = models.IntegerField()
+
+ def __unicode__(self):
+ return u""
+
+
+class DEPT(models.Model) :
+ ID_DEPT = models.IntegerField()
+ NOM_DEPT = models.CharField()
+ NUM_DEPT = models.CharField('0'::character(1))
+
+ def __unicode__(self):
+ return u""
+
+
+class TYPE_OPE(models.Model) :
+ ID_TYPE_OPE = models.IntegerField()
+ TYPE = models.CharField()
+
+ def __unicode__(self):
+ return u""
+
+
+class COMMUNES(models.Model) :
+ ID_COMMUNES = models.IntegerField()
+ DEPT_ID_DEPT = models.IntegerField()
+ NUM_INSEE = models.CharField()
+ NOM = models.CharField()
+ ARRDT = models.CharField()
+ CANTON = models.CharField()
+ X_CENTR = models.IntegerField()
+ Y_CENTR = models.IntegerField()
+ SUPERFICIE = models.IntegerField()
+
+ def __unicode__(self):
+ return u""
+
+
+class SOURCES(models.Model) :
+ ID_SOURCE = models.IntegerField()
+ TITRE = models.CharField()
+ TYPE = models.CharField()
+
+ def __unicode__(self):
+ return u""
+
+
+class TYPE_DEPOT(models.Model) :
+ ID_TYPE_DEPOT = models.IntegerField()
+ LABEL_TYPE = models.CharField()
+
+ def __unicode__(self):
+ return u""
+
+
+class RESPONSABILITE(models.Model) :
+ TRAITEMENT_ID_TRAITEMENT = models.IntegerField()
+ LIEU_ID_LIEU = models.IntegerField()
+ PERSONNE_ID_PERSONNE = models.IntegerField()
+ DATE_DEBUT = models.DateField()
+ DATE_FIN = models.DateField()
+
+ def __unicode__(self):
+ return u""
+
+
+class OPE_COM(models.Model) :
+ ID_OPE_COM = models.IntegerField()
+ OPERATION_ID_OPERATION = models.IntegerField()
+ COMMUNES_ID_COMMUNES = models.IntegerField()
+
+ def __unicode__(self):
+ return u""
+
+
+class RE_ENREG(models.Model) :
+ TRAITEMENT_ID_TRAITEMENT = models.IntegerField()
+ ITEM_ID_ITEM = models.IntegerField()
+
+ def __unicode__(self):
+ return u""
+
+
+class TRAITEMENT(models.Model) :
+ ID_TRAITEMENT = models.IntegerField()
+ CONT_ID_CONT = models.IntegerField()
+ ITEM_ID_ITEM = models.IntegerField()
+
+ def __unicode__(self):
+ return u""
+
+
+class DOSSIER_COM(models.Model) :
+ ID_DOSSIER_COM = models.IntegerField()
+ DOSSIER_ID_DOSSIER = models.IntegerField()
+ COMMUNES_ID_COMMUNES = models.IntegerField()
+
+ def __unicode__(self):
+ return u""
+
+
+class AUTEUR(models.Model) :
+ ID_AUTEUR = models.IntegerField()
+ PERSONNE_ID_PERSONNE = models.IntegerField()
+ SOURCES_ID_SOURCE = models.IntegerField()
+ TYPE = models.CharField()
+
+ def __unicode__(self):
+ return u""
+
+
+class TYPO_MATERIAU(models.Model) :
+ ID_TYPO_MATERIAU = models.IntegerField()
+ LABEL = models.CharField()
+ RECOMMANDATION = models.CharField()
+
+ def __unicode__(self):
+ return u""
+
+
+class PROPRIETE(models.Model) :
+ ITEM_ID_ITEM = models.IntegerField('0'::character varying)
+ ACTE_ADMIN_ID_ACTE = models.IntegerField('0'::character varying)
+ PERSONNE_ID_PERSONNE = models.IntegerField('0'::character varying)
+ DATE_DEBUT = models.DateField('0'::character varying)
+ DATE_FIN = models.DateField('0'::character varying)
+
+ def __unicode__(self):
+ return u""
+
+
+class ITEM_DATATION(models.Model) :
+ ID_ITEM_DATATION = models.IntegerField()
+ ITEM_ID_ITEM = models.IntegerField()
+ DATATION_ID_DATATION = models.IntegerField()
+ QUALITE = models.CharField()
+
+ def __unicode__(self):
+ return u""
+
+
+
+
+class DEPOT_COMMUNES(models.Model) :
+ ID_DEPOT_COMMUNE = models.IntegerField()
+ LIEU_ID_LIEU = models.IntegerField()
+ COMMUNES_ID_COMMUNES = models.IntegerField()
+
+ def __unicode__(self):
+ return u""
+
+
diff --git a/ishtar/materials/tests.py b/ishtar/materials/tests.py
new file mode 100644
index 000000000..2247054b3
--- /dev/null
+++ b/ishtar/materials/tests.py
@@ -0,0 +1,23 @@
+"""
+This file demonstrates two different styles of tests (one doctest and one
+unittest). These will both pass when you run "manage.py test".
+
+Replace these with more appropriate tests for your application.
+"""
+
+from django.test import TestCase
+
+class SimpleTest(TestCase):
+ def test_basic_addition(self):
+ """
+ Tests that 1 + 1 always equals 2.
+ """
+ self.failUnlessEqual(1 + 1, 2)
+
+__test__ = {"doctest": """
+Another way to test that 1 + 1 is equal to 2.
+
+>>> 1 + 1 == 2
+True
+"""}
+
diff --git a/ishtar/materials/views.py b/ishtar/materials/views.py
new file mode 100644
index 000000000..60f00ef0e
--- /dev/null
+++ b/ishtar/materials/views.py
@@ -0,0 +1 @@
+# Create your views here.
diff --git a/ishtar/settings.py.example b/ishtar/settings.py.example
new file mode 100644
index 000000000..259a9f82d
--- /dev/null
+++ b/ishtar/settings.py.example
@@ -0,0 +1,98 @@
+# Django settings for ishtar project.
+
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+ADMINS = (
+ # ('Your Name', 'your_email@domain.com'),
+)
+
+MANAGERS = ADMINS
+
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+ 'NAME': '', # Or path to database file if using sqlite3.
+ 'USER': '', # Not used with sqlite3.
+ 'PASSWORD': '', # Not used with sqlite3.
+ 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
+ 'PORT': '', # Set to empty string for default. Not used with sqlite3.
+ }
+}
+
+# Local time zone for this installation. Choices can be found here:
+# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
+# although not all choices may be available on all operating systems.
+# On Unix systems, a value of None will cause Django to use the same
+# timezone as the operating system.
+# If running in a Windows environment this must be set to the same as your
+# system time zone.
+TIME_ZONE = 'Europe/Paris'
+
+# Language code for this installation. All choices can be found here:
+# http://www.i18nguy.com/unicode/language-identifiers.html
+LANGUAGE_CODE = 'fr-fr'
+
+COUNTRY = "fr"
+
+SITE_ID = 1
+
+# If you set this to False, Django will make some optimizations so as not
+# to load the internationalization machinery.
+USE_I18N = True
+
+# If you set this to False, Django will not format dates, numbers and
+# calendars according to the current locale
+USE_L10N = True
+
+# Absolute path to the directory that holds media.
+# Example: "/home/media/media.lawrence.com/"
+MEDIA_ROOT = ''
+
+# URL that handles the media served from MEDIA_ROOT. Make sure to use a
+# trailing slash if there is a path component (optional in other cases).
+# Examples: "http://media.lawrence.com", "http://example.com/media/"
+MEDIA_URL = ''
+
+# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
+# trailing slash.
+# Examples: "http://foo.com/media/", "/media/".
+ADMIN_MEDIA_PREFIX = '/media/'
+
+# Make this unique, and don't share it with anybody.
+SECRET_KEY = '29jy!n#_!j*1h%m&9=0+&!my*ycctvs(-uodr0i*35ht(_8+s('
+
+# 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',
+)
+
+MIDDLEWARE_CLASSES = (
+ 'django.middleware.common.CommonMiddleware',
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.middleware.csrf.CsrfViewMiddleware',
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.contrib.messages.middleware.MessageMiddleware',
+)
+
+ROOT_URLCONF = 'ishtar.urls'
+
+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.
+)
+
+INSTALLED_APPS = (
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
+ 'django.contrib.sites',
+ 'django.contrib.messages',
+ # Uncomment the next line to enable the admin:
+ # 'django.contrib.admin',
+ # Uncomment the next line to enable admin documentation:
+ # 'django.contrib.admindocs',
+)
diff --git a/ishtar/urls.py b/ishtar/urls.py
new file mode 100644
index 000000000..fc201b063
--- /dev/null
+++ b/ishtar/urls.py
@@ -0,0 +1,16 @@
+from django.conf.urls.defaults import *
+
+# Uncomment the next two lines to enable the admin:
+# from django.contrib import admin
+# admin.autodiscover()
+
+urlpatterns = patterns('',
+ # Example:
+ # (r'^ishtar/', include('ishtar.foo.urls')),
+
+ # Uncomment the admin/doc line below to enable admin documentation:
+ # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
+
+ # Uncomment the next line to enable the admin:
+ # (r'^admin/', include(admin.site.urls)),
+)
diff --git a/media/images/logo.ico b/media/images/logo.ico
new file mode 100644
index 000000000..c6417a32e
--- /dev/null
+++ b/media/images/logo.ico
Binary files differ
diff --git a/media/images/logo.png b/media/images/logo.png
new file mode 100644
index 000000000..e150baa6c
--- /dev/null
+++ b/media/images/logo.png
Binary files differ