From 1b8ece350c7e3d39e348b8f5777e2247b53c639d Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Sun, 3 Jul 2016 16:49:29 +0200 Subject: [PATCH] Modele machines/interface complet --- machines/__pycache__/admin.cpython-34.pyc | Bin 696 -> 1201 bytes machines/__pycache__/models.cpython-34.pyc | Bin 939 -> 1888 bytes machines/admin.py | 10 +++- .../migrations/0002_auto_20160703_1444.py | 43 ++++++++++++++++++ .../0002_auto_20160703_1444.cpython-34.pyc | Bin 0 -> 1468 bytes machines/models.py | 16 +++++++ 6 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 machines/migrations/0002_auto_20160703_1444.py create mode 100644 machines/migrations/__pycache__/0002_auto_20160703_1444.cpython-34.pyc diff --git a/machines/__pycache__/admin.cpython-34.pyc b/machines/__pycache__/admin.cpython-34.pyc index 737c879ef5f67027a5ffc1cb9b1ee83e623f78b9..ee624fa2498dd87b53ab6fcee6a2aac1ad9f6828 100644 GIT binary patch literal 1201 zcmbVM&2G~`5FXp>pV&?a6d`d!LgL^{BO#6mg;Q0D<`N{3FP6zJ#gUzaU8hleEic1s z@EChVLh6MF;Ka;2uH2RbV8^4Go!Q;*`(~7%@i6@MZ2#`P4e%X$4?};7pZbA@n}pv> z3@{M@ADG0Tmk2Qt0*_20>Lpq~hUE~110sM+8!Wo1U1A^xx0Vn{cx%Z65t$_(!#o*Y zAy-H&?dH5HR#z59O#5f~;#08_IyyLS_Zy+T)6JVg)p~Hcs)hWRFT{d&cMs~>>h}m8 z0VEr$n4)kfmP7K*6IaKF6JOJPnr)Skn$>vxEU_CCHYP+AL6)uZN@ST1v#eV4ZApHd zWuLcsdC0^iBFcE7Hf6s53i2M_ZOpGHlZ#wVcDvm~is$P|)iP2OL-csFmjRZ#_$dM& zTPD6ih{Tvu!5u?x^FNc6+E!phwrU(&F(Ceb9^= zs3Q!soO3CZl1F%&_PMC@qExfQZMx#d6gU0ih7q5ptNsUK5AhaiK}U?@Su#pTe3`G# z*T;+Xs+PqENmHRc96M1eN&gL!7)y_gPr2}na&610ZKi*cbdq$YW~!)#4x~885f$=J aE!V-zcCKI1tSQ<%wx8OMo%TJl==}{o*6)=7 delta 395 zcmZusyGjE=6umP$JNwA4Pf$_^(J5`Lf@qaO5(R~TU2q27kQcKn5*xwf2f}=Ym7U+< zCrqnN8o$B0yDBLhxQBCJ=bm|u-u%W_lE&|c58WmK_<)ti96xc9KQ9^wPoyOoNFU~a zs0j3Zn0au`p(Q!Uplk#yjf#iRk3e~#ILs&z+^b3qR8W>=2$v#S;$cCo-;={^v~*rT zP#d&+H+R`c*;@R=uBH=nMhs8gfKJUP+1uof`Yv+nAR(HY7kXqa=+=4Y3LQZnSuvd` z!F1$u9V65b5`;?VkF6nFcYwRUikNpqY0Rhq>)Hp diff --git a/machines/__pycache__/models.cpython-34.pyc b/machines/__pycache__/models.cpython-34.pyc index 8529d171862d19bb070b45f338953c584d801b3e..1b4447b2c149bd4773c89e367bb1c8f559d8ec98 100644 GIT binary patch literal 1888 zcmb_dPfrs;6o0dAcf0MD77#^a&=@Ygw22{{jDa*li2RFSO!l%_I|CHAyJe;YA>QhT z@b1a);wPA^CoX;fFZ$kW3$39_jD>mKdGF26o8SBWrr*6%;p^i0n^G3w8;pE#4l6j+ zCo~-Y8AJeW20jBua|soz7lHtn_ab`sg5abVMrlOSa$Q(Uq-Y(+F9p7Q_tnn+i^jgr(lKQo<~$9Eyy`=GnYud}B??U~GkwYG@`kr4I}l#<3AuA_cYvDYjR&C4r_3?eKjNiTJR4 zbomnZnlW$)-xW&vjAjxz#NHt|2n#~gXPE(ek*h{~1YjP73w=bdV2E7=Qr{@yJ>xHt zBvF5~WNOTViX`TnF7zSemr0JiWI9p-K7}1AYj-2=3V9GVg|;_3n=RxbwO{AnMq&I8 zi4*stNas5;=_bu2^0OPer^|*Gau)OC9ZI%)aqFaaYoQQZ|Io>Y_{w1?r?1Mp?&I{0 zeJt(7Vn0EX_Hvr)%C~|{7iBcV7A#4zF|N?YD>(j5NcV81e1OI@Wa*m#05El6^M)3fCLYt1fv8~5zFKnCO<~D$)}mD6+pT*8H+f86q0_h zR*;$elhv4&>v=%3ydZ)PL@)t~Tb#}riA8RisW~Y{_+0?D7^tHdQbdJu0GF@tPj^#%IbA_wdZus$S5g1rlJ=`9W$pq|p4 RR6Aef&q5FLJqB5697lh}=$ex_+t0f8jDLefJ}#Bl3CXq_01fdcAbL33C1G8CyS zDZAFyz4nLnFYTp=o^t6A$R(ZK6>SITp_F#HJDfN3=IxOGM62On_s@UX^Z@>bYnO}b zr#Px#aiaLQAP1OQFt)%_dmC~arVfl9n7S}_jn#p?1!GSmaNUNn56`Fzv<1H-s0GY{ zEPxBd1wb8m+4bIF0_a+@GcR~jQbuxKGZE)i*OuXwry{O-Sya-S;={apo+$t3TF1px z9MvBd00YGi$&GEGUqXsx9bhhGEtSf!pdK&}vNlls`#_OJ2y_K#1awu+7vN41enY#V z!y3>I8ZBj92NpmULWce~jkC7j(#{y+Hqed68B=4T#z;4HiVqCR!DwjO82et-T2Qs9(4%tnN;9h{E zSX~ctuL*JsD8j!0`X4|Wfho2Eif|tf_A412G^Z#1X`Gz!f>kma36K=UP5F@2=bWc4A&7Mujg^DWKuiI zW~`vBNI0v6qpDij(~=!1;=)yyU>B9#SGvoMXRJWclhNU>(aD%mnq(=Q2o+@QV0Z65 zk6`a47RK4f2WGYUqF_fQPG;-TEH2Vg+VoiZx_ErCW&7~w7e_zr9m#ON6pW|Ek9dG# zIm2&&e)0bV@fcI;>FtyLX)O9@XJ>uEcFKMuSpVuf(Z~MUA-Xqq2HTGYj|bn7?cs3P zo1Kdm#tCp#U*i-xfg4z!{lMC=?%;UfnB84<$KSvbDW^w| zwXjCZtxIFie6M;e!oBWJS)u DdWMAT literal 0 HcmV?d00001 diff --git a/machines/models.py b/machines/models.py index 49b794ed..38c5af50 100644 --- a/machines/models.py +++ b/machines/models.py @@ -1,4 +1,5 @@ from django.db import models +from macaddress.fields import MACAddressField from users.models import User @@ -16,4 +17,19 @@ class MachineType(models.Model): return self.type +class Interface(models.Model): + ipv4 = models.OneToOneField('IpList', on_delete=models.PROTECT, blank=True, null=True) + ipv6 = models.GenericIPAddressField(protocol='IPv6') + mac_address = MACAddressField() + machine = models.ForeignKey('Machine', on_delete=models.PROTECT) + details = models.CharField(max_length=255) + name = models.CharField(max_length=255, unique=True, blank=True) + def __str__(self): + return self.name + +class IpList(models.Model): + ipv4 = models.GenericIPAddressField(protocol='IPv4') + + def __str__(self): + return self.type