From 5d3b3b4a822cdbca1aec9ce833a957b6e88fbd06 Mon Sep 17 00:00:00 2001 From: kerem Date: Thu, 12 Oct 2023 15:48:22 +0200 Subject: [PATCH] Started with products --- .../__pycache__/models.cpython-311.pyc | Bin 22924 -> 35190 bytes webinterface/minibase/database/models.py | 159 +++++++++++++++--- .../main/__pycache__/routes.cpython-311.pyc | Bin 2840 -> 3060 bytes webinterface/minibase/main/routes.py | 10 +- webinterface/minibase/site.db | Bin 290816 -> 290816 bytes webinterface/minibase/templates/home.html | 38 ++++- webinterface/prepare.py | 58 +++++-- 7 files changed, 221 insertions(+), 44 deletions(-) diff --git a/webinterface/minibase/database/__pycache__/models.cpython-311.pyc b/webinterface/minibase/database/__pycache__/models.cpython-311.pyc index 6f48fa280def740e02bbb81b00ba160123dbf5a2..929751e54803c05a4cab2193aefb8e28752fd88f 100644 GIT binary patch delta 6548 zcmb_A3rt+smAqjv4D)&OX9k!VhK~Vbz&040fQ=0{#$bkzp|O$ic;JoAcwvUT8Jgg< zX3}OQ$8{Bw%cev{3a;1`wJ0HBtF^XmOw^=x)HZ#udR5VDrFAN`YSm5ZsO+bfw%v2? zd;we8mG)`gnRkBobMCq4oO^GrG5_(hLibIrHa7zv-CxT6^7)r^HpR~~->O(tCeZgtkMp)LQ8X-R|%VVRcgWxi};Rj@Y zNY3u%Ls$Ky5m`SO`|u|CV6ck@RDG1O96J81sGbwoA|IAn*%wh5K@{HbCt#qv z_6^o~gTFO1KP?Q73m zBEz3~wHVr>4`=1_z!fay_6bXQI@N~MZ4Oe#*}*mP$$!?qaDx9b=*zoet4U|gzl0Q1 zV#d5bJQ)gx10&;p+2kMhPxyloZyM2430~P=Lw>yPzYfY-=wM-f4qM2H3y1j=fKq?r z_4xHl0$@ksL*ygdLGn(cX|49a_Y_CcOmgZTC$MKl_N>I7jdnbi5$%X}#9Du4E$GQ* zUT!GK#V%we9~$?Qi|&3h(_mKoO9r{r-A;bh;AFpp13<8b1NaA6iZL>IsDb$o)hBNq zu4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?YaKr&9CbL+44>z#V4`Nr&e(z3Rv@eLbg)oqdgVO{94b2{rQCH_e||R z+CMS12e^mGVKJs)wYQQyke*0?;|?haF-0%cGq%w$8EHPE4PilCWeCD#)5#2a8|ANY zVsQDmL0*ozzk%;VRb&Mc$1Ac{QSU-5AvUEFV82(HQNT=v90JeO8^vSZ43g%uTOj`S zTUF8%mR=NgU%H^u1(U`ubxo>XIzA0?urzB{KV+6H9w!`36XUZ-2sF(Z^@ShUwmB6k z*hM5I7@5LbVn5p(OWTgil3=wsC*=vGN3S Px~P4Yq$fEB=`H>Zfq0X5 diff --git a/webinterface/minibase/database/models.py b/webinterface/minibase/database/models.py index a206a234..a94770c2 100644 --- a/webinterface/minibase/database/models.py +++ b/webinterface/minibase/database/models.py @@ -105,7 +105,8 @@ class Note_status(db.Model): 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) - notes = db.relationship('Company_note', backref='company_note_status', lazy=True) + company_notes = db.relationship('Company_note', backref='company_note_status', lazy=True) + person_notes = db.relationship('Person_note', backref='person_note_status', lazy=True) # returns a more information-rich, or official, string representation of an object def __repr__(self): @@ -131,7 +132,7 @@ class Industry(db.Model): 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) companies = db.relationship('Company', backref='company_industry', lazy=True) - #projects = db.relationship('Project', backref='project_industry', lazy=True) + projects = db.relationship('Project', backref='project_industry', lazy=True) # returns a more information-rich, or official, string representation of an object def __repr__(self): @@ -171,8 +172,8 @@ class Person(db.Model): # One To Many relationships for a company having mutliple elements of the following indexes # Example : One company would/could have many eployees notes = db.relationship('Person_note', backref='person', lazy=True) - # projects = db.Column(db.Integer, db.ForeignKey('project.id'), nullable=True) - # elements = db.Column(db.Integer, db.ForeignKey('project_element.id'), nullable=True) + projects = db.relationship('Project', backref='project_responsible', lazy=True) + elements = db.relationship('Project', backref='element_responsible', lazy=True) class Person_role(db.Model): @@ -206,7 +207,7 @@ class Person_note(db.Model): date_due = db.Column(db.DateTime, nullable=False, default=datetime.utcnow) person_id = db.Column(db.Integer, db.ForeignKey('person.id'), nullable=False) - #status_id = db.Column(db.Integer, db.ForeignKey('note_status.id'), nullable=False) + status_id = db.Column(db.Integer, db.ForeignKey('note_status.id'), nullable=False) # returns a more information-rich, or official, string representation of an object def __repr__(self): @@ -250,6 +251,7 @@ class Company(db.Model): # One To Many relationships for a company having mutliple elements of the following indexes # Example : One company would/could have many eployees 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) @@ -301,31 +303,29 @@ class Company_note(db.Model): ################################################################################################### # Project ################################################################################################### -''' class Project(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(100), nullable=False) description = db.Column(db.String(300), nullable=False) - - #elements = db.relationship('Project_element', backref='project_elements', lazy=True) - - #company_id = db.Column(db.Integer, db.ForeignKey('company.id'), nullable=False) - #industry_id = db.Column(db.Integer, db.ForeignKey('industry.id'), nullable=False) - - project_owner = db.relationship('Person', backref='project_owner', lazy=True) - #buyer = db.relationship('Person', backref='project_buyer', lazy=True) - #responsible = db.relationship('Person', backref='project_manager', lazy=True) date_prototype = db.Column(db.DateTime, nullable=False, default=datetime.utcnow) - qte_prototype = db.Column(db.Integer, nullable=True) + qte_prototype = db.Column(db.Integer, nullable=False) date_start = db.Column(db.DateTime, nullable=False, default=datetime.utcnow) - qte_start = db.Column(db.Integer, nullable=True) + qte_start = db.Column(db.Integer, nullable=False) date_production = db.Column(db.DateTime, nullable=False, default=datetime.utcnow) - qte_production = db.Column(db.Integer, nullable=True) - - status = db.Column(db.String(100), nullable=True, default='') + qte_production = db.Column(db.Integer, 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) + # One To Many relationships where indexes can point o mutiple companies. + company_id = db.Column(db.Integer, db.ForeignKey('company.id'), nullable=False) + status_id = db.Column(db.Integer, db.ForeignKey('project_status.id'), nullable=False) + industry_id = db.Column(db.Integer, db.ForeignKey('industry.id'), nullable=False) + owner_id = db.Column(db.Integer, db.ForeignKey('person.id'), nullable=False) + + # One To Many relationships for a company having mutliple elements of the following indexes + # Example : One company would/could have many eployees + elements = db.relationship('Project_element', backref='project', lazy=True) + # returns a more information-rich, or official, string representation of an object def __repr__(self): return f"{self.name}" @@ -334,20 +334,125 @@ 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') + 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) - industry_id = db.Column(db.Integer, db.ForeignKey('industry.id'), nullable=True) - owner = db.relationship('Person', backref='element_owner', lazy=True) - buyer = db.relationship('Person', backref='element_buyer', lazy=True) - responsible = db.relationship('Person', backref='element_manager', lazy=True) + 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) - qte_per_project = db.Column(db.Integer, nullable=False, default='0') + # returns a more information-rich, or official, string representation of an object + def __repr__(self): + return f"{self.name}" - status = db.Column(db.String(100), nullable=True, default='') +class Project_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) + projects = db.relationship('Project', backref='status', lazy=True) + elements = db.relationship('Project', backref='element_status', lazy=True) + # returns a more information-rich, or official, string representation of an object def __repr__(self): return f"{self.name}" -''' + +################################################################################################### +# Product +################################################################################################### + +class Product(db.Model): + id = db.Column(db.Integer, nullable=False, primary_key=True) + 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) + 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) + lead_time_days = db.Column(db.Integer, nullable=False) + minimum_awarding_quantity = db.Column(db.Integer, nullable=False) + 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) + 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) + + 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) + + +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) + + # 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) + description = db.Column(db.String(300), nullable=False) + + products = db.relationship('Product', backref='classification', 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) + + # returns a more information-rich, or official, string representation of an object + def __repr__(self): + return f"{self.name}" + + +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') + 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/main/__pycache__/routes.cpython-311.pyc b/webinterface/minibase/main/__pycache__/routes.cpython-311.pyc index ee1715c1d6f7c28c94eff6129dac152d7a7a1faf..721b059524ee671977f64565a2f6c6f1906d94b0 100644 GIT binary patch delta 811 zcmaiwOK1~87=UMXce0z!tLgTI*jG$U(vTHwDOIaQN^1*Nya~B1X?B#@Y_`lMw}2i> zK|GXXE&(q+wG`{2=*6>V#g<6JLiHpRPbv1~$(h&?=*3~@+y6cP|JMi32ZOtTfC|{z zJ&j}4Qw{dY1!9NZ37 z547r=UhzWubQASlSZM%8QMjWl!)T}%2cK)5?Cn05Nw;7W_R|k=5=!(G4lAzjF(!^( ztO>VNg@uaj{@!>$FMNmaD%}@Tj7{-DN-B+Z3ISkxN@HEE0xLpAtVsLvj)%4Dp-a+T zi0G!2>~a0;?dnF+E@3AbrU#O7!^=_$e~0kJBoPU5xu0WzV~}Hr!9fgTbP6r0Q6}+d z=NH{X+bbv9NJEPrYw05`{cf$H&mHUYNBaDszR=JY4z>~&+ zF&L}KYw0-mCpeNE6CB+fC0BMzwuK2vGe?BhWtK)i%HN=mZYkpF^po?!iGWoTt$TS zjtO65dxCa9u9z$2T{&l4R<>xi-@G)yA7$3E&2j delta 746 zcmZ{iO=uHA6o6-Tce+2*B(3?WXj_{^O+rx=e-N!d;K3e(y%dCiEJ=2hXg1N=gAR%V&ou4tsAacGDBOdTP`h8j1C#J$Aa>9r;w#rwdcsF5S<>zns=)WI~tvhK0 eKfz-p`BOzoa)cA|Kl}XHSPPd@z~~E2-s~SHL9509 diff --git a/webinterface/minibase/main/routes.py b/webinterface/minibase/main/routes.py index f407ea3e..8f9db33e 100644 --- a/webinterface/minibase/main/routes.py +++ b/webinterface/minibase/main/routes.py @@ -1,5 +1,5 @@ from flask import render_template, request, Blueprint -from minibase.database.models import Company, Post, Company_note +from minibase.database.models import Company, Post, Company_note, Person_note from minibase.config import themeMinibase from minibase import db @@ -16,8 +16,14 @@ def home(): posts = Post.query.order_by(Post.date_posted.asc()).paginate(per_page=2) companies = Company.query.order_by(Company.name.asc()) companie_notes = Company_note.query.order_by(Company_note.title.asc()) + person_notes = Person_note.query.order_by(Person_note.title.asc()) # (HTML) Renders the template for templates/home.html - return render_template('home.html', theme=themeMinibase, posts=posts, companies=companies, companie_notes=companie_notes) + return render_template('home.html', + theme=themeMinibase, + posts=posts, + companies=companies, + companie_notes=companie_notes, + person_notes=person_notes) @main.route("/about") diff --git a/webinterface/minibase/site.db b/webinterface/minibase/site.db index 18414f4d6d09d02af5e62f4b7d5a2224b0cc7a6c..6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*z3+(T@>&WvJB)mSr`$Y6 zi~xWhrRdSkl1N`Eod6#dd`Sk`f^XS{ud@p;%L7wq^9k`bt{Y)l7XGA}>bV4I!!ZRxLJN`Qst-5w6!)3szwb(uli+azKQl3I4J9E}dQi zH`Ox?&_ebTVXh81PdU`)3RCNX6|mIh=Nm2HY4Nu^vi_LNz6GV8Kcx|Qv;n^ndfDyz&W z=fa}RteTpGnH04&a&pLSHcVyn%Bo@NrAsGYu$y(o$*e1Sx$whN!;mG_p|UJX<@0>B z!tVzN-0*y{-uZuM|6*N}%+0fPO_p#V3)lA7=2vH$?BHgaDhLZ)L)|pz9}>{9HJaZWi;e7*|eW%7mZ@9l7-g^nhm!Jz;HVh#=y#yINxD2f=(=(ID=kl{} zPfSln_l~`sN~gy0mnG=Ke_w<;A$lM&o*Ye#_sNnJ$J{U+#MNa;;#wMde7^X`mZd|& z`T(TcwouqcM2L1`8?lw>z$ucSlPIK}&oM$FR6-+kB22UrAtLyM09{4GPYC!h0R0{p zg|3z21AloBAK2pKQk)p_PYG8Ve{Jk}W}pt;yP?FTE)?TC=J)k`!(CnQ?(2_dDKk5l zotc=)<}sO&0S}WbxU>+iIZ@8@u&I-0# zkIRHAcdo-8xBJ7EK0KX-2m~sZlW>BEUW|=G5Jc2Rq3SNCb|9~T3VyUSxClM?jRw2u zg@0;r4!ZFJ9oC==(*|6J?fB4upT8==Uw&J6n6gvfk)q)CMY!2p+p>nm9QvP>%0G+n zwY|2%6o+;o#lqh{fic@i3|ZGUZwFEgoct8>dTk`SWmyhxNn!%6r`x~Ei64nO{i`d* z&;1QY-Sr$O$wUJ0uEDcPt&(Xe`sS5LFfK+Tb|+cmoN=kcD)Z(AY2t%-}S{xpbC)t525H~PXGV_ diff --git a/webinterface/minibase/templates/home.html b/webinterface/minibase/templates/home.html index aedd9ee2..09f85ef9 100644 --- a/webinterface/minibase/templates/home.html +++ b/webinterface/minibase/templates/home.html @@ -2,9 +2,8 @@ {% block content %}
-
+

Overwiev

-

Companies

@@ -34,6 +33,7 @@
+

Notes

@@ -63,6 +63,38 @@
+ + +
+

Notes

+ + + + + + + + + + + + + + {% for elem in person_notes %} + + + + + + + + + + {% endfor %} + +
PersonTitleContentStatusPriorityDate PostedDue Date
{{ elem.person.name }}{{ elem.title }}{{ elem.content }}{{ elem.person_note_status }}{{ elem.priority }}{{ elem.date_posted.strftime('%d-%m-%Y') }}{{ elem.date_due.strftime('%d-%m-%Y') }}
+
+ +
-
{% endblock content %} diff --git a/webinterface/prepare.py b/webinterface/prepare.py index 10839c31..0ea2ea66 100644 --- a/webinterface/prepare.py +++ b/webinterface/prepare.py @@ -2,7 +2,8 @@ from minibase import db, create_minibase 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 +from minibase.database.models import Project, Project_status, Project_element +from minibase.database.models import Product, Product_status, Project_element, Product_physical, Product_packaging app = create_minibase() app.app_context().push() @@ -215,34 +216,67 @@ note3 = Person_note( title='Birthday of Stefan', content='Congratulate Stefan for his birthday', priority='5', - person_id='2') - #status_id='1') + person_id='2', + status_id='1') db.session.add(note3) note4 = Person_note( title='Wake Up kerem', content='He is still slepping', priority='10', - person_id='1') - #status_id='3') + person_id='1', + status_id='3') db.session.add(note4) note5 = Person_note( title='Research for Stefan', content='He is looking for a new job', priority='8', - person_id='2') - #status_id='2') + person_id='2', + status_id='2') db.session.add(note5) -''' +################################################################################################### + + +projectStatus1 = Project_status( + name='Open', + description='Ongoing') +db.session.add(projectStatus1) + +projectStatus2 = Project_status( + name='Closed', + description='Closed') +db.session.add(projectStatus2) + +projectStatus3 = Project_status( + name='Pending', + description='Action Required') +db.session.add(projectStatus3) + + project1 = Project( - name='Stwa-Hs', - description='Akku Sprüh Gerät für hautmittel!') -# buyer='2', -# responsible='1') + 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',