From 1fd231a1a785ac9309489d5f5584f28e0e29da43 Mon Sep 17 00:00:00 2001 From: kerem Date: Tue, 17 Oct 2023 15:59:00 +0200 Subject: [PATCH] Finihsed with Products database and admin --- webinterface/$ | 269 ++++++++++++ .../admin/__pycache__/forms.cpython-311.pyc | Bin 6352 -> 11558 bytes .../admin/__pycache__/routes.cpython-311.pyc | Bin 8688 -> 19089 bytes .../admin/__pycache__/utils.cpython-311.pyc | Bin 177 -> 576 bytes webinterface/minibase/admin/forms.py | 142 +++++-- webinterface/minibase/admin/routes.py | 389 ++++++++++++++---- webinterface/minibase/admin/utils.py | 5 + .../__pycache__/models.cpython-311.pyc | Bin 35190 -> 38459 bytes .../__pycache__/utils.cpython-311.pyc | Bin 5632 -> 14151 bytes webinterface/minibase/database/company.csv | 5 + .../database/company_legal_entity.csv | 9 + .../minibase/database/company_relation.csv | 5 + .../minibase/database/company_status.csv | 5 + webinterface/minibase/database/industry.csv | 8 + webinterface/minibase/database/models.py | 93 +++-- .../minibase/database/note_status.csv | 5 + webinterface/minibase/database/person.csv | 3 + .../minibase/database/person_competence.csv | 6 + .../minibase/database/person_role.csv | 12 + webinterface/minibase/database/product.csv | 3 + .../minibase/database/product_category.csv | 10 + .../database/product_classification.csv | 6 + .../minibase/database/product_domain.csv | 8 + .../minibase/database/product_eligibility.csv | 5 + .../minibase/database/product_packaging.csv | 7 + .../minibase/database/product_physical.csv | 8 + .../minibase/database/product_status.csv | 11 + .../database/product_sub_category.csv | 12 + webinterface/minibase/database/project.csv | 3 + .../minibase/database/project_element.csv | 3 + .../minibase/database/project_status.csv | 8 + webinterface/minibase/database/utils.py | 171 +++++++- webinterface/minibase/product/forms.py | 1 + webinterface/minibase/product/routes.py | 0 webinterface/minibase/project/routes.py | 37 ++ webinterface/minibase/site.db | Bin 290816 -> 290816 bytes .../minibase/static/pics/default_product.jpg | Bin 0 -> 10994 bytes .../admin/company_register_industry.html | 65 --- .../admin/company_register_legal_entity.html | 65 --- .../admin/company_register_relation.html | 67 --- .../admin/person_register_competence.html | 65 --- .../templates/admin/person_register_role.html | 86 ---- ...ister.html => register_name_and_desc.html} | 6 +- webinterface/minibase/templates/layout.html | 19 +- webinterface/prepare.py | 233 ++--------- 45 files changed, 1169 insertions(+), 686 deletions(-) create mode 100644 webinterface/$ create mode 100644 webinterface/minibase/database/company.csv create mode 100644 webinterface/minibase/database/company_legal_entity.csv create mode 100644 webinterface/minibase/database/company_relation.csv create mode 100644 webinterface/minibase/database/company_status.csv create mode 100644 webinterface/minibase/database/industry.csv create mode 100644 webinterface/minibase/database/note_status.csv create mode 100644 webinterface/minibase/database/person.csv create mode 100644 webinterface/minibase/database/person_competence.csv create mode 100644 webinterface/minibase/database/person_role.csv create mode 100644 webinterface/minibase/database/product.csv create mode 100644 webinterface/minibase/database/product_category.csv create mode 100644 webinterface/minibase/database/product_classification.csv create mode 100644 webinterface/minibase/database/product_domain.csv create mode 100644 webinterface/minibase/database/product_eligibility.csv create mode 100644 webinterface/minibase/database/product_packaging.csv create mode 100644 webinterface/minibase/database/product_physical.csv create mode 100644 webinterface/minibase/database/product_status.csv create mode 100644 webinterface/minibase/database/product_sub_category.csv create mode 100644 webinterface/minibase/database/project.csv create mode 100644 webinterface/minibase/database/project_element.csv create mode 100644 webinterface/minibase/database/project_status.csv create mode 100644 webinterface/minibase/product/forms.py create mode 100644 webinterface/minibase/product/routes.py create mode 100644 webinterface/minibase/static/pics/default_product.jpg delete mode 100644 webinterface/minibase/templates/admin/company_register_industry.html delete mode 100644 webinterface/minibase/templates/admin/company_register_legal_entity.html delete mode 100644 webinterface/minibase/templates/admin/company_register_relation.html delete mode 100644 webinterface/minibase/templates/admin/person_register_competence.html delete mode 100644 webinterface/minibase/templates/admin/person_register_role.html rename webinterface/minibase/templates/admin/{status_register.html => register_name_and_desc.html} (93%) diff --git a/webinterface/$ b/webinterface/$ new file mode 100644 index 00000000..834e0dc8 --- /dev/null +++ b/webinterface/$ @@ -0,0 +1,269 @@ +from minibase.database.models import Company, Company_relation, Company_legal_entity +from minibase.database.models import Industry, Countries +from minibase.database.models import Person, Person_role, Person_competence +from minibase.database.models import Project, Project_element +from minibase import db +from numpy import genfromtxt + + +# Gets the id of company from the formated output defined at models.py for the Company Model +# The argument formatedCompanySelection is formated by SQLAlchemy in models.py files +# Please look there before changing anything here. +def getCompanyId(formatedCompanySelection): + text = formatedCompanySelection.split(",") + return text[2] # Corresponds to the ID of the Company + + +# Gets the id of Person's role +def getPersonRoleId(nameForId): + selection = Person_role.query.filter_by(name=nameForId).first() + return selection.id + + +# Gets the id of Person's competence +def getPersonCompetenceId(nameForId): + selection = Person_competence.query.filter_by(name=nameForId).first() + return selection.id + + +# Gets the country of the company based on it's id +def getCompanyCountry(companyId): + selection = Company.query.filter_by(id=companyId).first() + return selection.country_bill + + +# Gets the state of the company based on it's id +def getCompanyState(companyId): + selection = Company.query.filter_by(id=companyId).first() + return selection.street_bill + + +# Gets the city of the company based on it's id +def getCompanyCity(companyId): + selection = Company.query.filter_by(id=companyId).first() + return selection.city_bill + + +# Gets the Postal Code of the company based on it's id +def getCompanyPostCode(companyId): + selection = Company.query.filter_by(id=companyId).first() + return selection.post_code_bill + + +# Gets the Name of the street of the company based on it's id +def getCompanyStreetName(companyId): + selection = Company.query.filter_by(id=companyId).first() + return selection.street_bill + + +# Gets the Number of the street of the company based on it's id +def getCompanyStreetNo(companyId): + selection = Company.query.filter_by(id=companyId).first() + return selection.street_no_bill + + +# Returns the query of all awailable companie names on the table named Company +# Note that the formating is done during the SQLAlchemy Table declaration. +def person_role_choices(): + choices = Person_role.query.all() + return choices + + +# Returns the query of all awailable companie names on the table named Company +# Note that the formating is done during the SQLAlchemy Table declaration. +def person_competence_choices(): + choices = Person_competence.query.all() + return choices + + +# Returns the query of all awailable companie names on the table named Company +# Note that the formating is done during the SQLAlchemy Table declaration. +def company_choices(): + choices = Company.query.all() + return choices + + +# Retunrs the qurry of all awailable industrie names on the table named Industry +# Note that the formating is done during the SQLAlchemy Table declaration. +def company_industry_choices(): + choices = Industry.query.all() + return choices + + +# Retunrs the query of all awailable legal entity names on the table named Company_legal_entity +# Note that the formating is done during the SQLAlchemy Table declaration. +def company_legal_entity_choices(): + choices = Company_legal_entity.query.all() + return choices + + +# Retunrs the query of all awailable Relation names on the table named Company_relation +# Note that the formating is done during the SQLAlchemy Table declaration. +def company_relation_choices(): + choices = Company_relation.query.all() + return choices + + +# The Company Model has Industry Column as a foreign key and it requires the Industry's ID +# And not the name. so this function returns the right ID of the name shown at the +# Register Company Form +def getIndustryId(nameForId): + selection = Industry.query.filter_by(name=nameForId).first() # Gets the id of Role + return selection.id + + +# The Company Model has Relation Column as a foreign key and it requires the Industry's ID +# And not the name. so this function returns the right ID of the name shown at the +# Register Company Form +def getRelationId(nameForId): + selection = Company_relation.query.filter_by(name=nameForId).first() # Gets the id of Role + return selection.id + + +# The Company Model has Legal Entity Column as a foreign key and it requires the Industry's ID +# And not the name. so this function returns the right ID of the name shown at the +# Register Company Form +def getLegalEntityId(nameForId): + selection = Company_legal_entity.query.filter_by(name=nameForId).first() # Gets the id of Role + return selection.id + + +# Retunrs the query of all awailable Country names on the table named Countries +# Note that the formating is done during the SQLAlchemy Table declaration. +# Important note This table is ImporteD externally from a modifier SQL version of +# Github : https://github.com/dr5hn/countries-states-cities-database +def country_choices(): + choices = Countries.query.all() + return choices + +################################################################################################### +# CSV manipulation +################################################################################################### + +def openCsv(filename): + data = genfromtxt(filename, + delimiter=',', + skip_header=1, + dtype=None, + encoding='UTF-8') + return data.tolist() + + +def db_add_name_and_description(csv, table): + try: + csv_list = openCsv(csv) + for i in csv_list: + record = table(**{ + 'name': i[0], + 'description': i[1]}) + db.session.add(record) # Add all the records + db.session.commit() # Attempt to commit all the records + except: + db.session.rollback() # Rollback the changes on error + print("Error Ocured during <> upload to DB") + + +def db_add_company(csv): + try: + csv_list = openCsv(csv) + for i in csv_list: + record = Company(**{ + 'name': i[0], + 'legal_entity_id': i[1], + 'relation_id': i[2], + 'industry_id': i[3], + 'status_id': i[4], + 'website': i[5], + 'street_bill': i[6], + 'street_no_bill': i[7], + 'city_bill': i[8], + 'post_code_bill': i[9], + 'state_bill': i[10], + 'country_bill': i[11], + 'street_ship': i[12], + 'street_no_ship': i[13], + 'city_ship': i[14], + 'post_code_ship': i[15], + 'state_ship': i[16], + 'country_ship': i[17]}) + db.session.add(record) # Add all the records + db.session.commit() # Attempt to commit all the records + except Exception as error: + db.session.rollback() # Rollback the changes on error + print("Error Ocured during <> upload to DB") + print(error) + + +def db_add_person(csv): + try: + csv_list = openCsv(csv) + print(csv_list) + for i in csv_list: + record = Person(**{ + 'name': i[0], + 'last_name': i[1], + 'company_id': i[2], + 'role_id': i[3], + 'competence_id': i[4], + 'mail_prof': i[5], + 'mail_priv': i[6], + 'tel_prof_mobile': i[7], + 'street_name': i[8], + 'street_no': i[9], + 'city': i[10], + 'post_code': i[11], + 'state': i[12], + 'country': i[13] + }) + db.session.add(record) # Add all the records + db.session.commit() # Attempt to commit all the records + except Exception as error: + db.session.rollback() # Rollback the changes on error + print("Error Ocured during <> upload to DB") + print(error) + + +def db_add_project(csv): + try: + csv_list = openCsv(csv) + print(csv_list) + for i in csv_list: + record = Project(**{ + 'name': i[0], + 'description': i[1], + 'company_id': i[2], + 'status_id': i[3], + 'industry_id': i[4], + 'owner_id': i[5], + 'qte_prototype': i[6], + 'qte_start': i[7], + 'qte_production': i[8], + }) + db.session.add(record) # Add all the records + db.session.commit() # Attempt to commit all the records + except Exception as error: + db.session.rollback() # Rollback the changes on error + print(csv) + print("Error Ocured during <> upload to DB") + print(error) + +def db_add_project_element(csv): + try: + csv_list = openCsv(csv) + print(csv_list) + for i in csv_list: + record = Project_element(**{ + 'name': i[0], + 'description': i[1], + 'qte_per_project': i[2], + 'project_id': i[3], + 'owner_id': i[4], + 'status_id': i[5], + }) + db.session.add(record) # Add all the records + db.session.commit() # Attempt to commit all the records + except Exception as error: + db.session.rollback() # Rollback the changes on error + print(csv) + print("Error Ocured during <> upload to DB") + print(error) diff --git a/webinterface/minibase/admin/__pycache__/forms.cpython-311.pyc b/webinterface/minibase/admin/__pycache__/forms.cpython-311.pyc index 423654a0d039d321a5797b8e9f99d2244ff2f90b..fb85d01f128907cd4eb6b4d6881a42ec18e766f4 100644 GIT binary patch literal 11558 zcmdU#%WvDr8Nf-}vMp2egMP$LoLF|8hc;O|+q~n{Xllo)8%KW0PM0|dvP3&fM9E9i zn>sCmV7rG!FU_e5&`VLE*)_5#_OJ&R@E<_}EMO2=pg>Q(xkyiY>i5lvlxfkDwlHed zp}uhDo5wdZzj<(Gz7&LJ2L3u;4a;3a4D%0kxPPI-%lj)F!@OoPOoq)eDl4%pzH?bl zt&{51da0hc>#`xWL26JNrAFee&o-%HDXcb2&BPr7H!tyOM2e__BoMy_@N1D;)K;mL zxEsOUCbg0GCU|d`+Eq~!)efmc?UXvzE~!iHmb%qr(lND1>LKC6*B>_P@+3UbSHc2 z?mW>Ag6?#QE=F`ipgU8d`ydluU}9(giB%tCo$zEfr9Yj_Yif*h_yt2#a;uYyoXvn^ zeOXlu;s9M_B4woJYUDTaHVn^$*jDZ$|mKUp%@!Zo9nB|S(2dB;`-=D%2?MS?WU<*W?eV54Tq2C z4LMm*uujXYmVY9r4cDiM_+-{SAEymM5ck^S4P8m6vS6F*lS)5LtwMpF4%bW0Dyzz} zl10P1UC%UBk*=&jWGrtnhfH2gDY;?}pqE$kU}UEoQ(s?By1wyr0eAAB*M&a==W9l0 zBsRlH9LLCY85U&yTkwD9#aLy(=H5bQe+NJMCxuAZx~jr9K&Zw{{aY4NfL|enrcCH_ zMha&d0EkAXQz_K(yu7ODhO8kJPJKM3%A2gy{3&hlyrw(+gsi7EWescNdAl1t>b6nZ zvk~&ChaYzI_sbw&GlrKt!#wfc4GdNI`!)N-8yNg0)>@6Q8;XG;&tIC)p#Gp7T>Sa@ z#N(9VSrbictjSSDkEXJkoXTuOwLm#0R$cz>GZDtwT?$dJhqq_-3=ylq5MOlTLFosX`CQ%J3dZ zCO=tEWzm*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(5 w-hq1(XS{a>TclWvwidL&Ro5A}-^Lah)}pNiEikH_aa+U|v#f=a7Mt9E1JBAw(f|Me diff --git a/webinterface/minibase/admin/__pycache__/routes.cpython-311.pyc b/webinterface/minibase/admin/__pycache__/routes.cpython-311.pyc index 13f51ee3c8071b5e4f3bafad989f329eced49266..8214fbc81939b321a50e1369e3bec70bd616ca13 100644 GIT binary patch literal 19089 zcmeHOU2NOd6(%Lik}cY?6aOoc>0d?uljAmt*Cb98+i{ZCj+}dl6NJy zOO|ZGu%BWmuwp2%0>yv;TeAe|06%(f1@=CO0s{#I3=|mlus0WJAC{+`b45~OB{p?p z52&XL@`(5Fo^#2|d%t^h?md5LXsBl({r&f2QfiiA{)rhQx%7)C|EOV@KQJOAvT;Uc z1y*(l4%sO<qm+TXK zw45h?SoRBkIUoe&ZlRm<>VU@!yxb%7(0o1Qdxc)PPw1n0FXa1$etONp^?)!S4+?{F zPzcILgd=iD2+2dj5X(3isa9-|hVMHV<`JBQB#cNS_ePCe>95!*9uS*W9iKE?CB%cj zWbQ-3M`mGR%vQ%C8yziWI>NR(T5WW+mFXC_)zNOFqoYj6QCl6IHafb>bWGUl@Y(1% zT&CkCTOEEI9f2|(FWc(qw$Z_t={RPqqsK-^Z<&tcwmSN3bo7_$IAN<}z(&VlnT|~G}lTzlDe*Wh$O~{6isVxBK>$>N~N{BbMbX)jl>e^5UV-FWuOh|>yj+Z z#}cvSNJji7!csbS!;SYcjY*f?8wAgw|+qQt3!~Jr#0j zo{I@_J(VUmHSa<)EiIWhyo(Y^B@;^|8JDzXJrjlcq_mWXN+FNdxJZ)XdNi%eXiY|b z?fT7BEEBn%7A327K5OW-Vo6%N3bg8eN}&md2vD4jH%f_MuEe_0{#|=~BKcBFeGEtw0zX0eaCA(O<>d zi=1<_*R-0&%U7>K7j(-~`g&4KMa}sIE>Vb}77JMCqdRQcoZlGc zhIxGtHIyYwS+Eca>7HRV7!3Mrt>->G!6Wl2?l^9<_i8Q0^^8@De3&kIj@#@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i|%N_9sS~$ zN^GJSJ6VXGlw&hWY({p^D(>0Mg}Ph`hU;*pop>(o#B*tnKWM4;T-Ie2QBXuek%pej zLCJGyD=ni*1x-q5l5*vJH9Ae85*>N_rfFJ@OcJO>VhuJ;I#)t9Tp|9R9&y^I%a4aH zKRh^8Lzl+8rrr`=hzFxjom$2W)n`m)w&|qleuFeL5>$$=mNrhVicYovqCeFgni*Kt zltn;|W>2^NxWb-F&+#eHUxi!zHzb5W{jzI7aSZ^00`DmS zwiq~C2poMeKCg@~7RN6Y#xKd^SCsK9a^R{GxVm|vE`mab>L93xAgG5Rs3$I=&MF2; z9WfaVD`;3k!wn%cCV7r-FUn|EL9-H?r4Tx+Mo+7UCiZl0POFhw0-@pYw?fDl*TdT7 zf!Zg}PnkS>vkJn}dc3CnGXF{VIz1DqMNYSloHyo{&KYl+GrG31H$r;tH+DwtWU)K+ zn(r1PWNV{&^hS*?nIYoUAC}h!o(GlB;1>S@2_Z+X?CMus{Xh*cl?2;iW!f7C8MZFr}PU! z|Jh$L)K{bNxbM(3bZs@m&*Dps zc>B}MkZd`pSkCQQ+bwW(0LjZH#(LgT79A~Xu-gmIk8htM8fO&C8MDSbXp}_%i^kyA z>h|(hjGwnY&1ndF; diff --git a/webinterface/minibase/admin/__pycache__/utils.cpython-311.pyc b/webinterface/minibase/admin/__pycache__/utils.cpython-311.pyc index e54c266205607436ded05e8c07be90f98b869e20..8d9728b63c1193a8d8ea79bea88cde360c88d19c 100644 GIT binary patch literal 576 zcmZWlzfZzI6uv7h8uS#6i;HyaLUo2X;IECvO{YQ+J#9hnN|Xc>1_uY7T{{?!adGf( zaEFl4-0H+e!p7vgYB7c{dEdMD-Fx4?+zTNY1UP=k(@)4>sz`u;5938RJR%p}q9f$u zLu6@HEop*mK%^kXA*0`qjb~V^NRURs{p}M!y(zt9=-jeAW^8(7HUUz&d4d$_PDs|Th9BI@T7lDnY(=;aq`?TRx`<%Ay6BgJ$tFwwDsC`8%tPaLCr%L}+$At#F z88A=eFIqC|HmE4W!+Wvm4&zH;tG-Aa0CiAAR_~7oB-bOk(0IxW%*~#;`M&nC-Zcw- zv(P2QJ}C}JsYgm(vfC%So&9Kzj1V?fqUG$}Wwfw(w>1VURJL$z{)+fAl$-!f=8JyA bZF+Q@uRy7OM{EF%QW)cru48bTrFi}uym@)x delta 116 zcmX@WvXPN@IWI340}#l6RY_%>$SWz$2INdTZlX-=wL5i3v~BM=w!1BnmJjEsyQ7+^#ZGf)fw DQ{WoN diff --git a/webinterface/minibase/admin/forms.py b/webinterface/minibase/admin/forms.py index 912edc7b..7fdd3e58 100644 --- a/webinterface/minibase/admin/forms.py +++ b/webinterface/minibase/admin/forms.py @@ -1,12 +1,15 @@ from flask_wtf import FlaskForm from wtforms import StringField, SubmitField from wtforms.validators import DataRequired, ValidationError -from minibase.database.models import Person_role -from minibase.database.models import Company_legal_entity, Company_relation -from minibase.database.models import Industry +from minibase.database.models import Person_role, Person_competence +from minibase.database.models import Company_legal_entity, Company_relation, Company_status +from minibase.database.models import Industry, Note_status +from minibase.database.models import Project_status +from minibase.database.models import Product_status, Product_physical, Product_packaging, Product_eligibility, Product_classification, Product_domain, Product_category, Product_sub_category +import minibase.admin.utils as adminUtils -class compIndustryForm(FlaskForm): # Defines the form class to be used for the user registretion +class industryRegisterForm(FlaskForm): # Defines the form class to be used for the user registretion # Decalarion of the fields for the form and it's propereties name = StringField('Name', validators=[DataRequired()]) description = StringField('Description', validators=[DataRequired()]) @@ -14,8 +17,7 @@ class compIndustryForm(FlaskForm): # Defines the form class to be used for the # Queries to be made in order to validate the form : If Relation Type exitst # Case Insensistive def validate_name(self, name): - industry_query = Industry.query.filter(Industry.name.ilike(name.data)).first() # Database Querry ilike means case insessitive - if industry_query: + if adminUtils.doesNameExistsCi(Product_status, name.data): raise ValidationError('That Industry Type is already registered') @@ -23,38 +25,46 @@ class compRelationForm(FlaskForm): # Defines the form class to be used for the # Decalarion of the fields for the form and it's propereties name = StringField('Name', validators=[DataRequired()]) description = StringField('Description', validators=[DataRequired()]) - submit = SubmitField('Register Relation') + submit = SubmitField('Register Company Relation') # Queries to be made in order to validate the form : If Relation Type exitst # Case Insensistive def validate_name(self, name): - relation_query = Company_relation.query.filter(Company_relation.name.ilike(name.data)).first() # Database Querry ilike means case insessitive - if relation_query: - raise ValidationError('That Relation Type is already registered') + if adminUtils.doesNameExistsCi(Company_relation, name.data): + raise ValidationError('That Company Relation Type is already registered') class compLegalEntityForm(FlaskForm): # Defines the form class to be used for the user registretion # Decalarion of the fields for the form and it's propereties name = StringField('Name', validators=[DataRequired()]) description = StringField('Description', validators=[DataRequired()]) - submit = SubmitField('Register Legal Entity') + submit = SubmitField('Register Company Legal Entity') # Queries to be made in order to validate the form : If Legal Entity exitst # Case Insensistive def validate_name(self, name): - legal_entity_query = Company_legal_entity.query.filter(Company_legal_entity.name.ilike(name.data)).first() # Database Querry ilike means case insessitive - if legal_entity_query: - raise ValidationError('That Legal Entity is already registered') + if adminUtils.doesNameExistsCi(Company_legal_entity, name.data): + raise ValidationError('That Company Legal Entity is already registered') + +class compStatusForm(FlaskForm): # Defines the form class to be used for the user registretion + # Decalarion of the fields for the form and it's propereties + name = StringField('Name', validators=[DataRequired()]) + description = StringField('Description', validators=[DataRequired()]) + submit = SubmitField('Register Company Status') + + # Queries to be made in order to validate the form : If Person Role exitst # Case Insensistive + def validate_name(self, name): + if adminUtils.doesNameExistsCi(Company_status, name.data): + raise ValidationError('That Company Status is already registered') class personRoleForm(FlaskForm): # Defines the form class to be used for the user registretion # Decalarion of the fields for the form and it's propereties name = StringField('Name', validators=[DataRequired()]) description = StringField('Description', validators=[DataRequired()]) - submit = SubmitField('Register Role') + submit = SubmitField('Register Person Role') # Queries to be made in order to validate the form : If Person Role exitst # Case Insensistive def validate_name(self, name): - person_role_query = Person_role.query.filter(Person_role.name.ilike(name.data)).first() # Database Querry ilike means case insessitive - if person_role_query: + if adminUtils.doesNameExistsCi(Person_role, name.data): raise ValidationError('That Person Role is already registered') @@ -62,23 +72,105 @@ class personCompetenceForm(FlaskForm): # Defines the form class to be used for # Decalarion of the fields for the form and it's propereties name = StringField('Name', validators=[DataRequired()]) description = StringField('Description', validators=[DataRequired()]) - submit = SubmitField('Register Role') + submit = SubmitField('Register Person Competence') # Queries to be made in order to validate the form : If Person Role exitst # Case Insensistive def validate_name(self, name): - person_competence_query = Person_role.query.filter(Person_role.name.ilike(name.data)).first() # Database Querry ilike means case insessitive - if person_competence_query: + if adminUtils.doesNameExistsCi(Person_competence, name.data): raise ValidationError('That Person Conpetence is already registered') -class statusRegisterForm(FlaskForm): # Defines the form class to be used for the user registretion +class noteStatusForm(FlaskForm): # Defines the form class to be used for the user registretion + # Decalarion of the fields for the form and it's propereties + name = StringField('Name', validators=[DataRequired()]) + description = StringField('Description', validators=[DataRequired()]) + submit = SubmitField('Register Note Status') + + # Queries to be made in order to validate the form : If Person Role exitst # Case Insensistive + def validate_name(self, name): + if adminUtils.doesNameExistsCi(Note_status, name.data): + raise ValidationError('That Note Status is already registered') + + +class projectStatusForm(FlaskForm): # Defines the form class to be used for the user registretion + # Decalarion of the fields for the form and it's propereties + name = StringField('Name', validators=[DataRequired()]) + description = StringField('Description', validators=[DataRequired()]) + submit = SubmitField('Register Project Status') + + # Queries to be made in order to validate the form : If Person Role exitst # Case Insensistive + def validate_name(self, name): + if adminUtils.doesNameExistsCi(Project_status, name.data): + raise ValidationError('That Project Status is already registered') + + +class productStatusForm(FlaskForm): + # Decalarion of the fields for the form and it's propereties + name = StringField('Name', validators=[DataRequired()]) + description = StringField('Description', validators=[DataRequired()]) + submit = SubmitField('Register Product Status') + + # Queries to be made in order to validate the form : If Person Role exitst # Case Insensistive + def validate_name(self, name): + if adminUtils.doesNameExistsCi(Product_status, name.data): + raise ValidationError('That Product Status is already registered') + + +class productEligibilityForm(FlaskForm): + # Decalarion of the fields for the form and it's propereties + name = StringField('Name', validators=[DataRequired()]) + description = StringField('Description', validators=[DataRequired()]) + submit = SubmitField('Register Product Eligibility') + + # Queries to be made in order to validate the form : If Person Role exitst # Case Insensistive + def validate_name(self, name): + if adminUtils.doesNameExistsCi(Product_eligibility, name.data): + raise ValidationError('That Product Eligibility is already registered') + + +class productDomainForm(FlaskForm): + # Decalarion of the fields for the form and it's propereties + name = StringField('Name', validators=[DataRequired()]) + description = StringField('Description', validators=[DataRequired()]) + submit = SubmitField('Register Product Domain') + + # Queries to be made in order to validate the form : If Person Role exitst # Case Insensistive + def validate_name(self, name): + if adminUtils.doesNameExistsCi(Product_domain, name.data): + raise ValidationError('That Product domain is already registered') + + +class productClassificationForm(FlaskForm): + # Decalarion of the fields for the form and it's propereties + name = StringField('Name', validators=[DataRequired()]) + description = StringField('Description', validators=[DataRequired()]) + submit = SubmitField('Register Prodcut Classification') + + # Queries to be made in order to validate the form : If Person Role exitst # Case Insensistive + def validate_name(self, name): + if adminUtils.doesNameExistsCi(Product_classification, name.data): + raise ValidationError('That Product Classification is already registered') + + +class productCategoryForm(FlaskForm): + # Decalarion of the fields for the form and it's propereties + name = StringField('Name', validators=[DataRequired()]) + description = StringField('Description', validators=[DataRequired()]) + submit = SubmitField('Register Product Category') + + # Queries to be made in order to validate the form : If Person Role exitst # Case Insensistive + def validate_name(self, name): + if adminUtils.doesNameExistsCi(Product_category, name.data): + raise ValidationError('That Product Category is already registered') + + +class productSubCategoryForm(FlaskForm): # Decalarion of the fields for the form and it's propereties name = StringField('Name', validators=[DataRequired()]) description = StringField('Description', validators=[DataRequired()]) - submit = SubmitField('Register Status') + submit = SubmitField('Register Product Sub Category') # Queries to be made in order to validate the form : If Person Role exitst # Case Insensistive def validate_name(self, name): - person_competence_query = Status.query.filter(Status.name.ilike(name.data)).first() # Database Querry ilike means case insessitive - if person_competence_query: - raise ValidationError('That Status is already registered') + if adminUtils.doesNameExistsCi(Product_sub_category, name.data): + raise ValidationError('That Product Sub Category is already registered') diff --git a/webinterface/minibase/admin/routes.py b/webinterface/minibase/admin/routes.py index e2dc41fc..dd879c6d 100644 --- a/webinterface/minibase/admin/routes.py +++ b/webinterface/minibase/admin/routes.py @@ -1,165 +1,414 @@ from flask import render_template, url_for, flash, redirect, request, Blueprint from minibase import db from minibase.config import themeMinibase -from minibase.database.models import Company, Company_legal_entity, Company_relation -from minibase.database.models import Industry +from minibase.database.models import Company, Company_legal_entity, Company_relation,Company_status +from minibase.database.models import Industry, Note_status from minibase.database.models import Person_role, Person_competence -from minibase.admin.forms import compLegalEntityForm, compRelationForm, compIndustryForm,personRoleForm, personCompetenceForm, statusRegisterForm - +from minibase.database.models import Product_status, Product_physical, Product_packaging, Product_eligibility, Product_classification, Product_domain, Product_category, Product_sub_category +from minibase.admin.forms import compLegalEntityForm, compRelationForm, compStatusForm +from minibase.admin.forms import personRoleForm, personCompetenceForm +from minibase.admin.forms import industryRegisterForm, noteStatusForm +from minibase.admin.forms import projectStatusForm +from minibase.admin.forms import productStatusForm, productEligibilityForm, productDomainForm, productClassificationForm, productCategoryForm, productSubCategoryForm # Declaring a blueprint admin = Blueprint('admin', __name__) @admin.route("/company_register_legal_entity", methods=['GET', 'POST']) def company_register_legal_entity(): + toPrint = "Company Legal Entity" form = compLegalEntityForm() - legal_entities = Company_legal_entity.query.order_by(Company_legal_entity.name.asc()) + query = Company_legal_entity.query.order_by(Company_legal_entity.name.asc()) if form.validate_on_submit(): - companyLegal = Company_legal_entity( + dbRow = Company_legal_entity( name=form.name.data, description=form.description.data) # Here we need to give the id of thr role as this is a foreign key - db.session.add(companyLegal) + db.session.add(dbRow) db.session.commit() - flash(f'{"Company Legal Entity registered!"}', 'success') - return render_template('admin/company_register_legal_entity.html', - title='Register Company Legal Entity', - legal_entities=legal_entities, + flash(f' {toPrint} {" registered!"}', 'success') + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, theme=themeMinibase, form=form) - return render_template('admin/company_register_legal_entity.html', - title='Register Company Legal Entity', - legal_entities=legal_entities, + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, theme=themeMinibase, form=form) @admin.route("/company_register_relation", methods=['GET', 'POST']) def company_register_relation(): + toPrint = "Company Relation" form = compRelationForm() - relations = Company_relation.query.order_by(Company_relation.name.asc()) + query = Company_relation.query.order_by(Company_relation.name.asc()) if form.validate_on_submit(): - companyRelation = Company_relation( + dbRow = Company_relation( name=form.name.data, description=form.description.data) # Here we need to give the id of thr role as this is a foreign key - db.session.add(companyRelation) + db.session.add(dbRow) db.session.commit() - flash(f'{"Company Relation registered!"}', 'success') - return render_template('admin/company_register_relation.html', - title='Register Company Relation', - relations=relations, + flash(f' {toPrint} {" registered!"}', 'success') + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, theme=themeMinibase, form=form) - return render_template('admin/company_register_relation.html', - title='Register Company Relation', + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, theme=themeMinibase, - relations=relations, form=form) -@admin.route("/company_register_industry", methods=['GET', 'POST']) -def company_register_industry(): - form = compIndustryForm() - industries = Industry.query.order_by(Industry.name.asc()) +@admin.route("/company_register_status", methods=['GET', 'POST']) +def company_register_status(): + toPrint = "Company Status" + form = compStatusForm() + query = Company_status.query.order_by(Company_status.name.asc()) if form.validate_on_submit(): - companyIndustry = Industry( + dbRow = Company_status( name=form.name.data, description=form.description.data) # Here we need to give the id of thr role as this is a foreign key - db.session.add(companyIndustry) + db.session.add(dbRow) db.session.commit() - flash(f'{"Company Idustry registered!"}', 'success') - return render_template('admin/company_register_industry.html', - title='Register Company Industry', - industries=industries, + flash(f' {toPrint} {" registered!"}', 'success') + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, theme=themeMinibase, form=form) - return render_template('admin/company_register_industry.html', - title='Register Company Industry', - industries=industries, + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, + theme=themeMinibase, + form=form) + + + +@admin.route("/register_industry", methods=['GET', 'POST']) +def register_industry(): + toPrint = "Company Industry" + form = industryRegisterForm() + query = Industry.query.order_by(Industry.name.asc()) + if form.validate_on_submit(): + dbRow = Industry( + name=form.name.data, + description=form.description.data) + # Here we need to give the id of thr role as this is a foreign key + db.session.add(dbRow) + db.session.commit() + + flash(f' {toPrint} {" registered!"}', 'success') + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, + theme=themeMinibase, + form=form) + + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, theme=themeMinibase, form=form) @admin.route("/person_register_role", methods=['GET', 'POST']) def person_register_role(): + toPrint = "Person Role" form = personRoleForm() - roles = Person_role.query.order_by(Person_role.name.asc()) + query = Person_role.query.order_by(Person_role.name.asc()) if form.validate_on_submit(): - personRole = Person_role( + dbRow = Person_role( name=form.name.data, description=form.description.data) # Here we need to give the id of thr role as this is a foreign key - db.session.add(personRole) + db.session.add(dbRow) db.session.commit() - flash(f'{"Person Role registered!"}', 'success') - return render_template('admin/person_register_role.html', - title='Register Person_role', + flash(f' {toPrint} {" registered!"}', 'success') + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, theme=themeMinibase, - roles=roles, form=form) - return render_template('admin/person_register_role.html', - title='Register Person Role', + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, theme=themeMinibase, - roles=roles, form=form) @admin.route("/person_register_competence", methods=['GET', 'POST']) def person_register_competence(): + toPrint = "Person Competence" form = personCompetenceForm() - competences = Person_competence.query.order_by(Person_competence.name.asc()) + query = Person_competence.query.order_by(Person_competence.name.asc()) if form.validate_on_submit(): - personCompetence = Person_competence( + dbRow = Person_competence( name=form.name.data, description=form.description.data) # Here we need to give the id of thr role as this is a foreign key - db.session.add(personCompetence) + db.session.add(dbRow) db.session.commit() - flash(f'{"Person Competence registered!"}', 'success') - return render_template('admin/person_register_competence.html', - title='Register Person Competence', - competences=competences, + flash(f' {toPrint} {" registered!"}', 'success') + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, theme=themeMinibase, form=form) - return render_template('admin/person_register_competence.html', - title='Register Person Competence', + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, theme=themeMinibase, - competences=competences, form=form) -@admin.route("/status_register", methods=['GET', 'POST']) -def status_register(): - form = statusRegisterForm() - statuses = Status.query.order_by(Status.name.asc()) + +@admin.route("/note_register_status", methods=['GET', 'POST']) +def note_register_status(): + toPrint = "Note Status" + form = noteStatusForm() + query = Note_status.query.order_by(Note_status.name.asc()) if form.validate_on_submit(): - statusRegister = Status( + dbRow = Company_status( name=form.name.data, description=form.description.data) # Here we need to give the id of thr role as this is a foreign key - db.session.add(statusRegister) + db.session.add(dbRow) + db.session.commit() + + flash(f' {toPrint} {" registered!"}', 'success') + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, + theme=themeMinibase, + form=form) + + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, + theme=themeMinibase, + form=form) + + +@admin.route("/project_register_status", methods=['GET', 'POST']) +def project_register_status(): + toPrint = "Project Status" + form = projectStatusForm() + query = Project_status.query.order_by(Project_status.name.asc()) + if form.validate_on_submit(): + dbRow = Project_status( + name=form.name.data, + description=form.description.data) + db.session.add(dbRow) + db.session.commit() + + flash(f' {toPrint} {" registered!"}', 'success') + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, + theme=themeMinibase, + form=form) + + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, + theme=themeMinibase, + form=form) + + +@admin.route("/product_register_status", methods=['GET', 'POST']) +def product_register_status(): + toPrint = "Product Status" + form = productStatusForm() + query = Product_status.query.order_by(Product_status.name.asc()) + if form.validate_on_submit(): + dbRow = Product_status( + name=form.name.data, + description=form.description.data) + db.session.add(dbRow) + db.session.commit() + + flash(f' {toPrint} {" registered!"}', 'success') + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, + theme=themeMinibase, + form=form) + + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, + theme=themeMinibase, + form=form) + + +@admin.route("/product_register_eligibility", methods=['GET', 'POST']) +def product_register_eligibility(): + toPrint = "Product Eligibility" + form = productEligibilityForm() + query = Product_eligibility.query.order_by(Product_eligibility.name.asc()) + if form.validate_on_submit(): + dbRow = Product_eligibility( + name=form.name.data, + description=form.description.data) + db.session.add(dbRow) + db.session.commit() + + flash(f' {toPrint} {" registered!"}', 'success') + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, + theme=themeMinibase, + form=form) + + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, + theme=themeMinibase, + form=form) + + +@admin.route("/product_register_domain", methods=['GET', 'POST']) +def product_register_domain(): + toPrint = "Product Domain" + form = productEligibilityForm() + query = Product_domain.query.order_by(Product_domain.name.asc()) + if form.validate_on_submit(): + dbRow = Product_domain( + name=form.name.data, + description=form.description.data) + db.session.add(dbRow) + db.session.commit() + + flash(f' {toPrint} {" registered!"}', 'success') + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, + theme=themeMinibase, + form=form) + + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, + theme=themeMinibase, + form=form) + + +@admin.route("/product_register_classification", methods=['GET', 'POST']) +def product_register_classification(): + toPrint = "Product Classification" + form = productEligibilityForm() + query = Product_classification.query.order_by(Product_classification.name.asc()) + if form.validate_on_submit(): + dbRow = Product_classification( + name=form.name.data, + description=form.description.data) + db.session.add(dbRow) + db.session.commit() + + flash(f' {toPrint} {" registered!"}', 'success') + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, + theme=themeMinibase, + form=form) + + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, + theme=themeMinibase, + form=form) + + +@admin.route("/product_register_category", methods=['GET', 'POST']) +def product_register_category(): + toPrint = "Product Category" + form = productEligibilityForm() + query = Product_category.query.order_by(Product_category.name.asc()) + if form.validate_on_submit(): + dbRow = Product_category( + name=form.name.data, + description=form.description.data) + db.session.add(dbRow) + db.session.commit() + + flash(f' {toPrint} {" registered!"}', 'success') + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, + theme=themeMinibase, + form=form) + + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, + theme=themeMinibase, + form=form) + + +@admin.route("/product_register_sub_category", methods=['GET', 'POST']) +def product_register_sub_category(): + toPrint = "Product Sub Category" + form = productEligibilityForm() + query = Product_sub_category.query.order_by(Product_sub_category.name.asc()) + if form.validate_on_submit(): + dbRow = Product_sub_category( + name=form.name.data, + description=form.description.data) + db.session.add(dbRow) db.session.commit() - flash(f'{"New Status registered!"}', 'success') - return render_template('admin/status_register.html', - title='Register Status', - statuses=statuses, + flash(f' {toPrint} {" registered!"}', 'success') + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, theme=themeMinibase, form=form) - return render_template('admin/status_register.html', - title='Register Status', - statuses=statuses, + return render_template('admin/register_name_and_desc.html', + title='Register ' + toPrint, + tableTitle='Existing ' + toPrint, + dbTable=query, theme=themeMinibase, form=form) diff --git a/webinterface/minibase/admin/utils.py b/webinterface/minibase/admin/utils.py index 8b137891..8dec0b43 100644 --- a/webinterface/minibase/admin/utils.py +++ b/webinterface/minibase/admin/utils.py @@ -1 +1,6 @@ +def doesNameExistsCi(table, name): + exists = table.query.filter(table.name.ilike(name.data)).first() # Database Querry ilike means case insessitive + if exists: + return 1 + return 0 diff --git a/webinterface/minibase/database/__pycache__/models.cpython-311.pyc b/webinterface/minibase/database/__pycache__/models.cpython-311.pyc index 929751e54803c05a4cab2193aefb8e28752fd88f..c3e87c67fc3a20d9e138c63d96587ac7ff272ece 100644 GIT binary patch delta 3307 zcmb7GeN0=|759CF58K$!AJ~`=17;<`1XI4!fD=elC4~eB0%YJc#IEsk!GsUz*(8Of z!L(6|v`R~QqKzf2BU-v3g=#^Twy4z>)M--JblbCPb&O6++No7nDGE_DChd=P_grHj zNz-Ky-p}uxd+zzV=iGajU+3PL<Ca!P8T(Oj-;A9OlVaq9* z@D!Aj9Ay!sw^F)>(Hj|EOKCf!H!*q}rMDxUS}fGH%dGX0|0EUEa|9cYlg%*KYlHK9kB|=`rRig6 zJf08BO=>a++U&;2KF7AC>;*n=LVRs(a^z~+d`RLQQQi^b9pT0$HEcgI-47AUdnF$@~!eJeSX7M(D?n=<22EXnkz({8w zgI^!8kvkAoWkn9weMR739dD)BP|NS&#`u%)mrhrzg_1!%0gK%f>2OvglMi6x@F~&+ zD%ZQ@bC6tHQmRly1)m(viag=|O%hzSZGgN=HT-xN4=vst$n%~c%W%P)O>V$1z4_#y z5I)udMM4%i1UrP2;`Uzn+wl&#?XTgI3GA#haZjYKtbPmJG#A1zzMBiR79G5y z%Y*V14Sb+0XTRzCa+tO~O~19UWY)qPdOnwy2xg8w0`Y14FuClRO@p(CED-Kbhiw)O z4EE=--*iJho1%El!JJ_e+_GswrPIQ{4Y^7pklD1Av3z3=Ja1LN z+Zj6OFh03KP*D5%g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o}wAe%H!7IT_YVM>}bbC^y#kA zuJaLojVYip1vMtWfPwF&I!N318F<@tFt8y8?(9=b>-~&5z?g%K*)PC_o)EKK<&QN6 zVvWIAV~=Hq(I2OVMI*~c(I{s+pq;?SshST2bI-5CFB=&O~_qdUvCPFmXZS~HI-kv<9 zCA6d;P3KL+b**HO5y7Qi8g46TINz(sjbce8lyFy03i|FOq0BDEZIp(ngV_{z?uCOL z)HwvdC2fKmsS$Adpqvgxw7OdBn%S2~y2Ezpi5&z+i5-_0?br^(eJRm15>@Y({$lU$ zp{9UDAC%~O3Sqi07wI|stkj}?BHR>cm}*wQgF_F&@|tL{Fc&G|L4T5Pv9m++;k9b^ z5;--V0ErZiaASuD*JCpmu1yDU;14Szr-?mPi!FVNEF@^{a66tfIE^R}@Zsqxg;~dX zn6s{hzmA-Q+RZwcJD`TMN3}wtVo6T{|Izo?a^FMlJF3mp3lOTvE7* zq`{|N&9Yp~f&VFJCUwFJ&<@16Ftz%FPn&Uki!`sN( z!jl>spnEV*<+Tp&oaZe=+64l093;Z!p*Yz5jtce;#aZy3iJIq0hz5o^4zx6RdK$d! VQ2RWQFFamc9*G2VJPcfQ{sZefgMk15 diff --git a/webinterface/minibase/database/__pycache__/utils.cpython-311.pyc b/webinterface/minibase/database/__pycache__/utils.cpython-311.pyc index 8db3dfb0fcb5230a2d9fb5c119740fd00dbee200..b46f2571b9a61e15a51bc77cd06af5f6ff8fe275 100644 GIT binary patch literal 14151 zcmeHOTWlLwdLG`S;YGutEXlfylw?b!9AC0_)`4X=vLq*V9mN+V*a&F36lY}9;YA*f zVk?ycAy{;sRA{njfC#8ssDL+hkUZqA1^Tpc7JVy7f&hsDTr99pM*G0RExJe_+V4M{ z8FDDgw<=x-?U?*^{{NggGw0_y-}%pXj{ml$#lzwH?}h#H3lWa{Eh)xj*Aw@fY#jF) zCvlQ3$)#*_wv>I&o^s4NY-F>;=A3h;Tyrj_JD@ksHKm&8np6B7&umWE+;i@fXU>!I z&Uu;5mGq@r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QCakYAUvmM&C}2-76L3 zu?KQ_?5?7X6_lc~kX7ZeALIq4sL5SayItI4IZ-EvpfoPU^=SO>fm zElBMHSP`n>xD`$q;l%T}9!{F!7x@PEB z@#jO~XHfFOD@85u2i)wOu;xpHf`MYTASZ&X2`cR1_scRX+o44z4`R$O zlGl*syQxhR&?O4(@LirRF_R8ibljlhugVoVuG49gPFr-wpfft1HRpmrQzzt7V2`l|bw;n$ZC8S=(KyFt}V<*0@k? zaJx1*!CV)ofxlxT&>{x+#(OFgtpuWnRhd0(D3pVRX%AgUU6&NJVo8u>2*rC(S^6r0 zzK={6vQ$#F`CLho_t2)JuFY*|nu3;W9JD$8FU%%h3B(VpK5Q5W?VK`Qb^3FBYNcTn zV-wK!Gi*PKa0pi#bP;<@1md`eV(Hyq+@V}z=iq%8kn5)&VMurvI$(6%8(#vvUpTTY z%z)qyf(tR7@bjR8uLQO~3vOSu8*}$cN={Z)jBuhgci*|hV@n=W&O7z&64YOYTSc!A zaRcc!Nxwzn28rwBgh@`U%v8f2E9u&ogErpvfr&8G45-vs{Li6)O#*Bt(d&@FWv#Zz zdsM!FrZd>wrP2?>w@AVu37w3ZWb~k^)Ys=-skAvuvqxYW2A@U(7~$Zz=w2;Yq~9R@ zI*FMicF^N*fML|)i(SVbamTMX`xlQ$3OatfnaGjVqD7(xiRxs)Bm)OcB)C73<1UfS z8#9m0Rp|U3l5x!n7z|tFltE7EBx#c5L9+?$&&K;K?#9z&f|Db+nMt2X1}!pdkYSyS zm}F!N6K`(>Juu9 C3+ibA diff --git a/webinterface/minibase/database/company.csv b/webinterface/minibase/database/company.csv new file mode 100644 index 00000000..1f4b34f1 --- /dev/null +++ b/webinterface/minibase/database/company.csv @@ -0,0 +1,5 @@ +name,legal_entity_id,relation_id,industry_id,status_id,website,street_bill,street_no_bill,city_bill,post_code_bill,state_bill,country_bill,street_ship,street_no_ship,city_ship,post_code_ship,state_ship,country_ship +Steinel,1,1,1,1,www.steinel.ch,Almeinstrasse,10,Einsiedeln,8406,Schwyz,Switzerland,Almeinstrasse,10,Einsiedeln,8406,Schwyz,Switzerland +Kynsight,2,2,3,1,www.kynsight.com,Meierackerestrasse,10,Uster,8610,Zürich,Switzerland,Meierackerestrasse,10,Uster,8610,Zürich,Switzerland +V-zug,3,1,2,1,www.v-zug.com,Industriestrasse,66,Zug,6302,Zug,Switzerland,Industriestrasse,66,Zug,6302,Zug,Switzerland +Stmicroelectronics,1,2,1,1,www.stm.com,Champ-des-Filles,39,Plan-les-Ouates,1228,Geneva,Switzerland,Champ-des-Filles,39,Plan-les-Ouates,1228,Geneva,Switzerland diff --git a/webinterface/minibase/database/company_legal_entity.csv b/webinterface/minibase/database/company_legal_entity.csv new file mode 100644 index 00000000..7319a702 --- /dev/null +++ b/webinterface/minibase/database/company_legal_entity.csv @@ -0,0 +1,9 @@ +name,description +AG,Aktiengesellschaft +GmbH,Gesellschaft mit beschränkter Haftung +SA,Société anonyme +SARL,Société à responsabilité limitée +EINZEL F.,Einzelfirma +KOLLEKTIV,Kollektivgesellschaft +E. INDIVIDIUEL,Entreprise individuel +COLLECTIF,Société en nom collectif diff --git a/webinterface/minibase/database/company_relation.csv b/webinterface/minibase/database/company_relation.csv new file mode 100644 index 00000000..8af917f1 --- /dev/null +++ b/webinterface/minibase/database/company_relation.csv @@ -0,0 +1,5 @@ +name,description +Customer,Buying company +Supplier,Selling company +Producer,Main producer may sell directly or trough a second channel +Collaborator,Whith whom we work together. Buying and Selling diff --git a/webinterface/minibase/database/company_status.csv b/webinterface/minibase/database/company_status.csv new file mode 100644 index 00000000..97cf78aa --- /dev/null +++ b/webinterface/minibase/database/company_status.csv @@ -0,0 +1,5 @@ +name,description +Activ,Actively making business +Closed,Out ob business +Bankrupt,Went bankrupt +Ignoring,Company with whom we don’t want to do business diff --git a/webinterface/minibase/database/industry.csv b/webinterface/minibase/database/industry.csv new file mode 100644 index 00000000..72614390 --- /dev/null +++ b/webinterface/minibase/database/industry.csv @@ -0,0 +1,8 @@ +name,description +Industrial,Active in industrial area tend to ask for long life components +Medical,Very long engineering time. Life sensitive devices may be prone to get rejects from certain manufactures +Consumer,High volume and short life cycles +Defence,May not be subjected to the same restrictions as Military but please discuss it with manufacturers. +Military,The most difficult type of customer as many manufacturers does not desire to work with them +Automotive,High volumes High life cycle +Aerospatial,Low volume very long lifecycles and price does rarely play a role diff --git a/webinterface/minibase/database/models.py b/webinterface/minibase/database/models.py index a94770c2..36249d2d 100644 --- a/webinterface/minibase/database/models.py +++ b/webinterface/minibase/database/models.py @@ -253,6 +253,7 @@ class Company(db.Model): employees = db.relationship('Person', backref='employer', lazy=True) projects = db.relationship('Project', backref='belongs_to', lazy=True) notes = db.relationship('Company_note', backref='company', lazy=True) + products = db.relationship('Product', backref='manufacturer', lazy=True) # returns a more information-rich, or official, string representation of an object @@ -334,11 +335,11 @@ class Project_element(db.Model): id = db.Column(db.Integer, nullable=False, primary_key=True) name = db.Column(db.String(100), nullable=False) description = db.Column(db.String(300), nullable=False) - qte_per_project = db.Column(db.Integer, nullable=False, default='0') + qte_per_project = db.Column(db.Integer, nullable=False, default='1') upload_date = db.Column(db.DateTime, nullable=False, default=datetime.utcnow) last_update_date = db.Column(db.DateTime, nullable=False, default=datetime.utcnow, onupdate=datetime.utcnow) - project_id = db.Column(db.Integer, db.ForeignKey('project.id'), nullable=True) + project_id = db.Column(db.Integer, db.ForeignKey('project.id'), nullable=False) owner_id = db.Column(db.Integer, db.ForeignKey('person.id'), nullable=False) status_id = db.Column(db.Integer, db.ForeignKey('project_status.id'), nullable=False) @@ -366,9 +367,11 @@ class Project_status(db.Model): class Product(db.Model): id = db.Column(db.Integer, nullable=False, primary_key=True) + name = db.Column(db.String(100), nullable=False) + ordering_code = db.Column(db.String(100), nullable=False) buy_cost = db.Column(db.Float, nullable=False) - comment = db.Column(db.String(300), nullable=False) - comment_manufacturer = db.Column(db.String(300), nullable=False) + comment = db.Column(db.String(300), nullable=True) + comment_manufacturer = db.Column(db.String(300), nullable=True) currency = db.Column(db.String(50), nullable=False) description = db.Column(db.String(300), nullable=False) last_time_buy_date = db.Column(db.DateTime, nullable=False, default=datetime.utcnow) @@ -377,26 +380,30 @@ class Product(db.Model): minimum_order_quantity = db.Column(db.Integer, nullable=False) minimum_quote_quantity = db.Column(db.Integer, nullable=False) obsolete_date = db.Column(db.DateTime, nullable=False, default=datetime.utcnow) - ordering_code = db.Column(db.String(100), nullable=False) pollution_level = db.Column(db.String(50), nullable=True) - price_change_flag = db.Column(db.Boolean, nullable=False, default='0') - pricing_scheme = db.Column(db.String(300), nullable=False) - proposed_margin = db.Column(db.Float, nullable=False) + price_change_flag = db.Column(db.Boolean, nullable=False, default=False) + proposed_margin = db.Column(db.Float, nullable=True) + production_country = db.Column(db.String(75), nullable=True, default='') upload_date = db.Column(db.DateTime, nullable=False, default=datetime.utcnow) last_update_date = db.Column(db.DateTime, nullable=False, default=datetime.utcnow, onupdate=datetime.utcnow) + classification_id = db.Column(db.Integer, db.ForeignKey('product_classification.id'), nullable=True) + domain_id = db.Column(db.Integer, db.ForeignKey('product_domain.id'), nullable=True) + category_id = db.Column(db.Integer, db.ForeignKey('product_category.id'), nullable=True) + sub_category_id = db.Column(db.Integer, db.ForeignKey('product_sub_category.id'), nullable=True) + status_id = db.Column(db.Integer, db.ForeignKey('product_status.id'), nullable=False) - classification_id = db.Column(db.Integer, db.ForeignKey('product_classification.id'), nullable=False) - packaging_id = db.Column(db.Integer, db.ForeignKey('product_packaging.id'), nullable=False) - physical_id = db.Column(db.Integer, db.ForeignKey('product_physical.id'), nullable=False) + eligibility_id = db.Column(db.Integer, db.ForeignKey('product_eligibility.id'), nullable=False) + + packaging_id = db.Column(db.Integer, db.ForeignKey('product_packaging.id'), nullable=True) + physical_id = db.Column(db.Integer, db.ForeignKey('product_physical.id'), nullable=True) + manufacturer_id = db.Column(db.Integer, db.ForeignKey('company.id'), nullable=False) class Product_status(db.Model): id = db.Column(db.Integer, nullable=False, primary_key=True) name = db.Column(db.String(50), nullable=False) description = db.Column(db.String(300), nullable=False) - upload_date = db.Column(db.DateTime, nullable=False, default=datetime.utcnow) - last_update_date = db.Column(db.DateTime, nullable=False, default=datetime.utcnow, onupdate=datetime.utcnow) products = db.relationship('Product', backref='status', lazy=True) @@ -405,6 +412,18 @@ class Product_status(db.Model): return f"{self.name}" +class Product_eligibility(db.Model): + id = db.Column(db.Integer, nullable=False, primary_key=True) + name = db.Column(db.String(50), nullable=False) + description = db.Column(db.String(300), nullable=False) + + products = db.relationship('Product', backref='eligibility', lazy=True) + + # returns a more information-rich, or official, string representation of an object + def __repr__(self): + return f"{self.name}" + + class Product_classification(db.Model): id = db.Column(db.Integer, nullable=False, primary_key=True) name = db.Column(db.String(50), nullable=False) @@ -417,13 +436,48 @@ class Product_classification(db.Model): return f"{self.name}" +class Product_domain(db.Model): + id = db.Column(db.Integer, nullable=False, primary_key=True) + name = db.Column(db.String(50), nullable=False) + description = db.Column(db.String(300), nullable=False) + + products = db.relationship('Product', backref='domain', lazy=True) + + # returns a more information-rich, or official, string representation of an object + def __repr__(self): + return f"{self.name}" + + +class Product_category(db.Model): + id = db.Column(db.Integer, nullable=False, primary_key=True) + name = db.Column(db.String(50), nullable=False) + description = db.Column(db.String(300), nullable=False) + + products = db.relationship('Product', backref='category', lazy=True) + + # returns a more information-rich, or official, string representation of an object + def __repr__(self): + return f"{self.name}" + + +class Product_sub_category(db.Model): + id = db.Column(db.Integer, nullable=False, primary_key=True) + name = db.Column(db.String(50), nullable=False) + description = db.Column(db.String(300), nullable=False) + + products = db.relationship('Product', backref='sub_category', lazy=True) + + # returns a more information-rich, or official, string representation of an object + def __repr__(self): + return f"{self.name}" + + class Product_packaging(db.Model): id = db.Column(db.Integer, nullable=False, primary_key=True) name = db.Column(db.String(50), nullable=False) description = db.Column(db.String(300), nullable=False) unit = db.Column(db.Integer) quantity = db.Column(db.Integer) - total = db.Column(db.Integer) products = db.relationship('Product', backref='packaging', lazy=True) @@ -436,23 +490,14 @@ class Product_physical(db.Model): id = db.Column(db.Integer, nullable=False, primary_key=True) name = db.Column(db.String(50), nullable=False) description = db.Column(db.String(300), nullable=False) - image_file = db.Column(db.String(20), nullable=False, default='default_company.jpg') + image_file = db.Column(db.String(20), nullable=False, default='default_product.jpg') pitch_x = db.Column(db.Float, nullable=True) pitch_y = db.Column(db.Float, nullable=True) size_x = db.Column(db.Float, nullable=True) size_y = db.Column(db.Float, nullable=True) size_z = db.Column(db.Float, nullable=True) - type = db.Column(db.String(50), nullable=False) products = db.relationship('Product', backref='physical', lazy=True) # returns a more information-rich, or official, string representation of an object def __repr__(self): return f"{self.name}" - -''' - physical (MUL, int) - container (varchar) - favourite (tinyint, NULL, nullable) - manufacturer (varchar) - production_site (varchar) -''' diff --git a/webinterface/minibase/database/note_status.csv b/webinterface/minibase/database/note_status.csv new file mode 100644 index 00000000..1cdc7c79 --- /dev/null +++ b/webinterface/minibase/database/note_status.csv @@ -0,0 +1,5 @@ +name,description +Open,Open and need action +Pending,Pending We are waiting on someone +Done,Done we have solved the issue +Closed,Closed as no action is required anymore diff --git a/webinterface/minibase/database/person.csv b/webinterface/minibase/database/person.csv new file mode 100644 index 00000000..41ae2d9b --- /dev/null +++ b/webinterface/minibase/database/person.csv @@ -0,0 +1,3 @@ +name,last_name,company_id,role_id,competence_id,mail_prof,mail_priv,tel_prof_mobile,street_name,street_no,city,post_code,state,country +Kerem,Yollu,2,3,1,kerem.yollu_at_kynsight.com,kerem.yollu@gmail.com,41789716697,Meierackerstrasse,10,Uster,8610,Zürich,Switzerland +Stefan,Walker,1,2,2,stefan.walker_at_steinel.ch,stefan.walker@gmail.com,41789716697,Almeinderstrasse,10,Einsiedeln,8410,Schwyz,Switzerland diff --git a/webinterface/minibase/database/person_competence.csv b/webinterface/minibase/database/person_competence.csv new file mode 100644 index 00000000..68518a31 --- /dev/null +++ b/webinterface/minibase/database/person_competence.csv @@ -0,0 +1,6 @@ +name,description +Embedded Software,Embedded Software +Embedded Hardware,Embedded Hardware +Hardware,Electronics Hardware +Software,Electronics Software +Mechanical,Mechanical Engineer diff --git a/webinterface/minibase/database/person_role.csv b/webinterface/minibase/database/person_role.csv new file mode 100644 index 00000000..5d6c8b95 --- /dev/null +++ b/webinterface/minibase/database/person_role.csv @@ -0,0 +1,12 @@ +name,description +Engineer,An engineer in any domain +Engineering Manager,Engineering Responsible +Sales,Too much blabla +Sales Manager,Manages sales +Purchasing,Purchases required Material +Purchasing Manager,Manages purchasing team +Purchasing Strategical,Strategically Purchases required Materials on specific domain +CEO,Chief Executive Officer +CTO,Chief Technology Officer +Human Resources,Human Trafikers +Secretary,Knows Everything diff --git a/webinterface/minibase/database/product.csv b/webinterface/minibase/database/product.csv new file mode 100644 index 00000000..a16ee01d --- /dev/null +++ b/webinterface/minibase/database/product.csv @@ -0,0 +1,3 @@ +name,ordering_code,buy_cost,currency,description,lead_time_days,minimum_awarding_quantity,minimum_order_quantity,minimum_quote_quantity,classification_id,domain_id,category_id,sub_category_id,status_id,eligibility_id,packaging_id,physical_id,manufacturer_id +SMT32F031FQH,SMT32F031FQH,3,USD,SMT32F031FQH MCU,64,1000,500,500,1,1,1,1,1,1,1,1,3 +SMT32F456QQA,SMT32F456QQA,10,USD,SMT32F456QQA MCU,180,1000,250,250,2,2,2,2,2,2,2,2,3 diff --git a/webinterface/minibase/database/product_category.csv b/webinterface/minibase/database/product_category.csv new file mode 100644 index 00000000..f47e5e61 --- /dev/null +++ b/webinterface/minibase/database/product_category.csv @@ -0,0 +1,10 @@ +mane,description +Transistor,A transistor is a miniature semiconductor that regulates or controls current or voltage flow in addition amplifying and generating these electrical signals and acting as a switch/gate for them. +Op-amp ,A op-amp is an analog circuit block that takes a differential voltage input and produces a single-ended voltage output +MCU,A microcontroller (μC) or microcontroller unit (MCU) is a small computer on a single integrated circuit. +FPGA,Field Programmable Gate Arrays +CPLD,A Complex Programmable Logic Device +Resistor,Resistor +Connector,Connector +Cable,Cable +Logic,Logic diff --git a/webinterface/minibase/database/product_classification.csv b/webinterface/minibase/database/product_classification.csv new file mode 100644 index 00000000..dc539e18 --- /dev/null +++ b/webinterface/minibase/database/product_classification.csv @@ -0,0 +1,6 @@ +name,description +Passive,Passive components like resistors +Active ,Active components like transistors of op-amps +Electromechanical,Electromechanical components like connectors +Mechanical,Purely Mechanical components like PCB or housings +Hardware,general hardware like Screws and so diff --git a/webinterface/minibase/database/product_domain.csv b/webinterface/minibase/database/product_domain.csv new file mode 100644 index 00000000..f56ecf56 --- /dev/null +++ b/webinterface/minibase/database/product_domain.csv @@ -0,0 +1,8 @@ +name,description +Power,Power Components like IGBTs +Precision,Precision Components like precision op-amps +Ev-Charging,Components for ev-chaging like charging cables +Security,Security Components like e-fuses +Programmable,Programmable Components +High speed,High speed relevant components rj45 and os on +Radio,telecommunication components diff --git a/webinterface/minibase/database/product_eligibility.csv b/webinterface/minibase/database/product_eligibility.csv new file mode 100644 index 00000000..e8453d29 --- /dev/null +++ b/webinterface/minibase/database/product_eligibility.csv @@ -0,0 +1,5 @@ +name,description +Standard,Standard products do not have a pricing plan or scheme +Design Registrable,Products with special pricing schemes (manufacturer rules apply and differs for each component) +Restricted,This product is restricted to o given market or Region in the world +Mutli source,This component is produced by may manufacturers diff --git a/webinterface/minibase/database/product_packaging.csv b/webinterface/minibase/database/product_packaging.csv new file mode 100644 index 00000000..bae36be3 --- /dev/null +++ b/webinterface/minibase/database/product_packaging.csv @@ -0,0 +1,7 @@ +name,description,unit,quantity +Tape,Taped packaging,1,1000 +Reel,Reeled packaging,1,1000 +Tape and Reel,Taped and Reeled packaging,1,5000 +Box,Box,5,1000 +Single,Single Unit,1,1 +Tray,Tray units,1,250 diff --git a/webinterface/minibase/database/product_physical.csv b/webinterface/minibase/database/product_physical.csv new file mode 100644 index 00000000..dbe1314e --- /dev/null +++ b/webinterface/minibase/database/product_physical.csv @@ -0,0 +1,8 @@ +name,description +SOP-18,Small-outline package +CSOP-24,Ceramic small-outline package +DSOP-18,Dual small-outline package +HSOP-32,Thermally-enhanced small-outline package +HSSOP-18,Thermally-enhanced shrink small-outline package +HTSSOP-18,Thermally-enhanced thin shrink small-outline package +MSOP-8,Mini small-outline package diff --git a/webinterface/minibase/database/product_status.csv b/webinterface/minibase/database/product_status.csv new file mode 100644 index 00000000..3bd5e570 --- /dev/null +++ b/webinterface/minibase/database/product_status.csv @@ -0,0 +1,11 @@ +name,description +New,Newly put on data base (Default) +Pending,Registration request sent to Manufacturer and we are waiting for an answer +Accepted,Registration was successful +Denied,Registration was denied ( Negotiation is possible) +Already registered,Competitor has it already registered +Closed,Closed by us +Rejected,Registration was rejected (no Negotiation is possible) +Fulfillment,Only a margin will be given but no registration process +Open For all,Everyone get the same margin for this component +Not Registrable,Not par of a special pricing scheme diff --git a/webinterface/minibase/database/product_sub_category.csv b/webinterface/minibase/database/product_sub_category.csv new file mode 100644 index 00000000..28cb1c7e --- /dev/null +++ b/webinterface/minibase/database/product_sub_category.csv @@ -0,0 +1,12 @@ +name,description +Mosfet NPN,Mosfet NPN Transistor +Mosfet PNP,Mosfet PNP Transistor +Bipolar NPN,Bipolar NPN Transistor +Bipolar NPN,Bipolar NPN Transistor +Rail to Rial,Rail to Rail Op-amp +Cortex M4,Cortex M4 Core MCU +Cortex M0,Cortex M0 Core MCU +Thick film,Thick film Resistor +Thin film,Thin film Resistor +Metal film,Metal film Resistor +Carbon,Carbon Resistor diff --git a/webinterface/minibase/database/project.csv b/webinterface/minibase/database/project.csv new file mode 100644 index 00000000..b0581036 --- /dev/null +++ b/webinterface/minibase/database/project.csv @@ -0,0 +1,3 @@ +name,description,company_id,status_id,industry_id,owner_id,qte_prototype,qte_start,qte_production +STWA-HS,Aküsprühgerät für hautmittel,1,1,1,1,10,5000,10000 +Kolibri,Shisha Heat element,2,1,2,1,5,500,1000 diff --git a/webinterface/minibase/database/project_element.csv b/webinterface/minibase/database/project_element.csv new file mode 100644 index 00000000..63aabcf3 --- /dev/null +++ b/webinterface/minibase/database/project_element.csv @@ -0,0 +1,3 @@ +name,description,qte_per_project,project_id,owner_id,atatus_id +Power Board,Dc-Dc regulation fo batteries,8,1,1,1 +Ui,user input,1,1,1,1 diff --git a/webinterface/minibase/database/project_status.csv b/webinterface/minibase/database/project_status.csv new file mode 100644 index 00000000..e18bec48 --- /dev/null +++ b/webinterface/minibase/database/project_status.csv @@ -0,0 +1,8 @@ +name,description +Open,Ongoing project +Pending,Waiting on something +Closed,Closed project that did not go to production +Production,Is in production +Prototyping,Is in prototyping phase +End Of Life,End of Lifed projects. +Redesign,An old project being redone it must be linked to another project diff --git a/webinterface/minibase/database/utils.py b/webinterface/minibase/database/utils.py index 9738ca57..2f6a7285 100644 --- a/webinterface/minibase/database/utils.py +++ b/webinterface/minibase/database/utils.py @@ -1,7 +1,9 @@ from minibase.database.models import Company, Company_relation, Company_legal_entity -from minibase.database.models import Industry +from minibase.database.models import Industry, Countries from minibase.database.models import Person, Person_role, Person_competence -from minibase.database.models import Countries +from minibase.database.models import Project, Project_element, Product +from minibase import db +from numpy import genfromtxt # Gets the id of company from the formated output defined at models.py for the Company Model @@ -17,6 +19,7 @@ def getPersonRoleId(nameForId): selection = Person_role.query.filter_by(name=nameForId).first() return selection.id + # Gets the id of Person's competence def getPersonCompetenceId(nameForId): selection = Person_competence.query.filter_by(name=nameForId).first() @@ -133,3 +136,167 @@ def country_choices(): choices = Countries.query.all() return choices +################################################################################################### +# CSV manipulation +################################################################################################### + +def openCsv(filename): + data = genfromtxt(filename, + delimiter=',', + skip_header=1, + dtype=None, + encoding='UTF-8') + return data.tolist() + + +def db_add_name_and_description(csv, table): + try: + csv_list = openCsv(csv) + for i in csv_list: + record = table(**{ + 'name': i[0], + 'description': i[1]}) + db.session.add(record) # Add all the records + db.session.commit() # Attempt to commit all the records + except Exception as error: + db.session.rollback() # Rollback the changes on error + print(csv) + print("Error Ocured during <> upload to DB") + print(error) + + +def db_add_company(csv): + try: + csv_list = openCsv(csv) + for i in csv_list: + record = Company(**{ + 'name': i[0], + 'legal_entity_id': i[1], + 'relation_id': i[2], + 'industry_id': i[3], + 'status_id': i[4], + 'website': i[5], + 'street_bill': i[6], + 'street_no_bill': i[7], + 'city_bill': i[8], + 'post_code_bill': i[9], + 'state_bill': i[10], + 'country_bill': i[11], + 'street_ship': i[12], + 'street_no_ship': i[13], + 'city_ship': i[14], + 'post_code_ship': i[15], + 'state_ship': i[16], + 'country_ship': i[17]}) + db.session.add(record) # Add all the records + db.session.commit() # Attempt to commit all the records + except Exception as error: + db.session.rollback() # Rollback the changes on error + print("Error Ocured during <> upload to DB") + print(error) + + +def db_add_person(csv): + try: + csv_list = openCsv(csv) + for i in csv_list: + record = Person(**{ + 'name': i[0], + 'last_name': i[1], + 'company_id': i[2], + 'role_id': i[3], + 'competence_id': i[4], + 'mail_prof': i[5], + 'mail_priv': i[6], + 'tel_prof_mobile': i[7], + 'street_name': i[8], + 'street_no': i[9], + 'city': i[10], + 'post_code': i[11], + 'state': i[12], + 'country': i[13] + }) + db.session.add(record) # Add all the records + db.session.commit() # Attempt to commit all the records + except Exception as error: + db.session.rollback() # Rollback the changes on error + print("Error Ocured during <> upload to DB") + print(error) + + +def db_add_project(csv): + try: + csv_list = openCsv(csv) + for i in csv_list: + record = Project(**{ + 'name': i[0], + 'description': i[1], + 'company_id': i[2], + 'status_id': i[3], + 'industry_id': i[4], + 'owner_id': i[5], + 'qte_prototype': i[6], + 'qte_start': i[7], + 'qte_production': i[8] + }) + db.session.add(record) # Add all the records + db.session.commit() # Attempt to commit all the records + except Exception as error: + db.session.rollback() # Rollback the changes on error + print(csv) + print("Error Ocured during <> upload to DB") + print(error) + + +def db_add_project_element(csv): + try: + csv_list = openCsv(csv) + for i in csv_list: + record = Project_element(**{ + 'name': i[0], + 'description': i[1], + 'qte_per_project': i[2], + 'project_id': i[3], + 'owner_id': i[4], + 'status_id': i[5]}) + db.session.add(record) # Add all the records + db.session.commit() # Attempt to commit all the records + except Exception as error: + db.session.rollback() # Rollback the changes on error + print(csv) + print("Error Ocured during <> upload to DB") + print(error) + +def db_add_product(csv): + try: + csv_list = openCsv(csv) + for i in csv_list: + record = Product(**{ + 'name': i[0], + 'ordering_code': i[1], + 'buy_cost': i[2], + 'currency': i[3], + 'description': i[4], + 'lead_time_days': i[5], + 'minimum_awarding_quantity': i[6], + 'minimum_order_quantity': i[7], + 'minimum_quote_quantity': i[8], + 'classification_id': i[9], + 'domain_id': i[10], + 'category_id': i[11], + 'sub_category_id': i[12], + 'status_id': i[13], + 'eligibility_id': i[14], + 'packaging_id': i[15], + 'physical_id': i[16], + 'manufacturer_id': i[17]}) + db.session.add(record) # Add all the records + db.session.commit() # Attempt to commit all the records + except Exception as error: + db.session.rollback() # Rollback the changes on error + print(csv) + print("Error Ocured during <> upload to DB") + print(error) + + + diff --git a/webinterface/minibase/product/forms.py b/webinterface/minibase/product/forms.py new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/webinterface/minibase/product/forms.py @@ -0,0 +1 @@ + diff --git a/webinterface/minibase/product/routes.py b/webinterface/minibase/product/routes.py new file mode 100644 index 00000000..e69de29b diff --git a/webinterface/minibase/project/routes.py b/webinterface/minibase/project/routes.py index e69de29b..026bad8e 100644 --- a/webinterface/minibase/project/routes.py +++ b/webinterface/minibase/project/routes.py @@ -0,0 +1,37 @@ +from flask import render_template, url_for, flash, redirect, request, Blueprint +from minibase import db +from minibase.config import themeMinibase +from minibase.database.models import Company, Company_legal_entity, Company_relation,Company_status +from minibase.database.models import Industry, Note_status +from minibase.database.models import Person_role, Person_competence +from minibase.database.models import Project_status +from minibase.admin.forms import compLegalEntityForm, compRelationForm, industryRegisterForm,personRoleForm, personCompetenceForm, compStatusForm, noteStatusForm +from minibase.admin.forms import projectStatusForm +# Declaring a blueprint +project = Blueprint('project', __name__) + + +@admin.route("/register", methods=['GET', 'POST']) +def register(): + form = register() + legal_entities = Company_legal_entity.query.order_by(Company_legal_entity.name.asc()) + if form.validate_on_submit(): + companyLegal = Company_legal_entity( + name=form.name.data, + description=form.description.data) + # Here we need to give the id of thr role as this is a foreign key + db.session.add(companyLegal) + db.session.commit() + + flash(f'{"Company Legal Entity registered!"}', 'success') + return render_template('admin/company_register_legal_entity.html', + title='Register Company Legal Entity', + legal_entities=legal_entities, + theme=themeMinibase, + form=form) + + return render_template('admin/company_register_legal_entity.html', + title='Register Company Legal Entity', + legal_entities=legal_entities, + theme=themeMinibase, + form=form) diff --git a/webinterface/minibase/site.db b/webinterface/minibase/site.db index 6ccc2b3c20a3d66a17229604119f10413201aa43..aaf4d73b31fc03fe701162760cd91d80c54826aa 100644 GIT binary patch literal 290816 zcmeI5Yit}@cHgV{6ggtoj5XSpmdjCbI2wtoA=M8yo1EF%*;cD1F%lm`QuEp@xW(?v z?izMiwW_McX$5PWGv0L;c49aNyc;i)7{fT>fch@=h+;g^Gy<@mS+q3Mt?rIt3 zNhKCjzMyG}GW|_OQEnpr1k&@0GF8IgA*5i71v}Ay(Z+l!HjDxT>i?C+E~tOv??l&O z4hfI|36KB@kN^pg011!)36KB@kibVqAaM>&oqciwuQBx-3jT8=0TLhq5+DH*AOR8} z0TLhq5+DH*_;?9aVxvkTJ99X^FKkiAOMSj&)oRTzRO-4>n=e`Qve?s`HFy5)M&-Hm z?sKX1b8BxI+eP<{SIx$q^{l!5_KozKNX@@-`)YOh>h4CR`gZQko6VcWo14v4x=?G? zb6aoU)5kHcnEHnb{&OP%5+DH*AOR8}0TLhq5+DH*AORBiWDz(um>Ba^3%>mSeMSBL zCu@Kl4GE9{36KB@kN^pg011!)36KB@{8=QB7|cq6|CkwpwExGVe{Li|0wh2JBtQZr zKmsH{0wh2JBtQb6U;>o?KfxE5Ln8qaAOR8}0TLhq5+DH*AOR8}fi?jt{}09ARn)(u z-irTs>~JFi5+DH*AOR8}0TLhq5+DH*Ac4n1pfWU~od04zU#MA*DEqIP?r5f^=_S{& zOwDjKTik0JwkT`5*{WN%NGH>oxm0p4mD5tm7qgicliB&jR5rQ17@4#5#laEf?9F`s zx@8KPv;(14_4`6|tlE7v?N$X&|--7*QtI^Z5;7mJPGg{-eDvG~LFT zbi>6_4TEv4y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}^)Eoo3O}^_T(_Gng*riO4*B{y57)6@?nbfpyVOKe?a=LGrf?OfL`Ws0JOcTET)@VwWePPyMhPX(f z+unan!|ajM;(XV(g+nNS!*m4^Jl~%pJ#z; oXiX~cWMep)zMJau(}u3)cmN+PIz(!~_#u&|b&Km&)Xma=0|5g5OaK4? literal 0 HcmV?d00001 diff --git a/webinterface/minibase/templates/admin/company_register_industry.html b/webinterface/minibase/templates/admin/company_register_industry.html deleted file mode 100644 index 3ee67fde..00000000 --- a/webinterface/minibase/templates/admin/company_register_industry.html +++ /dev/null @@ -1,65 +0,0 @@ -{% extends "layout.html" %} -{% block content %} -
-
- {{ form.hidden_tag() }} -
- Register Company Endustry - - -
- {{ form.name.label(class="form-control-label") }} - {% if form.name.errors %} - {{ form.name(class="form-control form-control-lg is-invalid") }} -
- {% for error in form.name.errors %} - {{ error }} - {% endfor %} -
- {% else %} - {{ form.name(class="form-control form-control-lg") }} - {% endif %} -
- - -
- {{ form.description.label(class="form-control-label") }} - {% if form.description.errors %} - {{ form.description(class="form-control form-control-lg is-invalid") }} -
- {% for error in form.description.errors %} - {{ error }} - {% endfor %} -
- {% else %} - {{ form.description(class="form-control form-control-lg") }} - {% endif %} -
- - -
- {{ form.submit(class="btn btn-outline-info") }} -
- -
-
-
-

