Using FileBrowser in a Form

80 views
Skip to first unread message

Kusako

unread,
Jun 25, 2009, 4:24:13 AM6/25/09
to Django FileBrowser
Hi-

is it possible to use the FileBrowser in a form (instead of a model)?
It still is in the admin site, I just don't have a model, because the
file path has to be sent to web service and not stored to the databse.

Thanks for your help,

-markus

patrickk

unread,
Jun 25, 2009, 4:56:20 AM6/25/09
to Django FileBrowser
you could try the FileBrowseFormField from fields.py - I´ve never done
it, but basically it should work. as you can see from the code, it
just extend a regular CharField.

patrick

Kusako

unread,
Jun 25, 2009, 5:30:47 AM6/25/09
to Django FileBrowser
Hi Patrick-
thanks for the help.
Actually this was what I tried first, after a quick glance at the
sources. Unfortunately it raises a ViewDoesNotExist Excpetion with a
rather unsepcific Error was: 'NoneType' object has no attribute 'get':

Traceback:
File "C:\PROGRA~3\Python25\lib\site-packages\django\core\handlers
\base.py" in get_response
77. request.path_info)
File "C:\PROGRA~3\Python25\lib\site-packages\django\core
\urlresolvers.py" in resolve
181. sub_match = pattern.resolve(new_path)
File "C:\PROGRA~3\Python25\lib\site-packages\django\core
\urlresolvers.py" in resolve
124. return self.callback, args, kwargs
File "C:\PROGRA~3\Python25\lib\site-packages\django\core
\urlresolvers.py" in _get_callback
136. raise ViewDoesNotExist, "Tried %s in module %s.
Error was: %s" % (func_name, mod_name, str(e))

Exception Type: ViewDoesNotExist at /admin/siminabox/load_oar/
Exception Value: Tried load_oar in module admin_views. Error was:
'NoneType' object has no attribute 'get'

-markus

patrickk

unread,
Jun 25, 2009, 7:50:27 AM6/25/09
to Django FileBrowser
unfortunately, I´m not much help here. all I can say is, that it
should be easy to find what´s wrong with a bit of debugging. try some
print-statements when running the dev-server. e.g., try to output
"initial_directory" and other variables.

the only get-method used in this context is in the
filebrowsewidget ...

patrick
Reply all
Reply to author
Forward
0 new messages