Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Andrew Buddenberg
gcis-py-client
Commits
53cc4483
Commit
53cc4483
authored
Apr 22, 2014
by
abuddenberg
Browse files
Added date handling for create_dt on Image class
parent
8dd795c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
gcis_clients/domain.py
View file @
53cc4483
...
...
@@ -177,6 +177,9 @@ class Image(GcisObject):
'what_is_the_name_of_the_image_listed_in_the_report'
:
'title'
}
#Private attributes for handling date parsing
self
.
_create_dt
=
None
super
(
Image
,
self
).
__init__
(
data
,
fields
=
self
.
gcis_fields
,
trans
=
self
.
translations
)
#Hack
...
...
@@ -188,6 +191,17 @@ class Image(GcisObject):
#This does not accurately reflect GCIS' data model
self
.
datasets
=
[]
@
property
def
create_dt
(
self
):
return
self
.
_create_dt
@
create_dt
.
setter
def
create_dt
(
self
,
value
):
try
:
self
.
_create_dt
=
parse
(
value
).
isoformat
()
if
value
else
None
except
TypeError
:
self
.
_create_dt
=
None
def
__str__
(
self
):
return
'Image: {id}: {name}'
.
format
(
id
=
self
.
identifier
,
name
=
self
.
title
)
...
...
@@ -367,7 +381,13 @@ class Organization(Gcisbase):
'University of Virginia'
:
'university-virginia'
,
'Miami-Dade Dept. of Regulatory and Economic Resources'
:
'miami-dade-dept-regulatory-economic-resources'
,
'Nansen Environmental and Remote Sensing Center'
:
'nansen-environmental-and-remote-sensing-center'
,
'University of Illinois at Urbana-Champaign'
:
'university-illinois'
'University of Illinois at Urbana-Champaign'
:
'university-illinois'
,
'USGCRP'
:
'us-global-change-research-program'
,
'National Park Service'
:
'national-park-service'
,
'Institute of the Environment'
:
'university-arizona'
,
'USGS'
:
'us-geological-survey'
,
'University of Puerto Rico'
:
'university-puerto-rico'
,
'University of Alaska'
:
'university-alaska'
}
...
...
Write
Preview
Supports
Markdown
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