Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1a0c4303
authored
Mar 11, 2015
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: add created and modified to disk form
https://docs.djangoproject.com/en/1.7/ref/models/fields/#editable
parent
7ff1ff3f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
circle/dashboard/forms.py
+5
-0
circle/dashboard/views/storage.py
+3
-0
No files found.
circle/dashboard/forms.py
View file @
1a0c4303
...
...
@@ -1607,11 +1607,16 @@ class DataStoreForm(ModelForm):
class
DiskForm
(
ModelForm
):
created
=
forms
.
DateTimeField
()
modified
=
forms
.
DateTimeField
()
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
DiskForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
for
k
,
v
in
self
.
fields
.
iteritems
():
v
.
widget
.
attrs
[
'readonly'
]
=
True
self
.
fields
[
'created'
]
.
initial
=
self
.
instance
.
created
self
.
fields
[
'modified'
]
.
initial
=
self
.
instance
.
modified
class
Meta
:
model
=
Disk
circle/dashboard/views/storage.py
View file @
1a0c4303
...
...
@@ -72,3 +72,6 @@ class DiskDetail(SuperuserRequiredMixin, UpdateView):
model
=
Disk
form_class
=
DiskForm
template_name
=
"dashboard/storage/disk.html"
def
form_valid
(
self
,
form
):
pass
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