Existing Industries

- - - - - - - - - {% for item in industries %} - - - - - {% endfor %} - -
NameDescription
{{ item.name }}{{ item.description}}
-
-{% endblock content %} diff --git a/webinterface/minibase/templates/admin/company_register_legal_entity.html b/webinterface/minibase/templates/admin/company_register_legal_entity.html deleted file mode 100644 index a2fe24c7..00000000 --- a/webinterface/minibase/templates/admin/company_register_legal_entity.html +++ /dev/null @@ -1,65 +0,0 @@ -{% extends "layout.html" %} -{% block content %} -
-
- {{ form.hidden_tag() }} -
- Register Company Legal Entity - - -
- {{ form.name.label(class="form-control-label") }} - {% if form.name.errors %} - {{ form.name(class="form-control form-control-lg is-invalid") }} -
- {% for error in form.name.errors %} - {{ error }} - {% endfor %} -
- {% else %} - {{ form.name(class="form-control form-control-lg") }} - {% endif %} -
- - -
- {{ form.description.label(class="form-control-label") }} - {% if form.description.errors %} - {{ form.description(class="form-control form-control-lg is-invalid") }} -
- {% for error in form.description.errors %} - {{ error }} - {% endfor %} -
- {% else %} - {{ form.description(class="form-control form-control-lg") }} - {% endif %} -
- - -
- {{ form.submit(class="btn btn-outline-info") }} -
- -
-
-
-

Existing Legal Entities

- - - - - - - - - {% for item in legal_entities %} - - - - - {% endfor %} - -
NameDescription
{{ item.name }}{{ item.description}}
-
-{% endblock content %} diff --git a/webinterface/minibase/templates/admin/company_register_relation.html b/webinterface/minibase/templates/admin/company_register_relation.html deleted file mode 100644 index b9985672..00000000 --- a/webinterface/minibase/templates/admin/company_register_relation.html +++ /dev/null @@ -1,67 +0,0 @@ -{% extends "layout.html" %} - - -{% block content %} -
-
- {{ form.hidden_tag() }} -
- Register Company Relation - - -
- {{ form.name.label(class="form-control-label") }} - {% if form.name.errors %} - {{ form.name(class="form-control form-control-lg is-invalid") }} -
- {% for error in form.name.errors %} - {{ error }} - {% endfor %} -
- {% else %} - {{ form.name(class="form-control form-control-lg") }} - {% endif %} -
- - -
- {{ form.description.label(class="form-control-label") }} - {% if form.description.errors %} - {{ form.description(class="form-control form-control-lg is-invalid") }} -
- {% for error in form.description.errors %} - {{ error }} - {% endfor %} -
- {% else %} - {{ form.description(class="form-control form-control-lg") }} - {% endif %} -
- - -
- {{ form.submit(class="btn btn-outline-info") }} -
- -
-
-
-

