diff --git a/app/__init__.py b/test/demo_flask/__init__.py similarity index 100% rename from app/__init__.py rename to test/demo_flask/__init__.py diff --git a/app/config.py b/test/demo_flask/config.py similarity index 100% rename from app/config.py rename to test/demo_flask/config.py diff --git a/test/demo_flask/models.py b/test/demo_flask/models.py new file mode 100644 index 0000000000000000000000000000000000000000..d51e7595abcf58572e82bf298955ce1676b37f9a --- /dev/null +++ b/test/demo_flask/models.py @@ -0,0 +1,42 @@ +from flask import Flask +from flask_sqlalchemy import SQLAlchemy + +app = Flask(__name__) +app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///test.db' +db = SQLAlchemy(app) + + +element_label = db.Table('Element_Label', db.Model.metadata, + db.Column('id_element', db.Integer, db.ForeignKey('element.id')), + db.Column('id_label', db.Integer, db.ForeignKey('label.id')) + ) + +class Element(db.Model): + id = db.Column(db.INTEGER, primary_key=True) + element_name = db.Column(db.String(50), unique=True, nullable=False) + labels = db.relationship( + "Label", + secondary=element_label, + back_populates="elements") + +class Label(db.Model): + id = db.Column(db.INTEGER, primary_key=True) + label_name = db.Column(db.String(50), unique=True, nullable=False) + father_id = db.Column(db.INTEGER, db.ForeignKey('label.id')) + children = db.relationship("Label", + backref=db.backref('parent', remote_side=[id]) + ) + aliases = db.relationship('Alias', back_populates='label') + elements = db.relationship( + "Element", + secondary=element_label, + back_populates="labels") + +class Alias(db.Model): + alias_name = db.Column(db.String(100), primary_key=True) + id_label = db.Column(db.INTEGER, db.ForeignKey('label.id'), nullable=False) + label = db.relationship('Label', back_populates='aliases') + + + + diff --git a/app/static/categories.txt b/test/demo_flask/static/categories.txt similarity index 100% rename from app/static/categories.txt rename to test/demo_flask/static/categories.txt diff --git a/app/static/css/bootstrap.css b/test/demo_flask/static/css/bootstrap.css similarity index 100% rename from app/static/css/bootstrap.css rename to test/demo_flask/static/css/bootstrap.css diff --git a/app/static/css/bootstrap_1.css b/test/demo_flask/static/css/bootstrap_1.css similarity index 100% rename from app/static/css/bootstrap_1.css rename to test/demo_flask/static/css/bootstrap_1.css diff --git a/app/static/css/hierarchy.css b/test/demo_flask/static/css/hierarchy.css similarity index 100% rename from app/static/css/hierarchy.css rename to test/demo_flask/static/css/hierarchy.css diff --git a/app/static/css/main.css b/test/demo_flask/static/css/main.css similarity index 100% rename from app/static/css/main.css rename to test/demo_flask/static/css/main.css diff --git a/app/static/css/result.css b/test/demo_flask/static/css/result.css similarity index 100% rename from app/static/css/result.css rename to test/demo_flask/static/css/result.css diff --git a/app/static/fonts/glyphicons-halflings-regular.eot b/test/demo_flask/static/fonts/glyphicons-halflings-regular.eot similarity index 100% rename from app/static/fonts/glyphicons-halflings-regular.eot rename to test/demo_flask/static/fonts/glyphicons-halflings-regular.eot diff --git a/app/static/fonts/glyphicons-halflings-regular.svg b/test/demo_flask/static/fonts/glyphicons-halflings-regular.svg similarity index 100% rename from app/static/fonts/glyphicons-halflings-regular.svg rename to test/demo_flask/static/fonts/glyphicons-halflings-regular.svg diff --git a/app/static/fonts/glyphicons-halflings-regular.ttf b/test/demo_flask/static/fonts/glyphicons-halflings-regular.ttf similarity index 100% rename from app/static/fonts/glyphicons-halflings-regular.ttf rename to test/demo_flask/static/fonts/glyphicons-halflings-regular.ttf diff --git a/app/static/fonts/glyphicons-halflings-regular.woff b/test/demo_flask/static/fonts/glyphicons-halflings-regular.woff similarity index 100% rename from app/static/fonts/glyphicons-halflings-regular.woff rename to test/demo_flask/static/fonts/glyphicons-halflings-regular.woff diff --git a/app/static/fonts/glyphicons-halflings-regular.woff2 b/test/demo_flask/static/fonts/glyphicons-halflings-regular.woff2 similarity index 100% rename from app/static/fonts/glyphicons-halflings-regular.woff2 rename to test/demo_flask/static/fonts/glyphicons-halflings-regular.woff2 diff --git a/app/static/img/background_loop.png b/test/demo_flask/static/img/background_loop.png similarity index 100% rename from app/static/img/background_loop.png rename to test/demo_flask/static/img/background_loop.png diff --git a/app/static/img/moins-encadre-rouge.png b/test/demo_flask/static/img/moins-encadre-rouge.png similarity index 100% rename from app/static/img/moins-encadre-rouge.png rename to test/demo_flask/static/img/moins-encadre-rouge.png diff --git a/app/static/img/moins-encadre.png b/test/demo_flask/static/img/moins-encadre.png similarity index 100% rename from app/static/img/moins-encadre.png rename to test/demo_flask/static/img/moins-encadre.png diff --git a/app/static/img/moins-rouge.png b/test/demo_flask/static/img/moins-rouge.png similarity index 100% rename from app/static/img/moins-rouge.png rename to test/demo_flask/static/img/moins-rouge.png diff --git a/app/static/img/moins.png b/test/demo_flask/static/img/moins.png similarity index 100% rename from app/static/img/moins.png rename to test/demo_flask/static/img/moins.png diff --git a/app/static/img/monSeparateur.png b/test/demo_flask/static/img/monSeparateur.png similarity index 100% rename from app/static/img/monSeparateur.png rename to test/demo_flask/static/img/monSeparateur.png diff --git a/app/static/img/plus-encadre-vert.png b/test/demo_flask/static/img/plus-encadre-vert.png similarity index 100% rename from app/static/img/plus-encadre-vert.png rename to test/demo_flask/static/img/plus-encadre-vert.png diff --git a/app/static/img/plus-encadre.png b/test/demo_flask/static/img/plus-encadre.png similarity index 100% rename from app/static/img/plus-encadre.png rename to test/demo_flask/static/img/plus-encadre.png diff --git a/app/static/img/plus-vert.png b/test/demo_flask/static/img/plus-vert.png similarity index 100% rename from app/static/img/plus-vert.png rename to test/demo_flask/static/img/plus-vert.png diff --git a/app/static/img/plus.png b/test/demo_flask/static/img/plus.png similarity index 100% rename from app/static/img/plus.png rename to test/demo_flask/static/img/plus.png diff --git a/app/static/js/ajax.js b/test/demo_flask/static/js/ajax.js similarity index 100% rename from app/static/js/ajax.js rename to test/demo_flask/static/js/ajax.js diff --git a/app/static/js/cookies.js b/test/demo_flask/static/js/cookies.js similarity index 100% rename from app/static/js/cookies.js rename to test/demo_flask/static/js/cookies.js diff --git a/app/static/js/search_new_elements.js b/test/demo_flask/static/js/search_new_elements.js similarity index 100% rename from app/static/js/search_new_elements.js rename to test/demo_flask/static/js/search_new_elements.js diff --git a/app/static/js/vue.js b/test/demo_flask/static/js/vue.js similarity index 100% rename from app/static/js/vue.js rename to test/demo_flask/static/js/vue.js diff --git a/test/demo_flask/templates/api_documentation.html b/test/demo_flask/templates/api_documentation.html new file mode 100644 index 0000000000000000000000000000000000000000..08e9165a16ef80592fe2965c348431ed522bb51e --- /dev/null +++ b/test/demo_flask/templates/api_documentation.html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8" /> + <title>user authentification API</title> + </head> + + <body> + <table> + <tr> + <th>n°</th> + <th>function</th> + <th>URL</th> + <th>return</th> + </tr> + <tr> + <td>1</td> + <td>login</td> + <td>/auth/login</td> + <td>true or false</td> + </tr> + </table> + </body> +</html> \ No newline at end of file diff --git a/app/templates/browse.html b/test/demo_flask/templates/browse.html similarity index 100% rename from app/templates/browse.html rename to test/demo_flask/templates/browse.html