parent
aa2fb21444
commit
357468a941
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,65 @@
|
|||||||
|
{% extends "layout.html" %}
|
||||||
|
{% block content %}
|
||||||
|
<div class="{{ theme.userInputDivClass }}" style="{{ theme.userInputFormColor }}">
|
||||||
|
<form method="POST" action="">
|
||||||
|
{{ form.hidden_tag() }}
|
||||||
|
<fieldset class="form-group"></fieldset>
|
||||||
|
<legend class="border-bottom mb-4">Register Status</legend>
|
||||||
|
|
||||||
|
<!-- name of the company-->
|
||||||
|
<div class="form-group">
|
||||||
|
{{ form.name.label(class="form-control-label") }}
|
||||||
|
{% if form.name.errors %}
|
||||||
|
{{ form.name(class="form-control form-control-lg is-invalid") }}
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
{% for error in form.name.errors %}
|
||||||
|
<span>{{ error }}</span>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
{{ form.name(class="form-control form-control-lg") }}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- description of the company-->
|
||||||
|
<div class="form-group">
|
||||||
|
{{ form.description.label(class="form-control-label") }}
|
||||||
|
{% if form.description.errors %}
|
||||||
|
{{ form.description(class="form-control form-control-lg is-invalid") }}
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
{% for error in form.description.errors %}
|
||||||
|
<span>{{ error }}</span>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
{{ form.description(class="form-control form-control-lg") }}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Submit Button -->
|
||||||
|
<div class="form-group">
|
||||||
|
{{ form.submit(class="btn btn-outline-info") }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="container-fluid pt-2">
|
||||||
|
<h3> <a href="#"> Existing Statuses</a> </h3>
|
||||||
|
<table class="{{ theme.tableClass }}">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Name</th>
|
||||||
|
<th scope="col">Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for item in statuses %}
|
||||||
|
<tr>
|
||||||
|
<th scope="row">{{ item.name }}</th>
|
||||||
|
<td>{{ item.description}}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
{% endblock content %}
|
Binary file not shown.
Binary file not shown.
@ -0,0 +1,134 @@
|
|||||||
|
from minibase import db, create_minibase
|
||||||
|
from minibase.database.models import Person, Person_role, Person_competence
|
||||||
|
from minibase.database.models import Company, Company_relation, Company_legal_entity
|
||||||
|
from minibase.database.models import Status, Industry
|
||||||
|
|
||||||
|
app = create_minibase()
|
||||||
|
app.app_context().push()
|
||||||
|
db.drop_all()
|
||||||
|
db.create_all()
|
||||||
|
|
||||||
|
|
||||||
|
###################################################################################################
|
||||||
|
PeresonRole1 = Person_role(
|
||||||
|
name='Engineer',
|
||||||
|
description='Standart Engineer')
|
||||||
|
db.session.add(PeresonRole1)
|
||||||
|
|
||||||
|
PeresonRole2 = Person_role(
|
||||||
|
name='Engineerin Manager',
|
||||||
|
description='Manager for egineering')
|
||||||
|
db.session.add(PeresonRole2)
|
||||||
|
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
|
PeresonRole3 = Person_role(
|
||||||
|
name='CEO',
|
||||||
|
description='Chief Executif Operation')
|
||||||
|
db.session.add(PeresonRole1)
|
||||||
|
|
||||||
|
PersonCompethence1 = Person_competence(
|
||||||
|
name='Embedded Systems',
|
||||||
|
description='Embedded Systems Engineer')
|
||||||
|
db.session.add(PersonCompethence1)
|
||||||
|
|
||||||
|
PersonCompethence2 = Person_role(
|
||||||
|
name='hardware',
|
||||||
|
description='Electronics Hardwre specialist')
|
||||||
|
db.session.add(PersonCompethence2)
|
||||||
|
|
||||||
|
PersonCompethence3 = Person_role(
|
||||||
|
name='Software',
|
||||||
|
description='Software engineer')
|
||||||
|
db.session.add(PersonCompethence1)
|
||||||
|
|
||||||
|
|
||||||
|
###################################################################################################
|
||||||
|
industry1 = Industry(
|
||||||
|
name='Industrial',
|
||||||
|
description="Active in Industrial area")
|
||||||
|
db.session.add(industry1)
|
||||||
|
|
||||||
|
industry2 = Industry(
|
||||||
|
name='Consumer',
|
||||||
|
description="Active in Consumer area")
|
||||||
|
db.session.add(industry1)
|
||||||
|
|
||||||
|
companyRelation1 = Company_relation(
|
||||||
|
name='Customer',
|
||||||
|
description="Only Buyiong customer")
|
||||||
|
db.session.add(companyRelation1)
|
||||||
|
|
||||||
|
companyRelation2 = Company_relation(
|
||||||
|
name='Supplier',
|
||||||
|
description="Only Selling customer")
|
||||||
|
db.session.add(companyRelation2)
|
||||||
|
|
||||||
|
companyRelation3 = Company_relation(
|
||||||
|
name='Collaborator',
|
||||||
|
description="Buying and Selling customer")
|
||||||
|
db.session.add(companyRelation2)
|
||||||
|
|
||||||
|
companyLegal1 = Company_legal_entity(
|
||||||
|
name='AG',
|
||||||
|
description='AktienGezelschaft')
|
||||||
|
db.session.add(companyLegal1)
|
||||||
|
|
||||||
|
companyLegal2 = Company_legal_entity(
|
||||||
|
name='GMBH',
|
||||||
|
description='Gesellschaft mit beschränkter Haftung')
|
||||||
|
db.session.add(companyLegal2)
|
||||||
|
|
||||||
|
###################################################################################################
|
||||||
|
status1 = Status(
|
||||||
|
name='Obsolete',
|
||||||
|
description='Obsolete from Manufacturer')
|
||||||
|
db.session.add(status1)
|
||||||
|
|
||||||
|
status2 = Status(
|
||||||
|
name='Active',
|
||||||
|
description='Everything is in order')
|
||||||
|
db.session.add(status2)
|
||||||
|
|
||||||
|
###################################################################################################
|
||||||
|
company1 = Company(
|
||||||
|
name='Steinel',
|
||||||
|
legal_entity_id='1',
|
||||||
|
relation_id='1',
|
||||||
|
industry_id='1',
|
||||||
|
website='www.steinel.ch',
|
||||||
|
street_bill='Alemeinrstrasse',
|
||||||
|
street_no_bill='10',
|
||||||
|
city_bill='Einsiedeln',
|
||||||
|
post_code_bill='8406',
|
||||||
|
state_bill='Schyz',
|
||||||
|
country_bill='Switzerland',
|
||||||
|
street_ship='Alemeinrstrasse',
|
||||||
|
street_no_ship='10',
|
||||||
|
city_ship='Einsiedeln',
|
||||||
|
post_code_ship='8406',
|
||||||
|
state_ship='Schyz',
|
||||||
|
country_ship='Switzerland')
|
||||||
|
db.session.add(company1)
|
||||||
|
|
||||||
|
company2 = Company(
|
||||||
|
name='Kynsight',
|
||||||
|
legal_entity_id='1',
|
||||||
|
relation_id='1',
|
||||||
|
industry_id='1',
|
||||||
|
website='www.kynsight.com',
|
||||||
|
street_bill='Meierackerstrasse',
|
||||||
|
street_no_bill='10',
|
||||||
|
city_bill='Uster',
|
||||||
|
post_code_bill='8610',
|
||||||
|
state_bill='Zürich',
|
||||||
|
country_bill='Switzerland',
|
||||||
|
street_ship='Meierackerstrasse',
|
||||||
|
street_no_ship='10',
|
||||||
|
city_ship='Uster',
|
||||||
|
post_code_ship='8610',
|
||||||
|
state_ship='Zürich',
|
||||||
|
country_ship='Switzerland')
|
||||||
|
db.session.add(company2)
|
||||||
|
|
||||||
|
db.session.commit()
|
@ -1,7 +1,10 @@
|
|||||||
from minibase import create_minibase
|
from minibase import create_minibase
|
||||||
|
from minibase.database import models
|
||||||
|
|
||||||
# Enable debug option even if run directly form Python3
|
# Enable debug option even if run directly form Python3
|
||||||
|
|
||||||
app = create_minibase()
|
app = create_minibase()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run(debug=True)
|
app.run(debug=True)
|
||||||
|
app.db.create_all()
|
||||||
|
Loading…
Reference in new issue