You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
1.7 KiB
Python
84 lines
1.7 KiB
Python
#!/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 Institution(Model):
|
|
id_institution = IntegerField(primary_key=True)
|
|
full_label = TextField()
|
|
inst_label = TextField()
|
|
art_inst = TextField()
|
|
inst_place = TextField()
|
|
inst_rank = TextField()
|
|
inst_type = TextField()
|
|
|
|
class Meta:
|
|
database = db
|
|
db_table = 'Institution'
|
|
|
|
|
|
class State(Model):
|
|
id_state = IntegerField(primary_key=True)
|
|
state_label = TextField()
|
|
|
|
class Meta:
|
|
database = db
|
|
db_table = 'State'
|
|
|
|
|
|
class Production_place(Model):
|
|
id_place = IntegerField(primary_key=True)
|
|
placename = TextField()
|
|
|
|
class Meta:
|
|
database = db
|
|
db_table = 'Production_place'
|
|
|
|
|
|
class Diplo_type(Model):
|
|
id_diplo_type = IntegerField(primary_key=True)
|
|
diplo_label = TextField()
|
|
|
|
class Meta:
|
|
database = db
|
|
db_table = 'Diplo_type'
|
|
|
|
|
|
class Document(Model):
|
|
id_document = IntegerField(primary_key=True)
|
|
inst_doc = ForeignKeyField(Institution, backref='document')
|
|
collection_doc = TextField()
|
|
|
|
class Meta:
|
|
database = db
|
|
db_table = 'Document'
|
|
|
|
|
|
class Acte(Model):
|
|
id_acte = IntegerField(primary_key=True)
|
|
numb_acte = TextField()
|
|
date_time = TextField() # YYYY-MM-DD
|
|
date = TextField() # verbose
|
|
analysis = TextField()
|
|
doc_acte = ForeignKeyField(Document, backref='acte')
|
|
ref_acte = TextField() # cote
|
|
state_doc = ForeignKeyField(State, backref='acte')
|
|
diplo_type_acte = ForeignKeyField(Diplo_type, backref='acte')
|
|
|
|
class Meta:
|
|
database = db
|
|
db_table = 'Acte'
|