Existing Relations

- - - - - - - - - {% for item in relations %} - - - - - {% endfor %} - -
NameDescription
{{ item.name }}{{ item.description}}
-
-{% endblock content %} diff --git a/webinterface/minibase/templates/admin/person_register_competence.html b/webinterface/minibase/templates/admin/person_register_competence.html deleted file mode 100644 index 4ea4a7b2..00000000 --- a/webinterface/minibase/templates/admin/person_register_competence.html +++ /dev/null @@ -1,65 +0,0 @@ -{% extends "layout.html" %} -{% block content %} -
-
- {{ form.hidden_tag() }} -
- Register Person Competence - - -
- {{ form.name.label(class="form-control-label") }} - {% if form.name.errors %} - {{ form.name(class="form-control form-control-lg is-invalid") }} -
- {% for error in form.name.errors %} - {{ error }} - {% endfor %} -
- {% else %} - {{ form.name(class="form-control form-control-lg") }} - {% endif %} -
- - -
- {{ form.description.label(class="form-control-label") }} - {% if form.description.errors %} - {{ form.description(class="form-control form-control-lg is-invalid") }} -
- {% for error in form.description.errors %} - {{ error }} - {% endfor %} -
- {% else %} - {{ form.description(class="form-control form-control-lg") }} - {% endif %} -
- - -
- {{ form.submit(class="btn btn-outline-info") }} -
- -
-
-
-

