From 04e28f4f51c74df9807c4e8b4107985a72bcae76 Mon Sep 17 00:00:00 2001 From: GokhanDuzel Date: Wed, 6 Dec 2023 19:17:14 -0500 Subject: [PATCH] Builded CarMake and CarModel models --- server/db.sqlite3 | Bin 131072 -> 143360 bytes server/djangoapp/admin.py | 15 +++++++++++++-- server/djangoapp/models.py | 31 +++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/server/db.sqlite3 b/server/db.sqlite3 index 24221ca598cc68a7ce87ca2a53d81884b74ecaa4..1d34d38a3b8358ac021922ea16046f98f08270c6 100644 GIT binary patch delta 4324 zcmai1e{34p9lysNKF;>tvyBOfZOj?$B+RjW2OI}9Rfc2Y&^Z3lICh#Wbue6P91Ilj zuT&AC+cary*Q97;nzVLl)juk2nk=`q)^%DoO=_i0Yt^mQRyj%4N{iM_>a_jQO8vF> zj>CZ6ZeX7E{k-pe-sgSad*AoHt5*$I-!)uoZ?+Qzfq&)CiR*`4z`lOrX=vzV5ol~^ zE6`0nx`wv({6FiP+(tcN?FmE|!il+LIF%~gu$r1Zywl}(`TU}@UvdgQQ7nwNcWbEZ zcS`-D;1S(Y;oI%LT2yekJcZZW#cEXW%Cgs6Xzp;=pt9t1Itx=B-Wt^76l71~=?=LD zb<2|IEZprlT!T7g3HiD$&Kgv7VTKips|FRkqQ_VGrKL)lyWi&%B)3rb%u=Ncp|VSs zrNUrm)!Yy&xn!qMcx(silD$aT+nxT(Xvi0Z49%^}>a>(1iDKsN_j)~&+b58E!rT)G zM;Bv>s#upiJTm$geqiM*Y+}FcbV`D&@T&Eoqs%7C{cf+v?eXCSHNbNK{vG}qrs1#Q zqwq)Yd3bI;e-w6@nn;n^Uf7vPIK7yRDsi)(bb(^mJTQ(KSeEQEgqO1OGjr+WQmT<7 zt&D0eWt2403dw;T1mR1Hv5xEos#8iyFUB&NSTeyINwSYA{B>aeK4ZPA=|KYi20jIU z2Cu;k{0CC^;ClWTEIfLo6&MOXInt4%S;}NmdGJ_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- zzU-yrt5*M3R76J2k$JN{8FE;~j3eo#tfsI~q#{<%=}ueC9x}HX@@?cwOBTwvO*;Hh z#wutu0cUE*Z%l5`gkxS@h;3&VS5sR{hGj132qsp&A$vyHbS>M1+p+C=i*buEEgFpB zEX_E%!j8%2D7#Ayqe5A|jk0B&fxK9lkH=;s%i-OEDOE5FI=6i`IlHuOXV-N*1ixU| zOa?lAYOX7ipeaUo@uaj-P8o)d(kX$~oyG!$VuH@vo^?cDs7-C7 zCUm^cn~fF{1;5){i2IB2*nv;~FPqB$rBDBxO);0gKt)Y<^Olt_nhEz(Y-7%4+g=P< zQia(>E|^WNZl>4P@_xH^Es*rwgS{(nNP8;h2D*kL8c@m9zzR6A|H>TD zV^Z+mUgaj(e`g6e0Qkez%Io`|nn2GH4Q7-KNC)0jY3_mX!oys zz^ShN*F^B9wDzzGytKct2%Z3-=NfqL3+oTA_dR(9XGWCgC1_G!gx`T~sE11RZS~L9 zPpi{vi(0E5Q2kT&hU#akODczIQu#0C+sYS|-&UUAtDIJLpB#}%z_dnQd+-Jr?HWel z3@NXz-T)I_M_Zs+2SW%<&d6)e-2lhBjv%1nWVKgsfCst;5g@-Jt9^6>e7S3&1;%e8 z(2u|jE32*D1XI&}2#lRN>~syT_;|e`9IyAV;}AtBXYkrHH<7%$1ztwLph94D`cAi7 zzYMj4jjK*5QEcMOLFj`n0Picf2>+LvyjXX|N!uOcw5Kw#|DVe@+++qmv@ zH;T^C(%OYvV6v+VfwP>n_TyV<8sshTr#g@!aE6rDHuvv62 Create a Car Model model `class CarModel(models.Model):`: @@ -19,6 +25,31 @@ # - Year (DateField) # - Any other fields you would like to include in car model # - __str__ method to print a car make object +class CarModel(models.Model): + + SEDAN = 'sedan' + SUV = 'suv' + WAGON = 'wagon' + COUPE = 'coupe' + CABRIO = 'cabrio' + + CAR_TYPES = [ + (SEDAN, 'Sedan'), + (SUV, 'SUV'), + (WAGON, 'Wagon'), + (COUPE, 'Coupe'), + (CABRIO, 'Cabrio') + ] + + + car_make = models.ForeignKey(CarMake, on_delete=models.CASCADE) + name = models.CharField(max_length=100) + dealer_id = models.IntegerField() + car_type = models.CharField(max_length=20, choices=CAR_TYPES, default=SEDAN) + year = models.DateField() + + def __str__(self): + return f"name:{self.name} type:{self.car_type} make:{self.car_make.name}" # Create a plain Python class `CarDealer` to hold dealer data