From 8efe3c358c8d4b4deacc9c43ac685f08663e97d5 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Sun, 3 Jul 2016 03:12:41 +0200 Subject: [PATCH] =?UTF-8?q?Cr=C3=A9e=20l'application=20topologie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- machines/models.py | 3 ++ topologie/__init__.py | 0 topologie/__pycache__/__init__.cpython-34.pyc | Bin 0 -> 118 bytes topologie/__pycache__/admin.cpython-34.pyc | Bin 0 -> 1135 bytes topologie/__pycache__/models.cpython-34.pyc | Bin 0 -> 1670 bytes topologie/admin.py | 20 ++++++++++ topologie/migrations/0001_initial.py | 35 ++++++++++++++++++ .../migrations/0002_auto_20160703_0103.py | 19 ++++++++++ topologie/migrations/0003_link.py | 24 ++++++++++++ topologie/migrations/__init__.py | 0 .../__pycache__/0001_initial.cpython-34.pyc | Bin 0 -> 1050 bytes .../0002_auto_20160703_0103.cpython-34.pyc | Bin 0 -> 669 bytes .../__pycache__/0003_link.cpython-34.pyc | Bin 0 -> 1005 bytes .../__pycache__/__init__.cpython-34.pyc | Bin 0 -> 129 bytes topologie/models.py | 29 +++++++++++++++ topologie/tests.py | 3 ++ topologie/views.py | 3 ++ 17 files changed, 136 insertions(+) create mode 100644 topologie/__init__.py create mode 100644 topologie/__pycache__/__init__.cpython-34.pyc create mode 100644 topologie/__pycache__/admin.cpython-34.pyc create mode 100644 topologie/__pycache__/models.cpython-34.pyc create mode 100644 topologie/admin.py create mode 100644 topologie/migrations/0001_initial.py create mode 100644 topologie/migrations/0002_auto_20160703_0103.py create mode 100644 topologie/migrations/0003_link.py create mode 100644 topologie/migrations/__init__.py create mode 100644 topologie/migrations/__pycache__/0001_initial.cpython-34.pyc create mode 100644 topologie/migrations/__pycache__/0002_auto_20160703_0103.cpython-34.pyc create mode 100644 topologie/migrations/__pycache__/0003_link.cpython-34.pyc create mode 100644 topologie/migrations/__pycache__/__init__.cpython-34.pyc create mode 100644 topologie/models.py create mode 100644 topologie/tests.py create mode 100644 topologie/views.py diff --git a/machines/models.py b/machines/models.py index d93324dd..49b794ed 100644 --- a/machines/models.py +++ b/machines/models.py @@ -14,3 +14,6 @@ class MachineType(models.Model): def __str__(self): return self.type + + + diff --git a/topologie/__init__.py b/topologie/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/topologie/__pycache__/__init__.cpython-34.pyc b/topologie/__pycache__/__init__.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..74baff21314a8c84adcec228a88bc3ed8479acba GIT binary patch literal 118 zcmaFI!^@?dToKLy1dl-k3@`#24nSPY0whux7=kq!{Z=v*frJsnFJ=9*#3KFj@^by6 tRHJq)%)HE!_;|g7%3B;Zx%nxjIjMFa&BZ{>008lH8PEU# literal 0 HcmV?d00001 diff --git a/topologie/__pycache__/admin.cpython-34.pyc b/topologie/__pycache__/admin.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6966844f5da0d1bf82c3029b4bdcd381acf8da11 GIT binary patch literal 1135 zcmb_b&2G~`5T3Qyzi~?;2nmS;S6>>5GeY6iONkIYAo*gs*(Gf7Pgpw*&9%HtABGp$ zE2my~03;-4)=897IDoLdquH6+*>AoXe@hPH>AO#Fe=vZru=jA($GF-rC_uhbxQ<;6(T!0_zC&93eWwKRF^0 zu{{y*ortU+!+ZeJ1sTAV1B`C!O&nzSiwS{5)+7dSmL@k?5~R#{g{V}0gQY|28veS` zo#AhqrZW6g)gPu5wtaSdJVJ{Eq5)aSkO-eBz*^7Jz(kbeC1o|?`BIfa)idL_E7eWk z8@`|m0wKFXmF*s`!x6SKB4>upTRO_=9(QOP_vah_L=SeB$GdH!)(lp9Y{sFA=+qt$9P((+j|>Y7DUHZvthw({e}r4BIG$JIJ05@z?e3Mc!R z0`3%!UB|**EZj2@(bgBvHL7}mM<%JWw!6K8bb=0jK;n?ZJrX;>y>_2$4^Tw7w!mor z_rPo#J*0&H1red&Ai4#{Mf;e1cUZ!|0$Jk7l5Zj!E6b9OF?b)ByJ`JD^YsuD5}8}R zXg^7l>`=^$de$6Io4V8LTvI=dkCPYq2S|g_vqzZ>Z&fEvsO1c2 dP3qsZ%!JST0ewMtwA9oi=ZW*!?cX6AvY%3`+OYrt literal 0 HcmV?d00001 diff --git a/topologie/__pycache__/models.cpython-34.pyc b/topologie/__pycache__/models.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ebba5e08eed33ef9d9aba8aeb1367818b96e39d0 GIT binary patch literal 1670 zcma)6%}(1u5T3Oi=Lc7%&=&fmsy+HpBK2HVNT{HykfMTA$rmf&ZQ|hAuyzVWz0sHH z!}JCA+7p*P0GIZgbugv^2`4+*opE-)`R3=3cdv6HPrm%JiGEY0#OHtDpnl(d%q89D=?Q=LGUubun zMKa0v`FQy>uvx{*k02y50N@EMk~WRt4oA2r5x^rfF7_0_Nwsg)-n6Mict%#xzK-h5 zqM*ZgqBi3U<|yg_+njc`Ggau$xPKBRG947d^A3=l|Ao+vy`-NW>|O(G!?22#KZd9S z1~cFY0Cs$L+U8qVwq()Qt-VQ{L~%OMZhjmW`$O#9o-7Uv_F<% zs5@Z@+9nC_y)ZnQ^plz8{v?f$CNeCtfh>kn{UmiCn2fl1)&162-Q(lqu99!EZjl{k zNj8XOx6HxH;i+~QUYkR)AUvTS;AdYz@Wa0x>l#+xg(!%=6O9C&At!>CW@lsvhnm7R ziXGqTP3@PjUm_SgFO+KG3dPN)IAoAUbokVeYGCTBr=|~_aQChK+aT^U)_ulbe!ZSSoM(qUy)Ys7>DA>dFAZJ z6AQw_XW3e`jb$Io>ZvMt6RLVa)GHXBgv#K$EbI8PvQacMJv!*JiBR8V<7nq|mW`Ez zi?f9bSTWSGn?I>L53$=(tEo>7pQ^ER*b#}c{vEI6g zb@hlZT4M2(#jSKM!^$-090iC3m5O!Oh-BL;Rz8BbjYuZ7feI6WYZ@O^U3NYAV}h%J z08=?ez%jnC3LXnrGXV2oHUl=}^uT0Rx3e_FkdlS`pY{@Py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)1iEG628U$?3fc!2&4a`JqxaiKI+9bIKs$CnKs`rJYyR~6r>W|not^a++mQX6Qv0`K+Q$pp z#1Sq|deaNlz|2A!{rLFIyv&mLc)fzkTO2mI`6;D2sdgZ9ih-B` E08zjmM*si- literal 0 HcmV?d00001 diff --git a/topologie/models.py b/topologie/models.py new file mode 100644 index 00000000..60060c83 --- /dev/null +++ b/topologie/models.py @@ -0,0 +1,29 @@ +from django.db import models + +class Port(models.Model): + building = models.CharField(max_length=10) + switch = models.IntegerField() + port = models.IntegerField() + details = models.CharField(max_length=255, blank=True) + + class Meta: + unique_together = ("building", "switch", "port") + + def __str__(self): + return str(self.building) + " - " + str(self.switch) + " - " + str(self.port) + +class Room(models.Model): + details = models.CharField(max_length=255, blank=True) + room = models.CharField(max_length=255, unique=True) + + def __str__(self): + return str(self.room) + +class Link(models.Model): + port = models.ForeignKey('Port', on_delete=models.PROTECT) + details = models.CharField(max_length=255, blank=True) + #port_linked = models.ForeignKey('Port', on_delete=models.PROTECT, blank=True) + room = models.ForeignKey('Room', on_delete=models.PROTECT, blank=True) + + def __str__(self): + return str(self.port) diff --git a/topologie/tests.py b/topologie/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/topologie/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/topologie/views.py b/topologie/views.py new file mode 100644 index 00000000..91ea44a2 --- /dev/null +++ b/topologie/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here.