You can always define
def UploadField(*a,**b):
b['uploadfolder'] = request.folder
return Field(*a,**b)
db.define_table( UploadField(...))
I often define
def HiddenField(*a,**b):
b['readable'] = b['writable'] = False
return Field(*a,**b)
def ReadonlyField(*a,**b):
>
> We could use current.request.folder but we would have to couple the dal
> code to current. that is something we avoided to far.
>
I don't think it is necessary to use current in dal just for this. I don't
mind adding uploadfolder on each Field(...) call, I just was curious why it
was neede
We could use current.request.folder but we would have to couple the dal
code to current. that is something we avoided to far.
On Thursday, 5 September 2013 11:31:36 UTC-5, Alan Etkin wrote:
>
> > In that case, how will you determine the absolute folder path?
>
> It seems there's no way, unless th
> In that case, how will you determine the absolute folder path?
It seems there's no way, unless the field class reads request.folder which
will be not always available.
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from
I guess the Field class doesn't have knowledge of the filesystem. When
Field() is used inside of define_table(), it figures out the folder
location from db._adapter.folder, but there is no db._adapter when using
Field() within SQLFORM.factory(). In that case, how will you determine the
absolute
No objection.
On Wednesday, 4 September 2013 16:27:35 UTC-5, Alan Etkin wrote:
>
> Is this bug or feature?
>
> def myaction():
> form = SQLFORM.factory(Field("myupload", "upload"))
> if form.process().accepted:
> print form.vars
> return dict(form=form)
>
> On submission it pro
6 matches
Mail list logo