Existing Competences

- - - - - - - - - {% for item in competences %} - - - - - {% endfor %} - -
NameDescription
{{ item.name }}{{ item.description}}
-
-{% endblock content %} diff --git a/webinterface/minibase/templates/admin/person_register_role.html b/webinterface/minibase/templates/admin/person_register_role.html deleted file mode 100644 index b6c14921..00000000 --- a/webinterface/minibase/templates/admin/person_register_role.html +++ /dev/null @@ -1,86 +0,0 @@ -{% extends "layout.html" %} -{% block content %} -
-
- {{ form.hidden_tag() }} -
- Register Person Role - - -
- {{ form.name.label(class="form-control-label") }} - {% if form.name.errors %} - {{ form.name(class="form-control form-control-lg is-invalid") }} -
- {% for error in form.name.errors %} - {{ error }} - {% endfor %} -
- {% else %} - {{ form.name(class="form-control form-control-lg") }} - {% endif %} -
- - -
- {{ form.description.label(class="form-control-label") }} - {% if form.description.errors %} - {{ form.description(class="form-control form-control-lg is-invalid") }} -
- {% for error in form.description.errors %} - {{ error }} - {% endfor %} -
- {% else %} - {{ form.description(class="form-control form-control-lg") }} - {% endif %} -
- - -
- {{ form.submit(class="btn btn-outline-info") }} -
- -
-
- -
-
-

Existing Roles

- - - - - - - - - {% for item in roles %} - - - - - {% endfor %} - -
NameDescription
{{ item.name }}{{ item.description}}
-
-

Existing Roles

- - - - - - - - - {% for item in roles %} - - - - - {% endfor %} - -
NameDescription
{{ item.name }}{{ item.description}}
-
- -{% endblock content %} diff --git a/webinterface/minibase/templates/admin/status_register.html b/webinterface/minibase/templates/admin/register_name_and_desc.html similarity index 93% rename from webinterface/minibase/templates/admin/status_register.html rename to webinterface/minibase/templates/admin/register_name_and_desc.html index 55b3c83e..59b04f68 100644 --- a/webinterface/minibase/templates/admin/status_register.html +++ b/webinterface/minibase/templates/admin/register_name_and_desc.html @@ -4,7 +4,7 @@
{{ form.hidden_tag() }}
- Register Status + {{ title }}
@@ -44,7 +44,7 @@
-

Existing Statuses

+

{{ tableTitle }}

@@ -53,7 +53,7 @@ - {% for item in statuses %} + {% for item in dbTable %} diff --git a/webinterface/minibase/templates/layout.html b/webinterface/minibase/templates/layout.html index 257c193a..658b0204 100644 --- a/webinterface/minibase/templates/layout.html +++ b/webinterface/minibase/templates/layout.html @@ -47,13 +47,24 @@ Company Regiters Legal EntityCompany Register Relation - Company Register Industry + Company Register Status - Person Register RolePerson Register Competence + Person Register Role + + Project Register Status + + Product Register Status + Product Register Eligibility + Product Register Domain + Product Register Classification + Product Register Category + Product Register Sub Category + Product Register Physical + Product Register Packaging - Status Register - Countries + Note Register Status + Register IndustryDatabase diff --git a/webinterface/prepare.py b/webinterface/prepare.py index 0ea2ea66..35eaebab 100644 --- a/webinterface/prepare.py +++ b/webinterface/prepare.py @@ -1,9 +1,10 @@ from minibase import db, create_minibase +import minibase.database.utils as dbUtils from minibase.database.models import Person, Person_role, Person_competence, Person_note from minibase.database.models import Company, Company_relation, Company_legal_entity, Company_note, Company_status from minibase.database.models import Status, Industry, Note_status from minibase.database.models import Project, Project_status, Project_element -from minibase.database.models import Product, Product_status, Project_element, Product_physical, Product_packaging +from minibase.database.models import Product, Product_status, Product_physical, Product_packaging, Product_domain, Product_eligibility, Product_category, Product_sub_category, Product_classification app = create_minibase() app.app_context().push() @@ -11,116 +12,21 @@ db.drop_all() db.create_all() - - ################################################################################################### -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) +dbUtils.db_add_name_and_description("minibase/database/industry.csv", Industry) ################################################################################################### -companyStatus1 = Company_status( - name='Activ', - description='Company is active and business is running') -db.session.add(companyStatus1) - -companyStatus2 = Company_status( - name='Bankrupt', - description='Company is bankrupt') -db.session.add(companyStatus2) - -companyStatus3 = Company_status( - name='Closed', - description='Company is closed') -db.session.add(companyStatus3) -company1 = Company( - name='Steinel', - legal_entity_id='1', - relation_id='1', - industry_id='1', - status_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) +dbUtils.db_add_name_and_description("minibase/database/company_relation.csv", Company_relation) -company2 = Company( - name='Kynsight', - legal_entity_id='1', - relation_id='1', - industry_id='1', - status_id='3', - 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) +dbUtils.db_add_name_and_description("minibase/database/company_legal_entity.csv", Company_legal_entity) -noteStatus1 = Note_status( - name='Open', - description='Ongoing') -db.session.add(noteStatus1) +dbUtils.db_add_name_and_description("minibase/database/company_status.csv", Company_status) -noteStatus2 = Note_status( - name='Closed', - description='Ongoing') -db.session.add(noteStatus2) +dbUtils.db_add_company("minibase/database/company.csv") -noteStatus3 = Note_status( - name='Done', - description='Ongoing') -db.session.add(noteStatus3) +dbUtils.db_add_name_and_description("minibase/database/note_status.csv", Note_status) note1 = Company_note( title='Need to find a valid MCU For Stefan', @@ -148,69 +54,12 @@ db.session.add(note2) ################################################################################################### -PeresonRole1 = Person_role( - name='Engineer', - description='Standart Engineer') -db.session.add(PeresonRole1) +dbUtils.db_add_name_and_description("minibase/database/person_role.csv", Person_role) -PeresonRole2 = Person_role( - name='Engineerin Manager', - description='Manager for egineering') -db.session.add(PeresonRole2) +dbUtils.db_add_name_and_description("minibase/database/person_competence.csv", Person_competence) -PeresonRole3 = Person_role( - name='CEO', - description='Chief Executif Operation') -db.session.add(PeresonRole1) +dbUtils.db_add_person("minibase/database/person.csv") -PersonCompethence1 = Person_competence( - name='Embedded Systems', - description='Embedded Systems Engineer') -db.session.add(PersonCompethence1) - -PersonCompethence2 = Person_competence( - name='hardware', - description='Electronics Hardwre specialist') -db.session.add(PersonCompethence2) - -PersonCompethence3 = Person_competence( - name='Software', - description='Software engineer') -db.session.add(PersonCompethence1) - -person1 = Person( - name='Kerem', - last_name='Yollu', - company_id='2', - role_id='3', - competence_id='1', - mail_prof='kerem.yollu@kynsight.com', - mail_priv='kerem.yollu@gmail.com', - tel_prof_mobile='+41789716697', - street_name='Meierackerstrasse', - street_no='10', - city='Uster', - post_code='8610', - state='Zürich', - country='Switzerland') -db.session.add(person1) - -person2 = Person( - name='Stefan', - last_name='Walker', - company_id='1', - role_id='2', - competence_id='2', - mail_prof='stefan.walker@steinel.ch', - mail_priv='stefan.walker@gmail.com', - tel_prof_mobile='+4178956787', - street_name='Alemeinrstrasse', - street_no='10', - city='Einsiedeln', - post_code='8406', - state='Schyz', - country='Switzerland') -db.session.add(person2) note3 = Person_note( title='Birthday of Stefan', @@ -238,55 +87,19 @@ db.session.add(note5) ################################################################################################### +dbUtils.db_add_name_and_description("minibase/database/project_status.csv", Project_status) -projectStatus1 = Project_status( - name='Open', - description='Ongoing') -db.session.add(projectStatus1) +dbUtils.db_add_project("minibase/database/project.csv") -projectStatus2 = Project_status( - name='Closed', - description='Closed') -db.session.add(projectStatus2) +dbUtils.db_add_project_element("minibase/database/project_element.csv") -projectStatus3 = Project_status( - name='Pending', - description='Action Required') -db.session.add(projectStatus3) - - -project1 = Project( - name='STWA-HS', - description='Aküsprühgerät für hautmittel', - company_id='1', - status_id='1', - industry_id='1', - owner_id='1', - qte_prototype='10', - qte_start='5000', - qte_production='10000') -db.session.add(project1) - -element1 = Project_element( - name='Power Board', - description='Dc-Dc regulation fo batteries', - qte_per_project='8', - project_id='1', - owner_id='1', - status_id='1') - -db.session.add(element1) -''' ################################################################################################### -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) -''' - -db.session.commit() +dbUtils.db_add_name_and_description("minibase/database/product_category.csv", Product_category) +dbUtils.db_add_name_and_description("minibase/database/product_classification.csv", Product_classification) +dbUtils.db_add_name_and_description("minibase/database/product_domain.csv", Product_domain) +dbUtils.db_add_name_and_description("minibase/database/product_eligibility.csv", Product_eligibility) +dbUtils.db_add_name_and_description("minibase/database/product_packaging.csv", Product_packaging) +dbUtils.db_add_name_and_description("minibase/database/product_physical.csv", Product_physical) +dbUtils.db_add_name_and_description("minibase/database/product_status.csv", Product_status) +dbUtils.db_add_name_and_description("minibase/database/product_sub_category.csv", Product_sub_category) +dbUtils.db_add_product("minibase/database/product.csv")
{{ item.name }} {{ item.description}}