Skip to content

Instantly share code, notes, and snippets.

@sugiana
Created September 16, 2015 08:50
Show Gist options
  • Save sugiana/8c301f6386a848961a8d to your computer and use it in GitHub Desktop.
Save sugiana/8c301f6386a848961a8d to your computer and use it in GitHub Desktop.
Mengambil nilai colander.Sequence()
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