Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Nounous
re2o
Commits
2cb9ccd0
Commit
2cb9ccd0
authored
Jul 05, 2016
by
chirac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Attribut active/inactive sur une machine
parent
036c4fc7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
3 deletions
+28
-3
cotisations/admin.py
cotisations/admin.py
+2
-2
machines/admin.py
machines/admin.py
+1
-1
machines/migrations/0013_auto_20160705_1014.py
machines/migrations/0013_auto_20160705_1014.py
+24
-0
machines/models.py
machines/models.py
+1
-0
No files found.
cotisations/admin.py
View file @
2cb9ccd0
...
...
@@ -3,10 +3,10 @@ from django.contrib import admin
from
.models
import
Facture
,
Article
,
Banque
,
Paiement
,
Cotisation
class
FactureAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
'user'
,
'paiement'
,
'name'
,
'number'
,
'date
'
)
list_display
=
(
'user'
,
'paiement'
,
'name'
,
'number'
,
'prix'
,
'date'
,
'valid
'
)
class
ArticleAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
'name'
,
'prix'
,
'cotisation'
)
list_display
=
(
'name'
,
'prix'
,
'cotisation'
,
'duration'
)
class
BanqueAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
'name'
,)
...
...
machines/admin.py
View file @
2cb9ccd0
...
...
@@ -3,7 +3,7 @@ from django.contrib import admin
from
.models
import
Machine
,
MachineType
,
IpList
,
Interface
class
MachineAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
'user'
,
'name'
,
'type'
)
list_display
=
(
'user'
,
'name'
,
'type'
,
'active'
)
class
MachineTypeAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
'type'
,)
...
...
machines/migrations/0013_auto_20160705_1014.py
0 → 100644
View file @
2cb9ccd0
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'machines'
,
'0012_auto_20160704_0118'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'machine'
,
name
=
'active'
,
field
=
models
.
BooleanField
(
default
=
True
),
),
migrations
.
AlterField
(
model_name
=
'interface'
,
name
=
'dns'
,
field
=
models
.
CharField
(
max_length
=
255
,
unique
=
True
,
help_text
=
'Obligatoire et unique, doit se terminer en .rez et ne pas comporter de points'
),
),
]
machines/models.py
View file @
2cb9ccd0
...
...
@@ -8,6 +8,7 @@ class Machine(models.Model):
user
=
models
.
ForeignKey
(
'users.User'
,
on_delete
=
models
.
PROTECT
)
type
=
models
.
ForeignKey
(
'MachineType'
,
on_delete
=
models
.
PROTECT
)
name
=
models
.
CharField
(
max_length
=
255
,
help_text
=
"Optionnel"
,
blank
=
True
,
null
=
True
)
active
=
models
.
BooleanField
(
default
=
True
)
def
__str__
(
self
):
return
str
(
self
.
user
)
+
' - '
+
str
(
self
.
id
)
+
' - '
+
str
(
self
.
name
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment