Created
September 16, 2015 08:50
-
-
Save sugiana/8c301f6386a848961a8d to your computer and use it in GitHub Desktop.
Mengambil nilai colander.Sequence()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_seq(controls, name): | |
start = False | |
key_value = ':'.join([name, 'sequence']) | |
r = [] | |
for key, value in controls: | |
if key == '__start__' and value == key_value: | |
start = True | |
continue | |
if key == '__end__' and value == key_value: | |
start = False | |
if start: | |
r.append(value) | |
return r | |
""" | |
controls = request.POST.items() | |
name adalah 'daftar_file' sesuai saat: | |
daftar_file = colander.SchemaNode(colander.Sequence(), ...) | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment