[web2py] Re: web2py irc channel

2010-01-26 Thread Mengu
Right now, there are 16 web2py devs on irc.freenode.net :)

On 25 Ocak, 21:14, pistacchio  wrote:
> hi,
> seen how active the community around web2py is (often a post on this
> newsgroup is answered in less than a hour), i've thought that maybe a
> irc channel could provide an even more "online" feedback for newcomers
> or people looking for simple, quick answer while programming (for
> example, the other day i asked about the way to retrieve the id of a
> just inserted record and the answer was as simple as form.vars.id).
>
> at the moment i'm hanging around #web2py on irc.esper.net. maybe we'll
> meet there! :)

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Serious issue with upgrading to latest version

2010-01-26 Thread weheh
I just re-downloaded the source from 
http://www.web2py.com/examples/default/download
(not the latest dev snapshot) and re-installed it. I couldn't even get
web2py to start. It looked like an incomplete set of files to me.

So, I installed the Windows version on the server and then restarted
web2py. Now, a lot of stuff does work, including my new app. But a lot
of stuff in my old app is broken now.

One of my controllers is throwing this error where it used to run
fine:

Traceback (most recent call last):
  File "gluon/restricted.py", line 173, in restricted
  File "D:/web2py/applications/myapp/controllers/admin.py", line 962,
in 
  File "gluon/globals.py", line 96, in 
  File "gluon/tools.py", line 1847, in f
  File "D:/web2py/applications/myapp/controllers/admin.py", line 224,
in res
  File "gluon/sqlhtml.py", line 992, in __init__
  File "gluon/sql.py", line 2640, in formatter
  File "gluon/validators.py", line 2053, in formatter
  File "gluon/validators.py", line 1858, in formatter
AttributeError: 'str' object has no attribute 'strftime'

I looked at all the code that has strftime and all the fields that are
being formatted that way are datetimes, so it shouldn't be a problem.
This app's been running flawlessly for a long time before this new
install.

Even directly accessing the db via the admin interface doesn't work
well.

If I look at db.auth_event table I get a ticket:

Traceback (most recent call last):
  File "gluon/restricted.py", line 173, in restricted
File "D:/web2py/applications/myapp/views/appadmin.html", line 156, in

  File "gluon/globals.py", line 105, in write
  File "gluon/html.py", line 99, in xmlescape
  File "gluon/html.py", line 513, in xml
  File "gluon/html.py", line 504, in _xml
  File "gluon/html.py", line 99, in xmlescape
  File "gluon/html.py", line 513, in xml
  File "gluon/html.py", line 504, in _xml
  File "gluon/html.py", line 99, in xmlescape
  File "gluon/html.py", line 513, in xml
  File "gluon/html.py", line 504, in _xml
  File "gluon/html.py", line 99, in xmlescape
  File "gluon/html.py", line 513, in xml
  File "gluon/html.py", line 504, in _xml
  File "gluon/html.py", line 99, in xmlescape
  File "gluon/sql.py", line 1410, in __getattr__
  File "gluon/sql.py", line 1405, in __allocateException: undefined
record

If I try to look at another table I get this error:

Traceback (most recent call last):
  File "gluon/restricted.py", line 173, in restricted
  File "D:/web2py/applications/myapp/controllers/appadmin.py", line
270, in 
  File "gluon/globals.py", line 96, in 
  File "D:/web2py/applications/SPiNup/controllers/appadmin.py", line
157, in select
TypeError: expected string or buffer

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: web2py irc channel

2010-01-26 Thread pistacchio
i wasn't aware of that, see you there! :)

On Jan 26, 9:23 am, Mengu  wrote:
> Right now, there are 16 web2py devs on irc.freenode.net :)
>
> On 25 Ocak, 21:14, pistacchio  wrote:
>
>
>
> > hi,
> > seen how active the community around web2py is (often a post on this
> > newsgroup is answered in less than a hour), i've thought that maybe a
> > irc channel could provide an even more "online" feedback for newcomers
> > or people looking for simple, quick answer while programming (for
> > example, the other day i asked about the way to retrieve the id of a
> > just inserted record and the answer was as simple as form.vars.id).
>
> > at the moment i'm hanging around #web2py on irc.esper.net. maybe we'll
> > meet there! :)

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] cron issue

2010-01-26 Thread Oguz Yarimtepe

Hi,

I was trying to use the cron property of web2py at my project. I am 
using web2py under windows 7. I had installed wamp server with mod_wsgi. 
According to the documentation it is suggested to use the external cron. 
I tried to test the soft cron issue so i added the below line to my 
application crontab


#crontab
*/2****root *decrease/

and at the controllers directory the decrease file is as is

# coding: utf8

def index():

f=file("C:\\Users\\oguz\\hede.txt", "w+")
f.write("ok")
f.close()

return dict()

So when the application is loaded shouldn't i see the txt is created at 
every 2 minutes?


What is the usage of the root keyword at the crontab file? For windows 
application what should it be?


And if i want to use the external cron method, it says i should add a 
line to system cron file. This doesn't sound me so effective at my 
application so i will be prefering to use something like pycron. Anybody 
tested these things at windows 7?


--
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: How to limit access to items in static?

2010-01-26 Thread Johann Spies
2010/1/22 mdipierro :
> You get invalid requests if the url is wrong or contains invalid chars
> (the filename cannot contain special chars or spaces, only
> alphanumeric and -).

Thanks. It was not that easy to find the correct url, but in the end I found it.

I have a subdirectory with all the related files in it including the
css.  in /static it works fine (without access control) but as soon as
I put this directory in /private/static (/private/static/proxydoc/) or
in uploads/ it ignores the css that is in proxodoc/_static/. :(

Somebody mentioned that I can use reponse.render to render anything.
I am not sure how to do it and whether it will solve my problem in
this setup.

Regards
Johann

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Web2py for PHP

2010-01-26 Thread Alexandre Andrade
First, I have to say I really likes web2py.

But I have a project with short time and need developers (portuguese
speakers).

So I will develop  using a php framework.

For me, CodeIgniter is the most web2py-like php framework, so I will use
this.



2010/1/25 Pynthon Pynthon 

> Hello
>
> Maybe it sounds strange but I need something like Web2py for PHP. Most PHP
> frameworks are too complicated. I know Codeigniter but IMO web2py has a
> great job, too for newbies that don´t know any OOP.
>
> Do you think something with the simplicity of web2py exists in PHP?
>
> Thanks and sorry for the strange question.
> F-X
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to
> web2py+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>



-- 
Atenciosamente

-- 
=
Alexandre Andrade
Hipercenter.com

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Web2py for PHP

2010-01-26 Thread desfrenes
You're right, Python is (much more) elegant. But you're wrong, PHP has
namespaces.

On 25 jan, 18:27, pistacchio  wrote:

> python is a very elegant and mature language. php has gained a huge
> popularity more for the moment when it came out that for the goodness
> of the language itself. it has a broken object system, no namespaces
> and so on.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Serious issue with upgrading to latest version

2010-01-26 Thread mdipierro
Did you ever edit appadmin in your app?
Please backit up and replace
- controllers/appadmin.py
- views/appadmin.html
with the ones from the new welcome app. This may partially fix your
last two problems.

The main problem is either you have an invalid combination of
validators OR you have corrupted data in database (I assume you have
sqlite) OR you have converted a 'string' field into a 'date' field (or
vice versa) with SQLITE. The first error for example arises from an
attempt to format a date from the database but it finds a string
instead of a datetime.date as it should be.

sqlite does not enforce field type (so one can accidentally put a
string in place of a date). web2py checks. Yet if you define a field
as string, store a date in it, then convert it into a date, sqlite
does not support alter table and you end up with corrupted data. A
different database would not have permitted you to do such conversion
at all.

I need to look at the code to help you more.

Massimo

On Jan 26, 2:31 am, weheh  wrote:
> I just re-downloaded the source 
> fromhttp://www.web2py.com/examples/default/download
> (not the latest dev snapshot) and re-installed it. I couldn't even get
> web2py to start. It looked like an incomplete set of files to me.
>
> So, I installed the Windows version on the server and then restarted
> web2py. Now, a lot of stuff does work, including my new app. But a lot
> of stuff in my old app is broken now.
>
> One of my controllers is throwing this error where it used to run
> fine:
>
> Traceback (most recent call last):
>   File "gluon/restricted.py", line 173, in restricted
>   File "D:/web2py/applications/myapp/controllers/admin.py", line 962,
> in 
>   File "gluon/globals.py", line 96, in 
>   File "gluon/tools.py", line 1847, in f
>   File "D:/web2py/applications/myapp/controllers/admin.py", line 224,
> in res
>   File "gluon/sqlhtml.py", line 992, in __init__
>   File "gluon/sql.py", line 2640, in formatter
>   File "gluon/validators.py", line 2053, in formatter
>   File "gluon/validators.py", line 1858, in formatter
> AttributeError: 'str' object has no attribute 'strftime'
>
> I looked at all the code that has strftime and all the fields that are
> being formatted that way are datetimes, so it shouldn't be a problem.
> This app's been running flawlessly for a long time before this new
> install.
>
> Even directly accessing the db via the admin interface doesn't work
> well.
>
> If I look at db.auth_event table I get a ticket:
>
> Traceback (most recent call last):
>   File "gluon/restricted.py", line 173, in restricted
> File "D:/web2py/applications/myapp/views/appadmin.html", line 156, in
> 
>   File "gluon/globals.py", line 105, in write
>   File "gluon/html.py", line 99, in xmlescape
>   File "gluon/html.py", line 513, in xml
>   File "gluon/html.py", line 504, in _xml
>   File "gluon/html.py", line 99, in xmlescape
>   File "gluon/html.py", line 513, in xml
>   File "gluon/html.py", line 504, in _xml
>   File "gluon/html.py", line 99, in xmlescape
>   File "gluon/html.py", line 513, in xml
>   File "gluon/html.py", line 504, in _xml
>   File "gluon/html.py", line 99, in xmlescape
>   File "gluon/html.py", line 513, in xml
>   File "gluon/html.py", line 504, in _xml
>   File "gluon/html.py", line 99, in xmlescape
>   File "gluon/sql.py", line 1410, in __getattr__
>   File "gluon/sql.py", line 1405, in __allocateException: undefined
> record
>
> If I try to look at another table I get this error:
>
> Traceback (most recent call last):
>   File "gluon/restricted.py", line 173, in restricted
>   File "D:/web2py/applications/myapp/controllers/appadmin.py", line
> 270, in 
>   File "gluon/globals.py", line 96, in 
>   File "D:/web2py/applications/SPiNup/controllers/appadmin.py", line
> 157, in select
> TypeError: expected string or buffer

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: cron issue

2010-01-26 Thread mdipierro
I did not write cron personally and I am still trying to understand
some of it, Attila did.
I am in the looking at cron these days to treamline it a bit and I am
trying to understand better as it works.

Since windows does not have cron, you should use web2py hardcron. It
should work on windows 7 but I have not tried it. The "root" is the
username that should run the cron task. It is only used by extcron and
ignored otherwise (but must be there, for compatibility of syntax).

I am not sure if tasks staring with * or ** run under extcron so I
suggest not using pycron. Given hardcron you do not need pycron
anyway.

Mind that this is in the process of being refactored a bit. Perhaps
you can help with testing and debugging so you can be sure it works as
you need it.

On Jan 26, 4:27 am, Oguz Yarimtepe  wrote:
> Hi,
>
> I was trying to use the cron property of web2py at my project. I am
> using web2py under windows 7. I had installed wamp server with mod_wsgi.
> According to the documentation it is suggested to use the external cron.
> I tried to test the soft cron issue so i added the below line to my
> application crontab
>
> #crontab
> */2        *        *        *        *        root *decrease/
>
> and at the controllers directory the decrease file is as is
>
> # coding: utf8
>
> def index():
>
>      f=file("C:\\Users\\oguz\\hede.txt", "w+")
>      f.write("ok")
>      f.close()
>
>      return dict()
>
> So when the application is loaded shouldn't i see the txt is created at
> every 2 minutes?
>
> What is the usage of the root keyword at the crontab file? For windows
> application what should it be?
>
> And if i want to use the external cron method, it says i should add a
> line to system cron file. This doesn't sound me so effective at my
> application so i will be prefering to use something like pycron. Anybody
> tested these things at windows 7?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] SQLFORM upload field like in appadmin

2010-01-26 Thread Alex
When I update record with upload field using database administration
tool of admin interface, loaded image file into this upload file is
shown with thumb, link to file and delete checkbox.
When I try to update this record in my controller, I see input field
with browse button only.
Please, suggest the way to add thumb, link to file and delete checkbox
to upload field in my controller/

I write following code...

in db.py:

db.define_table(...
Field('photo_normal', 'upload', label='Photo', autodelete=True),
...)

in controller:
...
model_id = request.args(0)
color_id = request.args(1) if len(request.args) > 1 else 0
if color_id:
row = db(db.product_color.id==color_id).select()
if len(row)<=0:
redirect(URL(r=request, f='index'))
form = SQLFORM(db.product_color, row[0], deletable=True)
else:
form = SQLFORM(db.product_color)
form.vars.model_id = model_id
...

Thank you

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: SQLFORM upload field like in appadmin

2010-01-26 Thread mdipierro
You need to pass the SQLFORM(,upload=URL(r=request,f='download'))
so that web2py know what to link the button to.

On Jan 26, 6:46 am, Alex  wrote:
> When I update record with upload field using database administration
> tool of admin interface, loaded image file into this upload file is
> shown with thumb, link to file and delete checkbox.
> When I try to update this record in my controller, I see input field
> with browse button only.
> Please, suggest the way to add thumb, link to file and delete checkbox
> to upload field in my controller/
>
> I write following code...
>
> in db.py:
>
> db.define_table(...
>     Field('photo_normal', 'upload', label='Photo', autodelete=True),
> ...)
>
> in controller:
> ...
>     model_id = request.args(0)
>     color_id = request.args(1) if len(request.args) > 1 else 0
>     if color_id:
>         row = db(db.product_color.id==color_id).select()
>         if len(row)<=0:
>             redirect(URL(r=request, f='index'))
>         form = SQLFORM(db.product_color, row[0], deletable=True)
>     else:
>         form = SQLFORM(db.product_color)
>         form.vars.model_id = model_id
> ...
>
> Thank you

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: web2py irc channel

2010-01-26 Thread tyoc 213
 I dont rememnber but I think that freenode has at less other 2 ports
(different than default sure) for connecting to freenode, so if you have
IRC port block on your location (perhaps some 1 know) you can connect using
the other ports and you are done.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: SQLFORM upload field like in appadmin

2010-01-26 Thread Alex
Wow! It works.
Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Web2py for PHP

2010-01-26 Thread pistacchio
you are right, desfrenes, it has namespace (indeed, it has gained
namespaces only lately), but, talking about elegance, adding
namespaces/that/look/like/paths is not what i consider a "wow" design
decision :)

On Jan 26, 1:49 pm, desfrenes  wrote:
> You're right, Python is (much more) elegant. But you're wrong, PHP has
> namespaces.
>
> On 25 jan, 18:27, pistacchio  wrote:
>
>
>
> > python is a very elegant and mature language. php has gained a huge
> > popularity more for the moment when it came out that for the goodness
> > of the language itself. it has a broken object system, no namespaces
> > and so on.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: web2py irc channel

2010-01-26 Thread Drapko Nitzhonot
You can connect through mibbit.com to any IRC server

On Tue, Jan 26, 2010 at 2:29 PM, tyoc 213  wrote:

>  I dont rememnber but I think that freenode has at less other 2 ports
> (different than default sure) for connecting to freenode, so if you have
> IRC port block on your location (perhaps some 1 know) you can connect using
> the other ports and you are done.
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to
> web2py+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] RFC @completion

2010-01-26 Thread mdipierro
With current trunk you can now do:

from gluon.tools import completion

def callback(d):
print '<<<',d

@completion(callback)
def test():
return dict(value="hello World")

What do you think?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Best place to store files derived from uploaded data

2010-01-26 Thread MikeEllis
I have a design question.

I'm part of a team developing a scientific app that will allow users
to upload seismic data and apply various kinds of processing and
plotting.  It looks as though we'll need to support several different
raw data formats.  The approach we're taking for this is to convert
the data files after they're uploaded and store them in pickled python
object files referenced by entries in a db table.  All subsequent
processing would be done with the pickled objects, but users may also
want to retrieve the raw data in the original format.  So my thought
is that the uploaded data files should go into the uploads folder
using the usual web2py mechanisms and the derived object files would
be stored in the private folder.

Is that consistent with the intended purpose of the private folder?
Are there any (web2py) usage or performance issues that need to be
taken into account?

Thanks,
Mike

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Best place to store files derived from uploaded data

2010-01-26 Thread mdipierro
I think what matters if how the files are downloaded.

If the are downloaded via the provided "download" action then they
must be referenced by a database record and the names must follow the
convention "table.field.uuid.extension" (so that web2py can locate the
record and check authorization if any).

If anybody can download them and they do not need to be referenced by
db, they should go in static.

In all the other cases you should put them in "private" and create
your own "mydownload" action to retrieve them.

The "private" folder was supposed to mean "private of the application"
as of "anything this app wants manage without web2py help", not
"private from users".

Massimo




On Jan 26, 10:06 am, MikeEllis  wrote:
> I have a design question.
>
> I'm part of a team developing a scientific app that will allow users
> to upload seismic data and apply various kinds of processing and
> plotting.  It looks as though we'll need to support several different
> raw data formats.  The approach we're taking for this is to convert
> the data files after they're uploaded and store them in pickled python
> object files referenced by entries in a db table.  All subsequent
> processing would be done with the pickled objects, but users may also
> want to retrieve the raw data in the original format.  So my thought
> is that the uploaded data files should go into the uploads folder
> using the usual web2py mechanisms and the derived object files would
> be stored in the private folder.
>
> Is that consistent with the intended purpose of the private folder?
> Are there any (web2py) usage or performance issues that need to be
> taken into account?
>
> Thanks,
> Mike

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: Best place to store files derived from uploaded data

2010-01-26 Thread Thadeus Burgess
Also the one thing with pickling these files is if any of the files
get edited, you should perform some sort of locking since what if two
people edit the same file at the same time?

Just a disadvantage of using pickle in a multi-instanced environment
such as web servers.

But you probably already know this

There shouldn't be any performance issues as far as web2py is
concerned, just the reading/writing to the file system which you will
need to do anyways.

You don't necessarily have to store the originals in the uploads
folder, that is only a web2py convenience, you could use regular forms
and save the files wherever you like (a mounted network share?)

-Thadeus





On Tue, Jan 26, 2010 at 10:12 AM, mdipierro  wrote:
> I think what matters if how the files are downloaded.
>
> If the are downloaded via the provided "download" action then they
> must be referenced by a database record and the names must follow the
> convention "table.field.uuid.extension" (so that web2py can locate the
> record and check authorization if any).
>
> If anybody can download them and they do not need to be referenced by
> db, they should go in static.
>
> In all the other cases you should put them in "private" and create
> your own "mydownload" action to retrieve them.
>
> The "private" folder was supposed to mean "private of the application"
> as of "anything this app wants manage without web2py help", not
> "private from users".
>
> Massimo
>
>
>
>
> On Jan 26, 10:06 am, MikeEllis  wrote:
>> I have a design question.
>>
>> I'm part of a team developing a scientific app that will allow users
>> to upload seismic data and apply various kinds of processing and
>> plotting.  It looks as though we'll need to support several different
>> raw data formats.  The approach we're taking for this is to convert
>> the data files after they're uploaded and store them in pickled python
>> object files referenced by entries in a db table.  All subsequent
>> processing would be done with the pickled objects, but users may also
>> want to retrieve the raw data in the original format.  So my thought
>> is that the uploaded data files should go into the uploads folder
>> using the usual web2py mechanisms and the derived object files would
>> be stored in the private folder.
>>
>> Is that consistent with the intended purpose of the private folder?
>> Are there any (web2py) usage or performance issues that need to be
>> taken into account?
>>
>> Thanks,
>> Mike
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: web2py irc channel

2010-01-26 Thread Wes James
I tried web2pychat.com and just from mibbit.com with web2py channel.
I think irc.freenode.net is blocking mibbit, because neither seem to
work.

-wes

On Tue, Jan 26, 2010 at 8:45 AM, Drapko Nitzhonot  wrote:
> You can connect through mibbit.com to any IRC server
>
> On Tue, Jan 26, 2010 at 2:29 PM, tyoc 213  wrote:
>>
>>  I dont rememnber but I think that freenode has at less other 2 ports
>> (different than default sure) for connecting to freenode, so if you have
>> IRC port block on your location (perhaps some 1 know) you can connect using
>> the other ports and you are done.
>>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: web2py irc channel

2010-01-26 Thread mdipierro
web2pychat stopped working for me long time ago. The author has not
been seen here in a while.

Massimo

On Jan 26, 10:59 am, Wes James  wrote:
> I tried web2pychat.com and just from mibbit.com with web2py channel.
> I think irc.freenode.net is blocking mibbit, because neither seem to
> work.
>
> -wes
>
> On Tue, Jan 26, 2010 at 8:45 AM, Drapko Nitzhonot  wrote:
> > You can connect through mibbit.com to any IRC server
>
> > On Tue, Jan 26, 2010 at 2:29 PM, tyoc 213  wrote:
>
> >>  I dont rememnber but I think that freenode has at less other 2 ports
> >> (different than default sure) for connecting to freenode, so if you 
> >> have
> >> IRC port block on your location (perhaps some 1 know) you can connect using
> >> the other ports and you are done.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: web2py irc channel

2010-01-26 Thread Drapko Nitzhonot
You are right, freenode is blocking mibbit. The reason is "new freenode
webchat"
http://blog.freenode.net/2009/06/new-freenode-webchat-and-why-to-use-it/

Freenode webchat: http://webchat.freenode.net/

On Tue, Jan 26, 2010 at 5:59 PM, Wes James  wrote:

> I tried web2pychat.com and just from mibbit.com with web2py channel.
> I think irc.freenode.net is blocking mibbit, because neither seem to
> work.
>
> -wes
>
> On Tue, Jan 26, 2010 at 8:45 AM, Drapko Nitzhonot 
> wrote:
> > You can connect through mibbit.com to any IRC server
> >
> > On Tue, Jan 26, 2010 at 2:29 PM, tyoc 213  wrote:
> >>
> >>  I dont rememnber but I think that freenode has at less other 2
> ports
> >> (different than default sure) for connecting to freenode, so if you
> have
> >> IRC port block on your location (perhaps some 1 know) you can connect
> using
> >> the other ports and you are done.
> >>
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to
> web2py+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] ticket on examples cache

2010-01-26 Thread Thadeus Burgess
http://www.web2py.com/examples/cache_examples/cache_db_select


http://www.web2py.com/admin/default/ticket/examples/24.153.196.141.2010-01-26.11-15-40.af2f07f8-6752-4abc-b422-e70cae2627ea

-Thadeus

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: ticket on examples cache

2010-01-26 Thread mdipierro
oops. type in example (dba instead of db). I fixed it there, I will
fix it on trunk tonight, as I get home.

On Jan 26, 11:18 am, Thadeus Burgess  wrote:
> http://www.web2py.com/examples/cache_examples/cache_db_select
>
> http://www.web2py.com/admin/default/ticket/examples/24.153.196.141.20...
>
> -Thadeus

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Serious issue with upgrading to latest version

2010-01-26 Thread weheh
Massimo, the db is MySQL, not SQLITE. I think this is going to be more
complicated than what you suggest. I am going to do a wipe and clean
install. It's been awhile since I upgraded my server's version of
web2py. I honestly do not like the install mechanism behind web2py.
Seems error prone, as measured by the many times I've had trouble with
it. - RG

On Jan 26, 9:54 am, mdipierro  wrote:
> Did you ever edit appadmin in your app?
> Please backit up and replace
> - controllers/appadmin.py
> - views/appadmin.html
> with the ones from the new welcome app. This may partially fix your
> last two problems.
>
> The main problem is either you have an invalid combination of
> validators OR you have corrupted data in database (I assume you have
> sqlite) OR you have converted a 'string' field into a 'date' field (or
> vice versa) with SQLITE. The first error for example arises from an
> attempt to format a date from the database but it finds a string
> instead of a datetime.date as it should be.
>
> sqlite does not enforce field type (so one can accidentally put a
> string in place of a date). web2py checks. Yet if you define a field
> as string, store a date in it, then convert it into a date, sqlite
> does not support alter table and you end up with corrupted data. A
> different database would not have permitted you to do such conversion
> at all.
>
> I need to look at the code to help you more.
>
> Massimo
>
> On Jan 26, 2:31 am, weheh  wrote:
>
>
>
> > I just re-downloaded the source 
> > fromhttp://www.web2py.com/examples/default/download
> > (not the latest dev snapshot) and re-installed it. I couldn't even get
> > web2py to start. It looked like an incomplete set of files to me.
>
> > So, I installed the Windows version on the server and then restarted
> > web2py. Now, a lot of stuff does work, including my new app. But a lot
> > of stuff in my old app is broken now.
>
> > One of my controllers is throwing this error where it used to run
> > fine:
>
> > Traceback (most recent call last):
> >   File "gluon/restricted.py", line 173, in restricted
> >   File "D:/web2py/applications/myapp/controllers/admin.py", line 962,
> > in 
> >   File "gluon/globals.py", line 96, in 
> >   File "gluon/tools.py", line 1847, in f
> >   File "D:/web2py/applications/myapp/controllers/admin.py", line 224,
> > in res
> >   File "gluon/sqlhtml.py", line 992, in __init__
> >   File "gluon/sql.py", line 2640, in formatter
> >   File "gluon/validators.py", line 2053, in formatter
> >   File "gluon/validators.py", line 1858, in formatter
> > AttributeError: 'str' object has no attribute 'strftime'
>
> > I looked at all the code that has strftime and all the fields that are
> > being formatted that way are datetimes, so it shouldn't be a problem.
> > This app's been running flawlessly for a long time before this new
> > install.
>
> > Even directly accessing the db via the admin interface doesn't work
> > well.
>
> > If I look at db.auth_event table I get a ticket:
>
> > Traceback (most recent call last):
> >   File "gluon/restricted.py", line 173, in restricted
> > File "D:/web2py/applications/myapp/views/appadmin.html", line 156, in
> > 
> >   File "gluon/globals.py", line 105, in write
> >   File "gluon/html.py", line 99, in xmlescape
> >   File "gluon/html.py", line 513, in xml
> >   File "gluon/html.py", line 504, in _xml
> >   File "gluon/html.py", line 99, in xmlescape
> >   File "gluon/html.py", line 513, in xml
> >   File "gluon/html.py", line 504, in _xml
> >   File "gluon/html.py", line 99, in xmlescape
> >   File "gluon/html.py", line 513, in xml
> >   File "gluon/html.py", line 504, in _xml
> >   File "gluon/html.py", line 99, in xmlescape
> >   File "gluon/html.py", line 513, in xml
> >   File "gluon/html.py", line 504, in _xml
> >   File "gluon/html.py", line 99, in xmlescape
> >   File "gluon/sql.py", line 1410, in __getattr__
> >   File "gluon/sql.py", line 1405, in __allocateException: undefined
> > record
>
> > If I try to look at another table I get this error:
>
> > Traceback (most recent call last):
> >   File "gluon/restricted.py", line 173, in restricted
> >   File "D:/web2py/applications/myapp/controllers/appadmin.py", line
> > 270, in 
> >   File "gluon/globals.py", line 96, in 
> >   File "D:/web2py/applications/SPiNup/controllers/appadmin.py", line
> > 157, in select
> > TypeError: expected string or buffer- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] A design question with forms.

2010-01-26 Thread Thadeus Burgess
Notice how I have validators set on the database level of web2py.

db.table.field.requires = IS_IN_DB(...)

I only use SQLFORM.factory to create my forms. I only use
SQLFORM.factory because for my purposes forms cannot be mapped
directly to database tables.

Take a reference field for example, I want my database to store it as
an ID, however I want the form to allow input as another field in the
reference table, say "name".

So for this I use a different IS_IN_DB validator for my
sqlform.factories than the IS_IN_DB for a reference field.

IS_IN_DB(db, 'signup.code') vs IS_IN_DB(db, 'signup.id'), but my
database actually stores the ID, so on form.accepts I query for the
records id.

So here is my question, are validators used anywhere else in web2py
except by crud and SQLFORM ? Am I safe by not setting validators on
the database level  ?

Now sometimes I will use a field as is straight from the database
(like the gender column), in this case I can see setting a
database-level validator and then when creating my SQLFORM.factory,
just referencing the fields I know arn't special.

-Thadeus

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: Serious issue with upgrading to latest version

2010-01-26 Thread Marcin Jaworski

Wiadomość napisana przez weheh w dniu 2010-01-26, o godz. 19:00:

> Massimo, the db is MySQL, not SQLITE. I think this is going to be more
> complicated than what you suggest. I am going to do a wipe and clean
> install. It's been awhile since I upgraded my server's version of
> web2py. I honestly do not like the install mechanism behind web2py.
> Seems error prone, as measured by the many times I've had trouble with
> it. - RG
> 

Hi,

But in general ...
Isn't it?

Keep mooving ;)


M


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: A design question with forms.

2010-01-26 Thread Thadeus Burgess
And just another example

I want to be able to store null or empty emails in my database, even
though email field is unique.

but anybody else who signs up must enter a valid new email address. So
on my signup form it needs an IS_NOT_EMPTY validator, but on my
internal forms i need IS_NULL_OR(...) validators. How should
situations like this be handled, should I just always redefine my
validators at the .factory level, or define at the databse level as
"defaults" and only redefine in .factory if the validators change?

-Thadeus





On Tue, Jan 26, 2010 at 12:11 PM, Thadeus Burgess  wrote:
> Notice how I have validators set on the database level of web2py.
>
> db.table.field.requires = IS_IN_DB(...)
>
> I only use SQLFORM.factory to create my forms. I only use
> SQLFORM.factory because for my purposes forms cannot be mapped
> directly to database tables.
>
> Take a reference field for example, I want my database to store it as
> an ID, however I want the form to allow input as another field in the
> reference table, say "name".
>
> So for this I use a different IS_IN_DB validator for my
> sqlform.factories than the IS_IN_DB for a reference field.
>
> IS_IN_DB(db, 'signup.code') vs IS_IN_DB(db, 'signup.id'), but my
> database actually stores the ID, so on form.accepts I query for the
> records id.
>
> So here is my question, are validators used anywhere else in web2py
> except by crud and SQLFORM ? Am I safe by not setting validators on
> the database level  ?
>
> Now sometimes I will use a field as is straight from the database
> (like the gender column), in this case I can see setting a
> database-level validator and then when creating my SQLFORM.factory,
> just referencing the fields I know arn't special.
>
> -Thadeus
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: A design question with forms.

2010-01-26 Thread mdipierro
> So here is my question, are validators used anywhere else in web2py
> except by crud and SQLFORM ?

No

> Am I safe by not setting validators on
> the database level  ?

Yes

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Serious issue with upgrading to latest version

2010-01-26 Thread mdipierro
Than it bust be an application bug. I think you may have a IS_DATE
validator on a 'string' field instead of a 'date' field.
You also need to move over the new appadmin(s) into your app. Normally
this is not required during upgrades since they become part of your
app. Nevertheless there was an issue with very early appadmin that was
fixed and may be causing the last one of your problems.

On Jan 26, 12:00 pm, weheh  wrote:
> Massimo, the db is MySQL, not SQLITE. I think this is going to be more
> complicated than what you suggest. I am going to do a wipe and clean
> install. It's been awhile since I upgraded my server's version of
> web2py. I honestly do not like the install mechanism behind web2py.
> Seems error prone, as measured by the many times I've had trouble with
> it. - RG
>
> On Jan 26, 9:54 am, mdipierro  wrote:
>
> > Did you ever edit appadmin in your app?
> > Please backit up and replace
> > - controllers/appadmin.py
> > - views/appadmin.html
> > with the ones from the new welcome app. This may partially fix your
> > last two problems.
>
> > The main problem is either you have an invalid combination of
> > validators OR you have corrupted data in database (I assume you have
> > sqlite) OR you have converted a 'string' field into a 'date' field (or
> > vice versa) with SQLITE. The first error for example arises from an
> > attempt to format a date from the database but it finds a string
> > instead of a datetime.date as it should be.
>
> > sqlite does not enforce field type (so one can accidentally put a
> > string in place of a date). web2py checks. Yet if you define a field
> > as string, store a date in it, then convert it into a date, sqlite
> > does not support alter table and you end up with corrupted data. A
> > different database would not have permitted you to do such conversion
> > at all.
>
> > I need to look at the code to help you more.
>
> > Massimo
>
> > On Jan 26, 2:31 am, weheh  wrote:
>
> > > I just re-downloaded the source 
> > > fromhttp://www.web2py.com/examples/default/download
> > > (not the latest dev snapshot) and re-installed it. I couldn't even get
> > > web2py to start. It looked like an incomplete set of files to me.
>
> > > So, I installed the Windows version on the server and then restarted
> > > web2py. Now, a lot of stuff does work, including my new app. But a lot
> > > of stuff in my old app is broken now.
>
> > > One of my controllers is throwing this error where it used to run
> > > fine:
>
> > > Traceback (most recent call last):
> > >   File "gluon/restricted.py", line 173, in restricted
> > >   File "D:/web2py/applications/myapp/controllers/admin.py", line 962,
> > > in 
> > >   File "gluon/globals.py", line 96, in 
> > >   File "gluon/tools.py", line 1847, in f
> > >   File "D:/web2py/applications/myapp/controllers/admin.py", line 224,
> > > in res
> > >   File "gluon/sqlhtml.py", line 992, in __init__
> > >   File "gluon/sql.py", line 2640, in formatter
> > >   File "gluon/validators.py", line 2053, in formatter
> > >   File "gluon/validators.py", line 1858, in formatter
> > > AttributeError: 'str' object has no attribute 'strftime'
>
> > > I looked at all the code that has strftime and all the fields that are
> > > being formatted that way are datetimes, so it shouldn't be a problem.
> > > This app's been running flawlessly for a long time before this new
> > > install.
>
> > > Even directly accessing the db via the admin interface doesn't work
> > > well.
>
> > > If I look at db.auth_event table I get a ticket:
>
> > > Traceback (most recent call last):
> > >   File "gluon/restricted.py", line 173, in restricted
> > > File "D:/web2py/applications/myapp/views/appadmin.html", line 156, in
> > > 
> > >   File "gluon/globals.py", line 105, in write
> > >   File "gluon/html.py", line 99, in xmlescape
> > >   File "gluon/html.py", line 513, in xml
> > >   File "gluon/html.py", line 504, in _xml
> > >   File "gluon/html.py", line 99, in xmlescape
> > >   File "gluon/html.py", line 513, in xml
> > >   File "gluon/html.py", line 504, in _xml
> > >   File "gluon/html.py", line 99, in xmlescape
> > >   File "gluon/html.py", line 513, in xml
> > >   File "gluon/html.py", line 504, in _xml
> > >   File "gluon/html.py", line 99, in xmlescape
> > >   File "gluon/html.py", line 513, in xml
> > >   File "gluon/html.py", line 504, in _xml
> > >   File "gluon/html.py", line 99, in xmlescape
> > >   File "gluon/sql.py", line 1410, in __getattr__
> > >   File "gluon/sql.py", line 1405, in __allocateException: undefined
> > > record
>
> > > If I try to look at another table I get this error:
>
> > > Traceback (most recent call last):
> > >   File "gluon/restricted.py", line 173, in restricted
> > >   File "D:/web2py/applications/myapp/controllers/appadmin.py", line
> > > 270, in 
> > >   File "gluon/globals.py", line 96, in 
> > >   File "D:/web2py/applications/SPiNup/controllers/appadmin.py", line
> > > 157, in select
> > > TypeError: expected string or buffer- Hide quoted 

Re: [web2py] RFC @completion

2010-01-26 Thread Timothy Farrell
I'm not knocking it because it's syntactic sugar, but you could already 
do this by setting response._caller right?


On 1/26/2010 10:05 AM, mdipierro wrote:

With current trunk you can now do:

from gluon.tools import completion

def callback(d):
 print '<<<',d

@completion(callback)
def test():
 return dict(value="hello World")

What do you think?

   


--
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] RFC @completion

2010-01-26 Thread Thadeus Burgess
response._caller is internal.

response._caller is global for all actions

response._caller wants to call you out

@completion will allow for per-action notification and per-action
notify functions.

@completion will allow you to be free

@completion agrees with you

/political_satire off

They each have their own uses

-Thadeus





On Tue, Jan 26, 2010 at 12:37 PM, Timothy Farrell  wrote:
> I'm not knocking it because it's syntactic sugar, but you could already do
> this by setting response._caller right?
>
> On 1/26/2010 10:05 AM, mdipierro wrote:
>>
>> With current trunk you can now do:
>>
>> from gluon.tools import completion
>>
>> def callback(d):
>>     print '<<<',d
>>
>> @completion(callback)
>> def test():
>>     return dict(value="hello World")
>>
>> What do you think?
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: JOB POST: I need a Web2Py Developer

2010-01-26 Thread tweety76
Thank you for those who emailed me. I've got 3 emails so far. I am
still looking for some other offers before I decide. Please email me
so I can email you the details of the project.



On Jan 25, 3:21 pm, mdipierro  wrote:
> This would be a good occasion to test and bring to production quality
> the plugin_google_checkout.
> I posted it some time ago. Let me know if I should post it again.
>
> On Jan 25, 2:39 pm, tweety76  wrote:
>
> > I manage 2 websites that sell prepaid phonecards in the internet. I
> > need a developer who can create another site for me in web2py. I would
> > like it in web2py since I am learning the platform and the language
> > and I would like to have the website on a language and platform that I
> > am learning right now. Please pm me privately if you are interested in
> > developing this for me so we can discuss the details.
>
> > I need the website in a month if possible.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] JOB POST: I need a Web2Py Developer

2010-01-26 Thread Alexandre Andrade
Mr.,

I'm insterested in your offer.

My websites, hipercenter.com/init and hipercenter.com/ciclismo are in
web2py.

I wish to receive the details of project.


-- 

-- 
=
Alexandre Andrade
Hipercenter.com


2010/1/25 tweety76 

> I manage 2 websites that sell prepaid phonecards in the internet. I
> need a developer who can .create another site for me in web2py. I would
> like it in web2py since I am learning the platform and the language
> and I would like to have the website on a language and platform that I
> am learning right now. Please pm me privately if you are interested in
> developing this for me so we can discuss the details.
>
> I need the website in a month if possible.
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to
> web2py+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] JOB POST: I need a Web2Py Developer

2010-01-26 Thread Alexandre Andrade
I apologize.

2010/1/26 Alexandre Andrade 

> Mr.,
>
> I'm insterested in your offer.
>
> My websites, hipercenter.com/init and hipercenter.com/ciclismo are in
> web2py.
>
> I wish to receive the details of project.
>
>
> --
>
> --
> =
> Alexandre Andrade
> Hipercenter.com
>
>
> 2010/1/25 tweety76 
>
> I manage 2 websites that sell prepaid phonecards in the internet. I
>> need a developer who can .create another site for me in web2py. I would
>> like it in web2py since I am learning the platform and the language
>> and I would like to have the website on a language and platform that I
>> am learning right now. Please pm me privately if you are interested in
>> developing this for me so we can discuss the details.
>>
>> I need the website in a month if possible.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To post to this group, send email to web...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> web2py+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/web2py?hl=en.
>>
>>
>
>
>
>


-- 
Atenciosamente

-- 
=
Alexandre Andrade
Hipercenter.com

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: Serious issue with upgrading to latest version

2010-01-26 Thread Jonathan Lundell
On Jan 26, 2010, at 10:19 AM, mdipierro wrote:

> Than it bust be an application bug. I think you may have a IS_DATE
> validator on a 'string' field instead of a 'date' field.
> You also need to move over the new appadmin(s) into your app. Normally
> this is not required during upgrades since they become part of your
> app. Nevertheless there was an issue with very early appadmin that was
> fixed and may be causing the last one of your problems.

I'm probably repeating myself here, but is appadmin a plugin candidate? 

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Best place to store files derived from uploaded data

2010-01-26 Thread MikeEllis
Thanks Massimo and Thadeus.  Just to clarify, the pickled object files
are an internal representation created by the application for its own
use, so it seems like private/ is a reasonable place to keep them.

The raw uploaded data files are never altered by the application.
They just need to be available for download. I'll look more closely at
the docs for the normal web2py download action to see if that will
serve our purposes. If so, great, one more thing not to re-invent!
Generally speaking, this app will be used for data that's not secret
so keeping the files in static will probably be fine.  If someone
happens to want to use it for, say,  weapons test data they'll
certainly put it where no one but authorized users can get to it!

Thanks again! This is almost certainly the most responsive and helpful
group around.
Mike

On Jan 26, 11:31 am, Thadeus Burgess  wrote:
> Also the one thing with pickling these files is if any of the files
> get edited, you should perform some sort of locking since what if two
> people edit the same file at the same time?
>
> Just a disadvantage of using pickle in a multi-instanced environment
> such as web servers.
>
> But you probably already know this
>
> There shouldn't be any performance issues as far as web2py is
> concerned, just the reading/writing to the file system which you will
> need to do anyways.
>
> You don't necessarily have to store the originals in the uploads
> folder, that is only a web2py convenience, you could use regular forms
> and save the files wherever you like (a mounted network share?)
>
> -Thadeus
>
> On Tue, Jan 26, 2010 at 10:12 AM, mdipierro  wrote:
> > I think what matters if how the files are downloaded.
>
> > If the are downloaded via the provided "download" action then they
> > must be referenced by a database record and the names must follow the
> > convention "table.field.uuid.extension" (so that web2py can locate the
> > record and check authorization if any).
>
> > If anybody can download them and they do not need to be referenced by
> > db, they should go in static.
>
> > In all the other cases you should put them in "private" and create
> > your own "mydownload" action to retrieve them.
>
> > The "private" folder was supposed to mean "private of the application"
> > as of "anything this app wants manage without web2py help", not
> > "private from users".
>
> > Massimo
>
> > On Jan 26, 10:06 am, MikeEllis  wrote:
> >> I have a design question.
>
> >> I'm part of a team developing a scientific app that will allow users
> >> to upload seismic data and apply various kinds of processing and
> >> plotting.  It looks as though we'll need to support several different
> >> raw data formats.  The approach we're taking for this is to convert
> >> the data files after they're uploaded and store them in pickled python
> >> object files referenced by entries in a db table.  All subsequent
> >> processing would be done with the pickled objects, but users may also
> >> want to retrieve the raw data in the original format.  So my thought
> >> is that the uploaded data files should go into the uploads folder
> >> using the usual web2py mechanisms and the derived object files would
> >> be stored in the private folder.
>
> >> Is that consistent with the intended purpose of the private folder?
> >> Are there any (web2py) usage or performance issues that need to be
> >> taken into account?
>
> >> Thanks,
> >> Mike
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Serious issue with upgrading to latest version

2010-01-26 Thread mdipierro
We can make it into a plugin.

On Jan 26, 2:58 pm, Jonathan Lundell  wrote:
> On Jan 26, 2010, at 10:19 AM, mdipierro wrote:
>
> > Than it bust be an application bug. I think you may have a IS_DATE
> > validator on a 'string' field instead of a 'date' field.
> > You also need to move over the new appadmin(s) into your app. Normally
> > this is not required during upgrades since they become part of your
> > app. Nevertheless there was an issue with very early appadmin that was
> > fixed and may be causing the last one of your problems.
>
> I'm probably repeating myself here, but is appadmin a plugin candidate?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: JOB POST: I need a Web2Py Developer

2010-01-26 Thread mdipierro
for what?

On Jan 26, 2:24 pm, Alexandre Andrade 
wrote:
> I apologize.
>
> 2010/1/26 Alexandre Andrade 
>
>
>
> > Mr.,
>
> > I'm insterested in your offer.
>
> > My websites, hipercenter.com/init and hipercenter.com/ciclismo are in
> > web2py.
>
> > I wish to receive the details of project.
>
> > --
>
> > --
> > =
> > Alexandre Andrade
> > Hipercenter.com
>
> > 2010/1/25 tweety76 
>
> > I manage 2 websites that sell prepaid phonecards in the internet. I
> >> need a developer who can .create another site for me in web2py. I would
> >> like it in web2py since I am learning the platform and the language
> >> and I would like to have the website on a language and platform that I
> >> am learning right now. Please pm me privately if you are interested in
> >> developing this for me so we can discuss the details.
>
> >> I need the website in a month if possible.
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "web2py-users" group.
> >> To post to this group, send email to web...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> web2py+unsubscr...@googlegroups.com
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/web2py?hl=en.
>
> --
> Atenciosamente
>
> --
> =
> Alexandre Andrade
> Hipercenter.com

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] validator that creates select with options from list of tuples?

2010-01-26 Thread selecta
Is there a validator that creates a select with options from a list of
tuples

what I want do do is
Field("folder","integer",requires = IS_IN_TUPLELIST([('myfolder',12),
('subfoler',23)]))

so that is creates
SELECT([OPTION(name,_value=id) for name,id in [('myfolder',12),
('subfoler',23)] ],_name='parent'),INPUT(_name='name')

in this case I cannot use IS_IN_DB because i need to filter the
results from the table

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] validator that creates select with options from list of tuples?

2010-01-26 Thread Thadeus Burgess
IS_IN_DB can use a query can't it?

-Thadeus





On Tue, Jan 26, 2010 at 3:46 PM, selecta  wrote:
> Is there a validator that creates a select with options from a list of
> tuples
>
> what I want do do is
> Field("folder","integer",requires = IS_IN_TUPLELIST([('myfolder',12),
> ('subfoler',23)]))
>
> so that is creates
> SELECT([OPTION(name,_value=id) for name,id in [('myfolder',12),
> ('subfoler',23)] ],_name='parent'),INPUT(_name='name')
>
> in this case I cannot use IS_IN_DB because i need to filter the
> results from the table
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: RFC @completion

2010-01-26 Thread hamdy.a.farag
Hi

I'm interested in that actually, but can you give me a practical use
for this ?
can it be used as a logging mechanism ?

what about response._caller I don't get what it's used for

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] table self reference not working

2010-01-26 Thread selecta
I want to create a webfolder plugin, for that the table needs a self
reference in a Field
db.define_table('plugin_webfolder_files',
Field('name', requires=IS_NOT_EMPTY()),
Field('file', 'upload', requires=IS_NOT_EMPTY()),
Field('created_by', db.auth_user, readable=False,
writable=False),
Field('parent', db.plugin_webfolder_files, default=0, requires
= IS_IN_DB(db,'plugin_webfolder_files.id','%(name)s'))
)

unfortunately I get
Traceback (most recent call last):
  File "/home/select/Dev/web2py/gluon/restricted.py", line 173, in
restricted
exec ccode in environment
  File "/home/select/Dev/web2py/applications/tlc2/models/
plugin_webfolder.py", line 9, in 
Field('parent', db.plugin_webfolder_files, default=0, requires =
IS_IN_DB(db,'plugin_webfolder_files.id','%(name)s'))
  File "/home/select/Dev/web2py/gluon/sql.py", line 1272, in
__getattr__
return dict.__getitem__(self,key)
KeyError: 'plugin_webfolder_files'

so I have to change it to
db.define_table('plugin_webfolder_files',
Field('name', requires=IS_NOT_EMPTY()),
Field('file', 'upload', requires=IS_NOT_EMPTY()),
Field('created_by', db.auth_user, readable=False,
writable=False),
Field('parent', 'integer', default=0, requires = IS_IN_DB
(db,'plugin_webfolder_files.id','%(name)s'))
)

bug or feature?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: RFC @completion

2010-01-26 Thread Thadeus Burgess
I am using response._caller to compress all of my html output on my site to
one line.

I would use @completion if I was streaming a file or performing some really
long task like emailing 1500 people :)

-Thadeus




On Tue, Jan 26, 2010 at 4:13 PM, hamdy.a.farag wrote:

> Hi
>
> I'm interested in that actually, but can you give me a practical use
> for this ?
> can it be used as a logging mechanism ?
>
> what about response._caller I don't get what it's used for
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to
> web2py+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] table self reference not working

2010-01-26 Thread Thadeus Burgess
Neither.

You need

Field('parent', 'reference plugin_webfolder_files')

It is the same as using db.plugin_webfolder_files, but works for tables that
have not been defined yet.

-Thadeus




On Tue, Jan 26, 2010 at 4:17 PM, selecta  wrote:

> I want to create a webfolder plugin, for that the table needs a self
> reference in a Field
> db.define_table('plugin_webfolder_files',
>Field('name', requires=IS_NOT_EMPTY()),
>Field('file', 'upload', requires=IS_NOT_EMPTY()),
>Field('created_by', db.auth_user, readable=False,
> writable=False),
>Field('parent', db.plugin_webfolder_files, default=0, requires
> = IS_IN_DB(db,'plugin_webfolder_files.id','%(name)s'))
>)
>
> unfortunately I get
> Traceback (most recent call last):
>  File "/home/select/Dev/web2py/gluon/restricted.py", line 173, in
> restricted
>exec ccode in environment
>  File "/home/select/Dev/web2py/applications/tlc2/models/
> plugin_webfolder.py", line 9, in 
>Field('parent', db.plugin_webfolder_files, default=0, requires =
> IS_IN_DB(db,'plugin_webfolder_files.id','%(name)s'))
>  File "/home/select/Dev/web2py/gluon/sql.py", line 1272, in
> __getattr__
>return dict.__getitem__(self,key)
> KeyError: 'plugin_webfolder_files'
>
> so I have to change it to
> db.define_table('plugin_webfolder_files',
>Field('name', requires=IS_NOT_EMPTY()),
>Field('file', 'upload', requires=IS_NOT_EMPTY()),
>Field('created_by', db.auth_user, readable=False,
> writable=False),
>Field('parent', 'integer', default=0, requires = IS_IN_DB
> (db,'plugin_webfolder_files.id','%(name)s'))
>)
>
> bug or feature?
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to
> web2py+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: validator that creates select with options from list of tuples?

2010-01-26 Thread selecta
oh it can ?:) sounds good, but still it solves only part of my
problem, I also want to change what is shown to the user in option, I
better show you what I want to do

def getfolders(root = 0, spaces = '-'):
folders = []
for f in db(db_webfolder.id>0)(db_webfolder.parent==root)
(db_webfolder.file==None).select():
folders.append((f.id,spaces+f.name))
folders += getfolders(f.id, '-'+spaces)
return folders

folders = [(0,'root')]+getfolders()
form_folder = FORM(SELECT([OPTION(name,_value=id) for id,name in
folders],_name='parent'),INPUT(_name='name'),INPUT
(_type='submit',_value="create"))

it should return something like

root
-test
--subfolder of test
--another sub of test
--another one
-another folder
-yet another
-okok
--tesing still


On Jan 26, 10:59 pm, Thadeus Burgess  wrote:
> IS_IN_DB can use a query can't it?
>
> -Thadeus
>
>
>
> On Tue, Jan 26, 2010 at 3:46 PM, selecta  wrote:
> > Is there a validator that creates a select with options from a list of
> > tuples
>
> > what I want do do is
> > Field("folder","integer",requires = IS_IN_TUPLELIST([('myfolder',12),
> > ('subfoler',23)]))
>
> > so that is creates
> > SELECT([OPTION(name,_value=id) for name,id in [('myfolder',12),
> > ('subfoler',23)] ],_name='parent'),INPUT(_name='name')
>
> > in this case I cannot use IS_IN_DB because i need to filter the
> > results from the table
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: table self reference not working

2010-01-26 Thread selecta
thanks again! u're my hero
I guess I should read the manual before asking questions ...
starting to feel stupid here o_O

On Jan 26, 11:22 pm, Thadeus Burgess  wrote:
> Neither.
>
> You need
>
> Field('parent', 'reference plugin_webfolder_files')
>
> It is the same as using db.plugin_webfolder_files, but works for tables that
> have not been defined yet.
>
> -Thadeus
>
>
>
> On Tue, Jan 26, 2010 at 4:17 PM, selecta  wrote:
> > I want to create a webfolder plugin, for that the table needs a self
> > reference in a Field
> > db.define_table('plugin_webfolder_files',
> >        Field('name', requires=IS_NOT_EMPTY()),
> >        Field('file', 'upload', requires=IS_NOT_EMPTY()),
> >        Field('created_by', db.auth_user, readable=False,
> > writable=False),
> >        Field('parent', db.plugin_webfolder_files, default=0, requires
> > = IS_IN_DB(db,'plugin_webfolder_files.id','%(name)s'))
> >        )
>
> > unfortunately I get
> > Traceback (most recent call last):
> >  File "/home/select/Dev/web2py/gluon/restricted.py", line 173, in
> > restricted
> >    exec ccode in environment
> >  File "/home/select/Dev/web2py/applications/tlc2/models/
> > plugin_webfolder.py", line 9, in 
> >    Field('parent', db.plugin_webfolder_files, default=0, requires =
> > IS_IN_DB(db,'plugin_webfolder_files.id','%(name)s'))
> >  File "/home/select/Dev/web2py/gluon/sql.py", line 1272, in
> > __getattr__
> >    return dict.__getitem__(self,key)
> > KeyError: 'plugin_webfolder_files'
>
> > so I have to change it to
> > db.define_table('plugin_webfolder_files',
> >        Field('name', requires=IS_NOT_EMPTY()),
> >        Field('file', 'upload', requires=IS_NOT_EMPTY()),
> >        Field('created_by', db.auth_user, readable=False,
> > writable=False),
> >        Field('parent', 'integer', default=0, requires = IS_IN_DB
> > (db,'plugin_webfolder_files.id','%(name)s'))
> >        )
>
> > bug or feature?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > web2py+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: table self reference not working

2010-01-26 Thread Thadeus Burgess
It happens to all of us

-Thadeus




On Tue, Jan 26, 2010 at 4:27 PM, selecta  wrote:

> thanks again! u're my hero
> I guess I should read the manual before asking questions ...
> starting to feel stupid here o_O
>
> On Jan 26, 11:22 pm, Thadeus Burgess  wrote:
> > Neither.
> >
> > You need
> >
> > Field('parent', 'reference plugin_webfolder_files')
> >
> > It is the same as using db.plugin_webfolder_files, but works for tables
> that
> > have not been defined yet.
> >
> > -Thadeus
> >
> >
> >
> > On Tue, Jan 26, 2010 at 4:17 PM, selecta 
> wrote:
> > > I want to create a webfolder plugin, for that the table needs a self
> > > reference in a Field
> > > db.define_table('plugin_webfolder_files',
> > >Field('name', requires=IS_NOT_EMPTY()),
> > >Field('file', 'upload', requires=IS_NOT_EMPTY()),
> > >Field('created_by', db.auth_user, readable=False,
> > > writable=False),
> > >Field('parent', db.plugin_webfolder_files, default=0, requires
> > > = IS_IN_DB(db,'plugin_webfolder_files.id','%(name)s'))
> > >)
> >
> > > unfortunately I get
> > > Traceback (most recent call last):
> > >  File "/home/select/Dev/web2py/gluon/restricted.py", line 173, in
> > > restricted
> > >exec ccode in environment
> > >  File "/home/select/Dev/web2py/applications/tlc2/models/
> > > plugin_webfolder.py", line 9, in 
> > >Field('parent', db.plugin_webfolder_files, default=0, requires =
> > > IS_IN_DB(db,'plugin_webfolder_files.id','%(name)s'))
> > >  File "/home/select/Dev/web2py/gluon/sql.py", line 1272, in
> > > __getattr__
> > >return dict.__getitem__(self,key)
> > > KeyError: 'plugin_webfolder_files'
> >
> > > so I have to change it to
> > > db.define_table('plugin_webfolder_files',
> > >Field('name', requires=IS_NOT_EMPTY()),
> > >Field('file', 'upload', requires=IS_NOT_EMPTY()),
> > >Field('created_by', db.auth_user, readable=False,
> > > writable=False),
> > >Field('parent', 'integer', default=0, requires = IS_IN_DB
> > > (db,'plugin_webfolder_files.id','%(name)s'))
> > >)
> >
> > > bug or feature?
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "web2py-users" group.
> > > To post to this group, send email to web...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > web2py+unsubscr...@googlegroups.com
> 
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/web2py?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to
> web2py+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: validator that creates select with options from list of tuples?

2010-01-26 Thread selecta
SOLVED

i thought i have to write my own validator, looking into IS_IN_SET i
stumbeled upon the following code in the first few lines

 if isinstance(theset, dict):
self.labels = theset.values()

hmmm, lets try

folders = dict(folders)
db_webfolder.parent.requires = IS_IN_SET(folders)
form_file = SQLFORM(db_webfolder)

and it works!!!

maybe this should be documented somewhere, e.g. in the docstring of
IS_IN_SET! would make it at least a bit easier to find out

On Jan 26, 11:23 pm, selecta  wrote:
> oh it can ?:) sounds good, but still it solves only part of my
> problem, I also want to change what is shown to the user in option, I
> better show you what I want to do
>
>     def getfolders(root = 0, spaces = '-'):
>         folders = []
>         for f in db(db_webfolder.id>0)(db_webfolder.parent==root)
> (db_webfolder.file==None).select():
>             folders.append((f.id,spaces+f.name))
>             folders += getfolders(f.id, '-'+spaces)
>         return folders
>
>     folders = [(0,'root')]+getfolders()
>     form_folder = FORM(SELECT([OPTION(name,_value=id) for id,name in
> folders],_name='parent'),INPUT(_name='name'),INPUT
> (_type='submit',_value="create"))
>
> it should return something like
> 
> root
> -test
> --subfolder of test
> --another sub of test
> --another one
> -another folder
> -yet another
> -okok
> --tesing still
> 
>
> On Jan 26, 10:59 pm, Thadeus Burgess  wrote:
>
>
>
> > IS_IN_DB can use a query can't it?
>
> > -Thadeus
>
> > On Tue, Jan 26, 2010 at 3:46 PM, selecta  wrote:
> > > Is there a validator that creates a select with options from a list of
> > > tuples
>
> > > what I want do do is
> > > Field("folder","integer",requires = IS_IN_TUPLELIST([('myfolder',12),
> > > ('subfoler',23)]))
>
> > > so that is creates
> > > SELECT([OPTION(name,_value=id) for name,id in [('myfolder',12),
> > > ('subfoler',23)] ],_name='parent'),INPUT(_name='name')
>
> > > in this case I cannot use IS_IN_DB because i need to filter the
> > > results from the table
>
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "web2py-users" group.
> > > To post to this group, send email to web...@googlegroups.com.
> > > To unsubscribe from this group, send email to 
> > > web2py+unsubscr...@googlegroups.com.
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Mercurial for a separate project

2010-01-26 Thread bluemoth
Hi all,

Is it possible to hijack mercurial in web2py to create a repository
that is not related to web2py?

If so, I suspect it would be possible to create a web2py application
to create and manage (including authentication) projects.Similar to
bitbucket or google code. Does anyone have any thoughts on this?

Cheers, Duane

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Alert when email not sent sucessfully !

2010-01-26 Thread hamdy.a.farag
Hi Yannic

I'm not sure whether this what you want or not, but the mail.send()
function itself returns True or false , so you could just do :

if not mail.send(to=.., subject=,) :
 response.flash = "Message was not sent"

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: RFC @completion

2010-01-26 Thread hamdy.a.farag

Thanks Thadeus for replying

I didn't understand though, because this concept is new for me

can you please give me examples ?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: validator that creates select with options from list of tuples?

2010-01-26 Thread selecta
IGNORE THE POST ABOVE
NOW TRULY SOLVED

The problem with the post above was that the validator was not order
preserving, I added some lines to the IS_IN_SET constructor, not it
truly works

 
   >>> IS_IN_SET([('a','max'), ('b','john')])('max')
('a', None)
"""

def __init__(
self,
theset,
labels=None,
error_message='value not allowed',
multiple=False,
zero='',
sort=False,
):
self.multiple = multiple
self.labels = labels
if theset and len(theset[0])==2 and (isinstance(theset[0],
list) or isinstance(theset[0], tuple)):
self.theset = [str(item) for item,label in theset]
self.labels = [str(label) for item,label in theset]
else:
self.theset = [str(item) for item in theset]
if isinstance(theset, dict):
self.labels = theset.values()
self.error_message = error_message
self.zero = zero
self.sort = sort

contrutor ends there

maximo if you could add this code to the trunk it would be very nice

On Jan 27, 12:07 am, selecta  wrote:
> SOLVED
>
> i thought i have to write my own validator, looking into IS_IN_SET i
> stumbeled upon the following code in the first few lines
>
>  if isinstance(theset, dict):
>             self.labels = theset.values()
>
> hmmm, lets try
>
> folders = dict(folders)
> db_webfolder.parent.requires = IS_IN_SET(folders)
> form_file = SQLFORM(db_webfolder)
>
> and it works!!!
>
> maybe this should be documented somewhere, e.g. in the docstring of
> IS_IN_SET! would make it at least a bit easier to find out
>
> On Jan 26, 11:23 pm, selecta  wrote:
>
>
>
> > oh it can ?:) sounds good, but still it solves only part of my
> > problem, I also want to change what is shown to the user in option, I
> > better show you what I want to do
>
> >     def getfolders(root = 0, spaces = '-'):
> >         folders = []
> >         for f in db(db_webfolder.id>0)(db_webfolder.parent==root)
> > (db_webfolder.file==None).select():
> >             folders.append((f.id,spaces+f.name))
> >             folders += getfolders(f.id, '-'+spaces)
> >         return folders
>
> >     folders = [(0,'root')]+getfolders()
> >     form_folder = FORM(SELECT([OPTION(name,_value=id) for id,name in
> > folders],_name='parent'),INPUT(_name='name'),INPUT
> > (_type='submit',_value="create"))
>
> > it should return something like
> > 
> > root
> > -test
> > --subfolder of test
> > --another sub of test
> > --another one
> > -another folder
> > -yet another
> > -okok
> > --tesing still
> > 
>
> > On Jan 26, 10:59 pm, Thadeus Burgess  wrote:
>
> > > IS_IN_DB can use a query can't it?
>
> > > -Thadeus
>
> > > On Tue, Jan 26, 2010 at 3:46 PM, selecta  wrote:
> > > > Is there a validator that creates a select with options from a list of
> > > > tuples
>
> > > > what I want do do is
> > > > Field("folder","integer",requires = IS_IN_TUPLELIST([('myfolder',12),
> > > > ('subfoler',23)]))
>
> > > > so that is creates
> > > > SELECT([OPTION(name,_value=id) for name,id in [('myfolder',12),
> > > > ('subfoler',23)] ],_name='parent'),INPUT(_name='name')
>
> > > > in this case I cannot use IS_IN_DB because i need to filter the
> > > > results from the table
>
> > > > --
> > > > You received this message because you are subscribed to the Google 
> > > > Groups "web2py-users" group.
> > > > To post to this group, send email to web...@googlegroups.com.
> > > > To unsubscribe from this group, send email to 
> > > > web2py+unsubscr...@googlegroups.com.
> > > > For more options, visit this group 
> > > > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: validator that creates select with options from list of tuples?

2010-01-26 Thread selecta
sry just realized that mr web2py himself is called massimo, I should
really go and sleep now

On Jan 27, 2:20 am, selecta  wrote:
> IGNORE THE POST ABOVE
> NOW TRULY SOLVED
>
> The problem with the post above was that the validator was not order
> preserving, I added some lines to the IS_IN_SET constructor, not it
> truly works
>
>      
>        >>> IS_IN_SET([('a','max'), ('b','john')])('max')
>         ('a', None)
>     """
>
>     def __init__(
>         self,
>         theset,
>         labels=None,
>         error_message='value not allowed',
>         multiple=False,
>         zero='',
>         sort=False,
>         ):
>         self.multiple = multiple
>         self.labels = labels
>         if theset and len(theset[0])==2 and (isinstance(theset[0],
> list) or isinstance(theset[0], tuple)):
>             self.theset = [str(item) for item,label in theset]
>             self.labels = [str(label) for item,label in theset]
>         else:
>             self.theset = [str(item) for item in theset]
>         if isinstance(theset, dict):
>             self.labels = theset.values()
>         self.error_message = error_message
>         self.zero = zero
>         self.sort = sort
> 
> contrutor ends there
>
> maximo if you could add this code to the trunk it would be very nice
>
> On Jan 27, 12:07 am, selecta  wrote:
>
>
>
> > SOLVED
>
> > i thought i have to write my own validator, looking into IS_IN_SET i
> > stumbeled upon the following code in the first few lines
>
> >  if isinstance(theset, dict):
> >             self.labels = theset.values()
>
> > hmmm, lets try
>
> > folders = dict(folders)
> > db_webfolder.parent.requires = IS_IN_SET(folders)
> > form_file = SQLFORM(db_webfolder)
>
> > and it works!!!
>
> > maybe this should be documented somewhere, e.g. in the docstring of
> > IS_IN_SET! would make it at least a bit easier to find out
>
> > On Jan 26, 11:23 pm, selecta  wrote:
>
> > > oh it can ?:) sounds good, but still it solves only part of my
> > > problem, I also want to change what is shown to the user in option, I
> > > better show you what I want to do
>
> > >     def getfolders(root = 0, spaces = '-'):
> > >         folders = []
> > >         for f in db(db_webfolder.id>0)(db_webfolder.parent==root)
> > > (db_webfolder.file==None).select():
> > >             folders.append((f.id,spaces+f.name))
> > >             folders += getfolders(f.id, '-'+spaces)
> > >         return folders
>
> > >     folders = [(0,'root')]+getfolders()
> > >     form_folder = FORM(SELECT([OPTION(name,_value=id) for id,name in
> > > folders],_name='parent'),INPUT(_name='name'),INPUT
> > > (_type='submit',_value="create"))
>
> > > it should return something like
> > > 
> > > root
> > > -test
> > > --subfolder of test
> > > --another sub of test
> > > --another one
> > > -another folder
> > > -yet another
> > > -okok
> > > --tesing still
> > > 
>
> > > On Jan 26, 10:59 pm, Thadeus Burgess  wrote:
>
> > > > IS_IN_DB can use a query can't it?
>
> > > > -Thadeus
>
> > > > On Tue, Jan 26, 2010 at 3:46 PM, selecta  
> > > > wrote:
> > > > > Is there a validator that creates a select with options from a list of
> > > > > tuples
>
> > > > > what I want do do is
> > > > > Field("folder","integer",requires = IS_IN_TUPLELIST([('myfolder',12),
> > > > > ('subfoler',23)]))
>
> > > > > so that is creates
> > > > > SELECT([OPTION(name,_value=id) for name,id in [('myfolder',12),
> > > > > ('subfoler',23)] ],_name='parent'),INPUT(_name='name')
>
> > > > > in this case I cannot use IS_IN_DB because i need to filter the
> > > > > results from the table
>
> > > > > --
> > > > > You received this message because you are subscribed to the Google 
> > > > > Groups "web2py-users" group.
> > > > > To post to this group, send email to web...@googlegroups.com.
> > > > > To unsubscribe from this group, send email to 
> > > > > web2py+unsubscr...@googlegroups.com.
> > > > > For more options, visit this group 
> > > > > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: Alert when email not sent sucessfully !

2010-01-26 Thread Thadeus Burgess
mail.send only fails if there was an authentication error or it was an
invalid formed email... if you send to idontex...@example.com mail.send will
still return True.

-Thadeus




On Tue, Jan 26, 2010 at 7:02 PM, hamdy.a.farag wrote:

> Hi Yannic
>
> I'm not sure whether this what you want or not, but the mail.send()
> function itself returns True or false , so you could just do :
>
> if not mail.send(to=.., subject=,) :
> response.flash = "Message was not sent"
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to
> web2py+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: RFC @completion

2010-01-26 Thread Thadeus Burgess
http://code.google.com/p/blogitizor/source/browse/src/models/plugin_compression.py

-Thadeus




On Tue, Jan 26, 2010 at 7:17 PM, hamdy.a.farag wrote:

>
> Thanks Thadeus for replying
>
> I didn't understand though, because this concept is new for me
>
> can you please give me examples ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to
> web2py+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Replacing template engine

2010-01-26 Thread Alexandre
Hi,

I want to replace web2py's template engine with Jinja
2,
anyone has some experience doing something similar? I'm trying to assign
response._caller with a custom function, but I'm not having much success, is
that the right way?

Thanks,
Alexandre Rosenfeld

Eng Comp 06 - USP São Carlos
FoG - http://fog.icmc.usp.br
IM Team - AIESEC

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Replacing template engine

2010-01-26 Thread Thadeus Burgess
Its going to be your best bet in using a different templating language. YOu
will have to make sure to only parse your HTML requests and not
json/download etc.

Basically, response._caller is a function, that returns a string which is
the html.

So you would instead of response.render(d) you would do jinja2.render(d)
where d is the dict returned from the action, you will of course have to
tell jinja where to find templates and which template to render based on
action

jinja.render(d, '/applications/init/views/' + request.action+'.html')

-Thadeus




On Tue, Jan 26, 2010 at 8:24 PM, Alexandre  wrote:

> Hi,
>
> I want to replace web2py's template engine with Jinja 
> 2,
> anyone has some experience doing something similar? I'm trying to assign
> response._caller with a custom function, but I'm not having much success, is
> that the right way?
>
> Thanks,
> Alexandre Rosenfeld
>
> Eng Comp 06 - USP São Carlos
> FoG - http://fog.icmc.usp.br
> IM Team - AIESEC
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to
> web2py+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Making auth_user Field optional

2010-01-26 Thread rppowell
Hello;

This is probably a basic thing that I am unable to figure out.

I have the following table:

db.define_table('example',
Field('relationship', db.auth_user))

When I use the addadmin interface to insert a record, I have the
option in the dropdown to provide a blank selection.

If I submit, it gives me an error: 'value not in database'.

I want figure out how to make this relationship optional/valid.

I like the power the DAL gives in making a auth_user dropdown list (if
I have users), but I also want the ability to 'blank' or null out the
user (or option).

Can someone help me figure this out?

-rppowell

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: How to load my db.py into the online sql designer?

2010-01-26 Thread rama
I was searching for a "DAL designer" and i bumped this thread.

Well you can't load your model into the sql designer. What you can do
is diagram your db table(s) in the designer than export it as xml.
Save the xml in your drive and this can be imported later for working
again with the designer.

It is frustrating to actually not find a DAL designer custom made for
web2py models when dealing with large database structure. When I
excitedly started using the designer and completed it, it was
disheartening to not see a DAL output as opposed to SQL. Well should
have been more critical on details next time.

Oh well what the heck, I will just use the sqldesigner output as a
guide for defining the DAL tables for now.

On Jan 5, 11:03 am, s...@pobox.com wrote:
> I found the online sqldesignerto be quite helpful getting things started.
> I was able to dump the web2py code, edit it very lightly (do a little
> reordering and change from SQL toDALnames).  Unfortunately, it appears my
> attempts to save my design failed and the only version of the database I
> have is the web2py source.  Is there some way to load it back into the
> onlinedesigneror generate XML which I can load?
>
> Thx,
>
> --
> Skip Montanaro - s...@pobox.com -http://www.smontanaro.net/

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Making auth_user Field optional

2010-01-26 Thread Thadeus Burgess
db.example.relationship.requires = IS_NULL_OR(IS_IN_DB(db, 'auth_user.id',
'auth_user.first_name'))

-Thadeus




On Tue, Jan 26, 2010 at 9:12 PM, rppowell  wrote:

> Hello;
>
> This is probably a basic thing that I am unable to figure out.
>
> I have the following table:
>
> db.define_table('example',
>Field('relationship', db.auth_user))
>
> When I use the addadmin interface to insert a record, I have the
> option in the dropdown to provide a blank selection.
>
> If I submit, it gives me an error: 'value not in database'.
>
> I want figure out how to make this relationship optional/valid.
>
> I like the power the DAL gives in making a auth_user dropdown list (if
> I have users), but I also want the ability to 'blank' or null out the
> user (or option).
>
> Can someone help me figure this out?
>
> -rppowell
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to
> web2py+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Serious issue with upgrading to latest version

2010-01-26 Thread weheh
Massimo, I checked all the fields with IS_DATE or IS_DATETIME
validators and all are correctly declared either 'date' or 'datetime'.
However, some of the validators are IS_NULL_OR(IS_DATE()) and
IS_NULL_OR(IS_DATETIME()). Might this cause the ticket, if a field
were None instead of a date/time?

On Jan 26, 1:19 pm, mdipierro  wrote:
> Than it bust be an application bug. I think you may have a IS_DATE
> validator on a 'string' field instead of a 'date' field.
> You also need to move over the new appadmin(s) into your app. Normally
> this is not required during upgrades since they become part of your
> app. Nevertheless there was an issue with very early appadmin that was
> fixed and may be causing the last one of your problems.
>
> On Jan 26, 12:00 pm, weheh  wrote:
>
>
>
> > Massimo, the db is MySQL, not SQLITE. I think this is going to be more
> > complicated than what you suggest. I am going to do a wipe and clean
> > install. It's been awhile since I upgraded my server's version of
> > web2py. I honestly do not like the install mechanism behind web2py.
> > Seems error prone, as measured by the many times I've had trouble with
> > it. - RG
>
> > On Jan 26, 9:54 am, mdipierro  wrote:
>
> > > Did you ever edit appadmin in your app?
> > > Please backit up and replace
> > > - controllers/appadmin.py
> > > - views/appadmin.html
> > > with the ones from the new welcome app. This may partially fix your
> > > last two problems.
>
> > > The main problem is either you have an invalid combination of
> > > validators OR you have corrupted data in database (I assume you have
> > > sqlite) OR you have converted a 'string' field into a 'date' field (or
> > > vice versa) with SQLITE. The first error for example arises from an
> > > attempt to format a date from the database but it finds a string
> > > instead of a datetime.date as it should be.
>
> > > sqlite does not enforce field type (so one can accidentally put a
> > > string in place of a date). web2py checks. Yet if you define a field
> > > as string, store a date in it, then convert it into a date, sqlite
> > > does not support alter table and you end up with corrupted data. A
> > > different database would not have permitted you to do such conversion
> > > at all.
>
> > > I need to look at the code to help you more.
>
> > > Massimo
>
> > > On Jan 26, 2:31 am, weheh  wrote:
>
> > > > I just re-downloaded the source 
> > > > fromhttp://www.web2py.com/examples/default/download
> > > > (not the latest dev snapshot) and re-installed it. I couldn't even get
> > > > web2py to start. It looked like an incomplete set of files to me.
>
> > > > So, I installed the Windows version on the server and then restarted
> > > > web2py. Now, a lot of stuff does work, including my new app. But a lot
> > > > of stuff in my old app is broken now.
>
> > > > One of my controllers is throwing this error where it used to run
> > > > fine:
>
> > > > Traceback (most recent call last):
> > > >   File "gluon/restricted.py", line 173, in restricted
> > > >   File "D:/web2py/applications/myapp/controllers/admin.py", line 962,
> > > > in 
> > > >   File "gluon/globals.py", line 96, in 
> > > >   File "gluon/tools.py", line 1847, in f
> > > >   File "D:/web2py/applications/myapp/controllers/admin.py", line 224,
> > > > in res
> > > >   File "gluon/sqlhtml.py", line 992, in __init__
> > > >   File "gluon/sql.py", line 2640, in formatter
> > > >   File "gluon/validators.py", line 2053, in formatter
> > > >   File "gluon/validators.py", line 1858, in formatter
> > > > AttributeError: 'str' object has no attribute 'strftime'
>
> > > > I looked at all the code that has strftime and all the fields that are
> > > > being formatted that way are datetimes, so it shouldn't be a problem.
> > > > This app's been running flawlessly for a long time before this new
> > > > install.
>
> > > > Even directly accessing the db via the admin interface doesn't work
> > > > well.
>
> > > > If I look at db.auth_event table I get a ticket:
>
> > > > Traceback (most recent call last):
> > > >   File "gluon/restricted.py", line 173, in restricted
> > > > File "D:/web2py/applications/myapp/views/appadmin.html", line 156, in
> > > > 
> > > >   File "gluon/globals.py", line 105, in write
> > > >   File "gluon/html.py", line 99, in xmlescape
> > > >   File "gluon/html.py", line 513, in xml
> > > >   File "gluon/html.py", line 504, in _xml
> > > >   File "gluon/html.py", line 99, in xmlescape
> > > >   File "gluon/html.py", line 513, in xml
> > > >   File "gluon/html.py", line 504, in _xml
> > > >   File "gluon/html.py", line 99, in xmlescape
> > > >   File "gluon/html.py", line 513, in xml
> > > >   File "gluon/html.py", line 504, in _xml
> > > >   File "gluon/html.py", line 99, in xmlescape
> > > >   File "gluon/html.py", line 513, in xml
> > > >   File "gluon/html.py", line 504, in _xml
> > > >   File "gluon/html.py", line 99, in xmlescape
> > > >   File "gluon/sql.py", line 1410, in __getattr__
> > > >   File "gluon/sql.py"

[web2py] Re: Serious issue with upgrading to latest version

2010-01-26 Thread mdipierro
No this it not the problem than. Yes your traceback:

Traceback (most recent call last):
  File "gluon/restricted.py", line 173, in restricted
  File "D:/web2py/applications/myapp/controllers/admin.py", line 962,
in 
  File "gluon/globals.py", line 96, in 
  File "gluon/tools.py", line 1847, in f
  File "D:/web2py/applications/myapp/controllers/admin.py", line 224,
in res
  File "gluon/sqlhtml.py", line 992, in __init__
  File "gluon/sql.py", line 2640, in formatter
  File "gluon/validators.py", line 2053, in formatter
  File "gluon/validators.py", line 1858, in formatter
AttributeError: 'str' object has no attribute 'strftime'

cleary point us to the formatter function used to format the out
output of the database for a field that has the IS_DATE validator.

On Jan 26, 10:04 pm, weheh  wrote:
> Massimo, I checked all the fields with IS_DATE or IS_DATETIME
> validators and all are correctly declared either 'date' or 'datetime'.
> However, some of the validators are IS_NULL_OR(IS_DATE()) and
> IS_NULL_OR(IS_DATETIME()). Might this cause the ticket, if a field
> were None instead of a date/time?
>
> On Jan 26, 1:19 pm, mdipierro  wrote:
>
> > Than it bust be an application bug. I think you may have a IS_DATE
> > validator on a 'string' field instead of a 'date' field.
> > You also need to move over the new appadmin(s) into your app. Normally
> > this is not required during upgrades since they become part of your
> > app. Nevertheless there was an issue with very early appadmin that was
> > fixed and may be causing the last one of your problems.
>
> > On Jan 26, 12:00 pm, weheh  wrote:
>
> > > Massimo, the db is MySQL, not SQLITE. I think this is going to be more
> > > complicated than what you suggest. I am going to do a wipe and clean
> > > install. It's been awhile since I upgraded my server's version of
> > > web2py. I honestly do not like the install mechanism behind web2py.
> > > Seems error prone, as measured by the many times I've had trouble with
> > > it. - RG
>
> > > On Jan 26, 9:54 am, mdipierro  wrote:
>
> > > > Did you ever edit appadmin in your app?
> > > > Please backit up and replace
> > > > - controllers/appadmin.py
> > > > - views/appadmin.html
> > > > with the ones from the new welcome app. This may partially fix your
> > > > last two problems.
>
> > > > The main problem is either you have an invalid combination of
> > > > validators OR you have corrupted data in database (I assume you have
> > > > sqlite) OR you have converted a 'string' field into a 'date' field (or
> > > > vice versa) with SQLITE. The first error for example arises from an
> > > > attempt to format a date from the database but it finds a string
> > > > instead of a datetime.date as it should be.
>
> > > > sqlite does not enforce field type (so one can accidentally put a
> > > > string in place of a date). web2py checks. Yet if you define a field
> > > > as string, store a date in it, then convert it into a date, sqlite
> > > > does not support alter table and you end up with corrupted data. A
> > > > different database would not have permitted you to do such conversion
> > > > at all.
>
> > > > I need to look at the code to help you more.
>
> > > > Massimo
>
> > > > On Jan 26, 2:31 am, weheh  wrote:
>
> > > > > I just re-downloaded the source 
> > > > > fromhttp://www.web2py.com/examples/default/download
> > > > > (not the latest dev snapshot) and re-installed it. I couldn't even get
> > > > > web2py to start. It looked like an incomplete set of files to me.
>
> > > > > So, I installed the Windows version on the server and then restarted
> > > > > web2py. Now, a lot of stuff does work, including my new app. But a lot
> > > > > of stuff in my old app is broken now.
>
> > > > > One of my controllers is throwing this error where it used to run
> > > > > fine:
>
> > > > > Traceback (most recent call last):
> > > > >   File "gluon/restricted.py", line 173, in restricted
> > > > >   File "D:/web2py/applications/myapp/controllers/admin.py", line 962,
> > > > > in 
> > > > >   File "gluon/globals.py", line 96, in 
> > > > >   File "gluon/tools.py", line 1847, in f
> > > > >   File "D:/web2py/applications/myapp/controllers/admin.py", line 224,
> > > > > in res
> > > > >   File "gluon/sqlhtml.py", line 992, in __init__
> > > > >   File "gluon/sql.py", line 2640, in formatter
> > > > >   File "gluon/validators.py", line 2053, in formatter
> > > > >   File "gluon/validators.py", line 1858, in formatter
> > > > > AttributeError: 'str' object has no attribute 'strftime'
>
> > > > > I looked at all the code that has strftime and all the fields that are
> > > > > being formatted that way are datetimes, so it shouldn't be a problem.
> > > > > This app's been running flawlessly for a long time before this new
> > > > > install.
>
> > > > > Even directly accessing the db via the admin interface doesn't work
> > > > > well.
>
> > > > > If I look at db.auth_event table I get a ticket:
>
> > > > > Traceback (most recent call last):
> > > > >

[web2py] Re: Custom form doesn't submit

2010-01-26 Thread Adi
Hi Denes/Massimo,

Any inputs?

On Jan 25, 8:20 pm, Adi  wrote:
> Sorry I was posting the other reply so missed this: Responses inline.
>
> > You are appending to form1 so check:
> > 1) An INPUT named 'name', is it the only 'name' field in form1?
>
> Yes. names of all fields are different.
>
> > 2) Same for the SELECT, is there another 'gender' field?
>
> No. All fields are different.
>
> > 3) A second button named 'Add another' which will submit to the
> > controller that generated form1 (self-submission), is that what you
> > want?.
>
> A button in the same row as the inserted form which says "Add another"
> & submits the data to the same controller and function. So, Yes.
>
>
>
> > Denes.
>
> On Jan 25, 8:15 pm, DenesL  wrote:
>
>
>
> > On Jan 25, 6:35 am, Adi  wrote:
>
> > > Hi all,
>
> > > I'm trying to build a custom form in this fashion:
>
> > > There's a parent table and a child table (many one relationship). I've
> > > created a read-only SQLFORM for a record of the parent, and then I'm
> > > trying this:
>
> > > form1 = SQLFORM(db.parent, readonly=True)
>
> > > form2 = SQLFORM(db.child, keepopts=['gender'])
>
> > > form1[0].append(TR(INPUT(_type='text', name='name',
> > > requires=IS_NOT_EMPTY()), \
> > > SELECT(form2.custom.inpval.gender, name='gender'),\
> > > INPUT(_type='submit', _value='Add another'))
>
> > > This gives me the appearance of the form as I want, i.e., parent read-
> > > only record in a form, with additional single row of updateable child
> > > form with "Add another" button. The second form is to provide a drop-
> > > down list for 'gender'. However, in this case the "Add another" button
> > > doesn't submit, i.e, I can't get control in form1.accepts or
> > > form2.accepts.
>
> > > What am I doing wrong?
>
> > You are appending to form1 so check:
> > 1) An INPUT named 'name', is it the only 'name' field in form1?
> > 2) Same for the SELECT, is there another 'gender' field?
> > 3) A second button named 'Add another' which will submit to the
> > controller that generated form1 (self-submission), is that what you
> > want?.
>
> > Denes.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Serious issue with upgrading to latest version

2010-01-26 Thread weheh
I hear you and it makes perfect sense. However, I just quadruple-
checked the model file and I guarantee (no lying this time) that every
IS_DATE() and IS_DATETIME() validator corresponds to a Field of type
'date' or 'datetime" respectively.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Issues with join...

2010-01-26 Thread Jason Brower
I have a database as follow:
# coding: utf8
from datetime import datetime, date, time
now = datetime.utcnow()
today = date.today()

db = SQLDB('sqlite://paint.sqlite')

db.define_table('order_que',
Field('customer_code', length=30),
Field('paint'),
Field('can_size', requires=IS_IN_SET(['½ Litre', '1 Litre', '10
Litre', '30 Litre'])),
Field('pickup_time'),
Field('que_letter',
requires=IS_IN_SET([None,"A","B","C","D","E","F"])))

db.define_table('paint',
Field('name', length=30, requires=IS_NOT_EMPTY(), unique=True),
Field('base_paint', length=3, requires=IS_NOT_EMPTY()),
Field('hex_color', length=6))

db.define_table('tint',
Field('name', length=3, requires=IS_NOT_EMPTY()))

db.define_table('paint_tints',
Field('paint_id', db.paint),
Field('tint_id', db.tint),
Field('units', 'integer'))


db.order_que.paint.requires = IS_IN_DB(db, 'paint.id',  '%(name)s')
db.paint_tints.paint_id.requires=IS_IN_DB(db, 'paint.id', '%(name)s')
db.paint_tints.tint_id.requires=IS_IN_DB(db, 'tint.id', '%(name)s')
db.order_que.customer_code.requires=IS_NOT_EMPTY()

And I am trying to do a join like this...
plate_que = db((db.order_que.que_letter != None) ==
db.paint.name).select()
But no matter what I put into order_que.que_letter I don't get any
results.  Any ideas?
BR,
Jason

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Huge amount of data slowing page loads...

2010-01-26 Thread Jason Brower
I have a database with 16k entries in it...
I have a one to many relation with them.
When I create a form with the requiers=IS_ID_DB() feature I notice a
huge lag in page load time. (I would to if I had 16k entries in one drop
down too.)
Is there a way to do this similar to the autocompletion but have it so I
can search for any part of it. (Like the awesome bar in firefox)
So I have
Jason
Jane
John
Gane
and when I press "a" it gives:
Jason
John
Gane
and so forth.
Best Regards,
Jason Brower


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] bug in SQLFORM.factory?

2010-01-26 Thread Frederik Wagner
Hi .*,

it seems to me that there is a bug saving boolean fields with
SQLFORM.factory forms.
If I define a boolean field in a table and use the standard SQLFORM to
make an input form, the accept function will save 'T' of 'F' to the
DB.
Whereas in the case where I create a form with SQLFORM.factory, do a
FORM.accept and an explicit db.insert, instead of 'F' there will be a
NULL on the DB.

Here a test setup:

DB:
db.define_table('test',Field('bool','boolean'))

CONTROLLER:
def test1():
form=SQLFORM.factory(Field("bool","boolean"))

if FORM.accepts(form, request.vars, session, keepvalues=True):
db.test.insert(bool=request.vars.bool)

return dict(form=form,list=db().select(db.test.ALL))


def test2():
form=SQLFORM(db.test)

if form.accepts(request.vars, session, keepvalues=True):
response.flash = 'done'

return dict(form=form,list=db().select(db.test.ALL))


test1 gives 'True' ('T') and 'None' (NULL) and test2 'True' ('T') and
'False' ('F').

A bug or my problem? :-)

Bye
Frederik

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Huge amount of data slowing page loads...

2010-01-26 Thread desfrenes
this works like a charm: http://docs.jquery.com/Plugins/Autocomplete

On 27 jan, 08:24, Jason Brower  wrote:
> I have a database with 16k entries in it...
> I have a one to many relation with them.
> When I create a form with the requiers=IS_ID_DB() feature I notice a
> huge lag in page load time. (I would to if I had 16k entries in one drop
> down too.)
> Is there a way to do this similar to the autocompletion but have it so I
> can search for any part of it. (Like the awesome bar in firefox)
> So I have
> Jason
> Jane
> John
> Gane
> and when I press "a" it gives:
> Jason
> John
> Gane
> and so forth.
> Best Regards,
> Jason Brower

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.