|
|
|
|
#!/usr/bin/python
|
|
|
|
|
# -*- coding: UTF-8 -*-
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
Authors : Jean-Damien Généro
|
|
|
|
|
Affiliation : French National Center for Scientific Research (CNRS)
|
|
|
|
|
Assigned at the Centre de recherches historiques (CRH, UMR 8558)
|
|
|
|
|
Date : 2022-10-11
|
|
|
|
|
Update :
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from peewee import *
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
db = SqliteDatabase('actes_princiers.db')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Archives(Model):
|
|
|
|
|
id_archives = IntegerField(primary_key=True)
|
|
|
|
|
archives_name = TextField()
|
|
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
|
database = db
|
|
|
|
|
db_table = 'Archives'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class State(Model):
|
|
|
|
|
id_state = IntegerField(primary_key=True)
|
|
|
|
|
state_label = TextField()
|
|
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
|
database = db
|
|
|
|
|
db_table = 'State'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Place(Model):
|
|
|
|
|
id_place = IntegerField(primary_key=True)
|
|
|
|
|
placename = TextField()
|
|
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
|
database = db
|
|
|
|
|
db_table = 'Place'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Diplo_type(Model):
|
|
|
|
|
id_diplo_type = IntegerField(primary_key=True)
|
|
|
|
|
diplomatic_label = TextField()
|
|
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
|
database = db
|
|
|
|
|
db_table = 'Diplo_type'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Document(Model):
|
|
|
|
|
id_document = IntegerField(primary_key=True)
|
|
|
|
|
doc_reference = TextField()
|
|
|
|
|
archives_doc = ForeignKeyField(Archives, backref='document')
|
|
|
|
|
state_doc = ForeignKeyField(State, backref='document')
|
|
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
|
database = db
|
|
|
|
|
db_table = 'Document'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Acte(Model):
|
|
|
|
|
id_acte = IntegerField(primary_key=True)
|
|
|
|
|
date = TextField()
|
|
|
|
|
analysis = TextField()
|
|
|
|
|
doc_acte = ForeignKeyField(Document, backref='acte')
|
|
|
|
|
diplo_type_acte = ForeignKeyField(Diplo_type, backref='acte')
|
|
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
|
database = db
|
|
|
|
|
db_table = 'Acte'
|