[web2py:30695] yet another wiki with versioning and auth

2009-09-10 Thread mdipierro

http://web2py.com/examples/static/web2py.app.wiki2.w2p

this one has 49 lines of models and controllers code (including 13
lines of scaffolding code) and 20 lines of views html code.

I am going to use this one to rewrite T3. I think it can be done with
very little work.

Time for you to request some features.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30694] Re: new in trunk

2009-09-10 Thread mdipierro



On Sep 11, 1:19 am, Richard  wrote:
> > on delete cascade in SQLite
>
> Fantastic! My feature request for this can be 
> closed:http://code.google.com/p/web2py/issues/detail?id=50

Can you do it or should I do it?

> Did the solution involve sqlite triggers?

No. The solution is quite dumb. recursively delete all referencing
records. I guess it could be improved using triggers.

>
> > row = db(db.mytable.id>0).select().first()
>
> very convenient
>
> Richard
>
> On Sep 11, 3:12 pm, mdipierro  wrote:
>
> > I have made some changes to the code in trunk:
>
> > 1) Since tonight I attended a presentation about how SQLAlchemy can do
> > on delete cascade in SQLite even if SQLite does not support it, I
> > implemented this feature in web2py too. There is nothing you have to
> > do it now there by default. For example:
>
> > db=DAL('sqlite://test.db')
> > db.define_table('a',Field('name'))
> > db.define_table('b',Field('a',db.a,ondelete='CASCADE'),Field('name'))
> > db.a.insert(name='xxx1')
> > db.a.insert(name='xxx2')
> > db.a.insert(name='xxx3')
> > db.a.insert(name='xxx4')
> > db.b.insert(a=2,name='yyy1') #(1)
> > db.b.insert(a=2,name='yyy2') #(1)
> > db.b.insert(a=3,name='yyy3')
> > db(db.a.id==2).delete()
> > for row in db(db.b.a==2).select(): print row # prints nothing as it
> > should
>
> > Notice ondelete='CASCADE' is default.
>
> > 2) you can now do:
>
> > row = db(db.mytable.id>0).select().first()
> > row = db(db.mytable.id>0).select().last()
>
> > and row is None if no records are selected.
>
> > 3) I fixed the problem with the memory leak reported by zahariash
>
> > 4) I refactored some code in main.py, compileapp.py and globals.py.
> > This should make the code cleaner. Hopefully I did not break it.
> > Please give it a try.
>
> > Massimo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30693] Re: new in trunk

2009-09-10 Thread Richard

> on delete cascade in SQLite
Fantastic! My feature request for this can be closed:
http://code.google.com/p/web2py/issues/detail?id=50
Did the solution involve sqlite triggers?

> row = db(db.mytable.id>0).select().first()
very convenient

Richard


On Sep 11, 3:12 pm, mdipierro  wrote:
> I have made some changes to the code in trunk:
>
> 1) Since tonight I attended a presentation about how SQLAlchemy can do
> on delete cascade in SQLite even if SQLite does not support it, I
> implemented this feature in web2py too. There is nothing you have to
> do it now there by default. For example:
>
> db=DAL('sqlite://test.db')
> db.define_table('a',Field('name'))
> db.define_table('b',Field('a',db.a,ondelete='CASCADE'),Field('name'))
> db.a.insert(name='xxx1')
> db.a.insert(name='xxx2')
> db.a.insert(name='xxx3')
> db.a.insert(name='xxx4')
> db.b.insert(a=2,name='yyy1') #(1)
> db.b.insert(a=2,name='yyy2') #(1)
> db.b.insert(a=3,name='yyy3')
> db(db.a.id==2).delete()
> for row in db(db.b.a==2).select(): print row # prints nothing as it
> should
>
> Notice ondelete='CASCADE' is default.
>
> 2) you can now do:
>
> row = db(db.mytable.id>0).select().first()
> row = db(db.mytable.id>0).select().last()
>
> and row is None if no records are selected.
>
> 3) I fixed the problem with the memory leak reported by zahariash
>
> 4) I refactored some code in main.py, compileapp.py and globals.py.
> This should make the code cleaner. Hopefully I did not break it.
> Please give it a try.
>
> Massimo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30692] Re: cron error for no cron

2009-09-10 Thread Richard

hi,

In my above example I used "--no-cron" but still got a cron error.
Is there another option?

Richard


On Sep 11, 2:56 pm, Yarko Tymciurak  wrote:
> see output of:
>
> python web2py.py -h
>
> for the option to disable cron
>
> On Thu, Sep 10, 2009 at 7:14 PM, Richard  wrote:
>
> > hi,
>
> > I have a backend job that I run periodically with:
> > > python -u web2py.py --import_models --no-cron --shell=test
> > --run=applications/test/modules/backend.py
>
> > As you can see I am specifying no cron, but every so often I get this
> > error:
> > WARNING:root:alreadyrunning
> > WARNING:root:WEB2PY CRON: Stale cron.master detected
> > ERROR:root:WEB2PY CRON: Cron fail, reason: [Errno 2] No such file or
> > directory: '/home/web2py/applications/admin/cron/cron.running'
>
> > Do you have an idea what is going on?
> > And is there a way to completely disable cron?
>
> > Richard
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30691] Re: autocomplete

2009-09-10 Thread suiato

Hi Iceberg

2009/9/11 Iceberg :
...
> Actually, Limodou, the author of uliweb and ulipad is one of the early
> contributors of web2py, and is still recognized in web2py's
> contributor list. For some design philosophy reason he decided to
> start his own uliweb project which is not as popular as web2py nor
> ulipad (yet?). But let's wish him luck anyway.

thanks for your comment and info. good to know his connection to
web2py.

>
> And ulipad is also a good IDE. I am using it too. I think Limodou
> would be happy to know ulipad has one more international user, from
> Japan. Welcome on board Teru. :-)

thanks, i'm glad to find it and join the users. it's a good software,
has a potential to be better and bigger, but has not been updated over
a year. may need some help and vision to grow.

now daydreaming of somehow connecting web2py to ulipad...
cut and paste works, of course, but...
how about using xmlrpc (one of Massimo's favorites)?
how difficult is it to embed ulipad into web2py?
aiming toward an ambitious vision of making web2py not just a web
framework but also an ide on web, as the name web2py,  'web (software)
to (program) python', indicates.

ulipad's plugin/mixin architecture sounds interesting. wish web2py's
plugin routines get implemented soon.

--
Teru
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30690] Re: how to let end user (not developer) define table on fly

2009-09-10 Thread mdipierro

The db.define_table(...) does two things:
1) the first time it is executed it creates the table
2) the other times it is executed it informs web2py that you expect to
have that table (if not it is recreated or migrated accordingly).

This means it has to be executed at every request. Not just in one
controller.

You can have a user click a button and create a table but the info
about that table also have to be stored in the database so that it can
be retrieved on sub-sequence requests.

T3 does it. Look into the source code.

On Sep 11, 12:32 am, wf321  wrote:
> I try let end user create their table on fly , for example, in
> default.py
>
> I have 2 function
>
> def somepage()
>     if not db.has_key('sometable'):
>         db.define_table('sometable', 
>
>     redurect(r-request, f='nextpage')
>
> def nextpage()
>     if not db.has_key('sometable'):
>        showerror()
>
> when user call somepage(), it do create a new table 'sometable' in
> database, after redirect
> to nextpage(),  'sometable' still in database,  but db.has_key
> ('sometable') retun false,
>
> does anyone know what happen?
>
> and if change nextpage to   db.has_key('db_py_table') ( db_py_table is
> define model\db.py ) it retuen true.
>
> Can anyone help to tell me how to code to  create table in controler
> py and it can access by other function?
>
> Thanks a lot.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30689] how to let end user (not developer) define table on fly

2009-09-10 Thread wf321

I try let end user create their table on fly , for example, in
default.py

I have 2 function

def somepage()
if not db.has_key('sometable'):
db.define_table('sometable', 

redurect(r-request, f='nextpage')



def nextpage()
if not db.has_key('sometable'):
   showerror()



when user call somepage(), it do create a new table 'sometable' in
database, after redirect
to nextpage(),  'sometable' still in database,  but db.has_key
('sometable') retun false,

does anyone know what happen?


and if change nextpage to   db.has_key('db_py_table') ( db_py_table is
define model\db.py ) it retuen true.

Can anyone help to tell me how to code to  create table in controler
py and it can access by other function?

Thanks a lot.



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30688] Re: file descriptors leak

2009-09-10 Thread mdipierro

please check if it is fixed. I had to change your fix because it was
not python 2.4 compliant.

On Sep 10, 11:52 am, zahariash  wrote:
> Hello,
>
> I've found some weird behavior of web2py script. After few hours from
> script start it throw error:
> OSError: [Errno 24] Too many open files
>
> Indeed, there is many attached files:
> lsof -p 13149
>
> python2.5 13149 www-data   24u   REG   202,0       0    2702 /tmp/
> tmpkvWcld (deleted)
> python2.5 13149 www-data   36u   REG   202,0       0    2708 /tmp/
> tmpL9F9BA (deleted)
> python2.5 13149 www-data   30u   REG   202,0       0    2659 /tmp/
> tmpLNUWac (deleted)
> ...
>
> It seems, that temp file generated in wsgibase function isn't closed
> properly.
> Here is fix. Works for me...
>
> --- CUT -
> +++ /src/web2py/gluon/main.py   Thu Sep 10 18:18:43 2009
> @@ -464,7 +464,9 @@
>          return HTTP(http_error_status, error_message_ticket
>                       % dict(ticket=ticket), web2py_error='ticket %s'
>                       % ticket).to(responder)
> -
> +    finally:
> +        if request.body:
> +            request.body.close()
>
>  (wsgibase, html.URL) = rewrite(wsgibase, html.URL)
>
> --- CUT -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30687] new in trunk

2009-09-10 Thread mdipierro

I have made some changes to the code in trunk:

1) Since tonight I attended a presentation about how SQLAlchemy can do
on delete cascade in SQLite even if SQLite does not support it, I
implemented this feature in web2py too. There is nothing you have to
do it now there by default. For example:

db=DAL('sqlite://test.db')
db.define_table('a',Field('name'))
db.define_table('b',Field('a',db.a,ondelete='CASCADE'),Field('name'))
db.a.insert(name='xxx1')
db.a.insert(name='xxx2')
db.a.insert(name='xxx3')
db.a.insert(name='xxx4')
db.b.insert(a=2,name='yyy1') #(1)
db.b.insert(a=2,name='yyy2') #(1)
db.b.insert(a=3,name='yyy3')
db(db.a.id==2).delete()
for row in db(db.b.a==2).select(): print row # prints nothing as it
should

Notice ondelete='CASCADE' is default.

2) you can now do:

row = db(db.mytable.id>0).select().first()
row = db(db.mytable.id>0).select().last()

and row is None if no records are selected.

3) I fixed the problem with the memory leak reported by zahariash

4) I refactored some code in main.py, compileapp.py and globals.py.
This should make the code cleaner. Hopefully I did not break it.
Please give it a try.

Massimo


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30686] Re: autocomplete

2009-09-10 Thread Iceberg

On Sep11, 11:16am, suiato  wrote:
> i still think of this topic of autocompletion/snippets/collaboration
> features when editing...
>
> found a good editor called Ulipad with nice features like
> autocompletion, snippets, etc. python-based with wxPython.  easy to
> install and use.
>
> found that its author wrote a web framework Uliweb(http://
> uliwebproject.appspot.com/), too. it is built by combining existing
> tools/ideas including Werkzeug, Django and web2py :), with
> modification/addition.
>
> --
> Teru
>

Actually, Limodou, the author of uliweb and ulipad is one of the early
contributors of web2py, and is still recognized in web2py's
contributor list. For some design philosophy reason he decided to
start his own uliweb project which is not as popular as web2py nor
ulipad (yet?). But let's wish him luck anyway.

And ulipad is also a good IDE. I am using it too. I think Limodou
would be happy to know ulipad has one more international user, from
Japan. Welcome on board Teru. :-)

PS: Sorry for this slightly off-topic post.

--
Iceberg
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30685] Re: SQLite for Production?

2009-09-10 Thread mdipierro

1) actually migrations work better in posgresql because all types of
alter tables are supported (http://www.sqlite.org/faq.html#q11).

For example if you change the type of a column with postgresql web2py
will create a new column, try to convert the data, drop the old
column, rename the old column. This may fail if data cannot be
converted (like a string into an int with value that are not int).

While sqlite does not handle column drop so web2py just does not do
the migration. It just tried to parse the data when extracted
according to the new column type. That migration can never fails
because it never actually happens but it can lead to other problems
later.

2) I have something to add about ondelete CASCADE but I will do it in
another thread.



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30684] Re: web2py newbee: INPUT looping

2009-09-10 Thread mdipierro

Not sure if you are asking this:

INPUT(_id='id_x',_name='id_x',_class='id_x',_type='string')

you can also do:

form=SQLFORM.factory(*[Field(name,label=label) for name,label in
myElem])

it will create the 'id' and 'class' following web2py convention so
that you do not have to make up your own.

Massimo


On Sep 10, 10:08 pm, Denis  wrote:
> Hello,
>             I am well versed in Python but a newbie in web2py.
>
> I have a list of elements and I'd like to generate INPUTs for it using
> a for loop if possible
>
> Specifically
>
> myElem = [ ['id_x', 'One'], ['id_y', 'Two'], ['anotherId',
> 'SomeValue']]
>
> should become
>
> 
>  One 
>  Two 
>  SomeValue 
> 
>
> I've played with
> INPUT (.) for id,label in myElem
> but I cannot figure out the syntax to change it to something like
> INPUT(..), label, BR() for id,label in myElem
>
> I went through the manual but couldn't find anything to help me.
>
> Thanks in advance
>
> Denis Rouleau
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30683] Re: SQLite for Production?

2009-09-10 Thread Yarko Tymciurak
what makes you say that?  I've had good luck w/ postgres migrations.  Have
you had problems?

On Thu, Sep 10, 2009 at 7:36 PM, Richard  wrote:

>
> One advantage of sqlite is that migrations work much better than
> postgres, so it is great to use while developing your app.
>
>
> On Sep 11, 4:14 am, Joe Barnhart  wrote:
> > Good point.  Another factor is handling threads.  IIRC Sqlite won't
> handle
> > more than 1 thread while the others will.
> >
> > On Thu, Sep 10, 2009 at 8:01 AM, ctalley  wrote:
> >
> > > FYI, something to consider is that SQLite doesn't natively support
> > > foreign key constraints.  For example, ON DELETE CASCADE doesn't
> > > work.  It is possible to write triggers to handle referential
> > > integrity, but a dbms like postgresql just does it.  So, depending on
> > > your requirements, postgresql might be a better option for that
> > > reason.
> >
> > >http://www.sqlite.org/cvstrac/wiki?p=ForeignKeyTriggers
> >
> > > On Sep 9, 12:16 pm, greenpoise  wrote:
> > > > Is it a good alternative? I am a fan of Postgresql myself BUT just
> for
> > > > the simplicity of the whole development, can SQLite handle the job in
> > > > the long run (users, record, db size)? I am sure is almost
> transparent
> > > > when using both (correct me if I am wrong) but doesnt the Auth method
> > > > changes?
> >
> > > > Feedback greatly appreciated.
> >
> > > > Dan
> >
> >
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30682] help with static files in webfaction

2009-09-10 Thread drayco

Good night, I ask for your support with this situation

I have a subdomain on WebFaction.
At this time, I can see and work with the admin, welcome and a mysql
database in my application in WebFaction.
However, when I request my subdomain, the initial application (init)
loads blank pages. I think, the init application is not loading with
the custom style that I have in the static folder. However, the
default applications of web2py loads their styles without problems. Do
you have any suggestions?

This is my configuration in httpd.conf

=  START httpd.conf listing  ==

ServerRoot "/home/[YOUR ACCOUNT]/webapps/apachewsgi/apache2"

LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule wsgi_module modules/mod_wsgi.so
LoadModule alias_module modules/mod_alias.so
LoadModule authz_host_module modules/mod_authz_host.so

KeepAlive Off
Listen [PORT SPECIFIED BY WEBFACTION]

WSGIScriptAlias / /home/[YOUR ACCOUNT]/webapps/apachewsgi/web2py/
wsgihandler.py
WSGIDaemonProcess web2py user=[YOUR ACCOUNT] group=[YOUR ACCOUNT] \
 home=/home/[YOUR ACCOUNT]/webapps/apachewsgi/web2py \
 processes=1 maximum-requests=1000

NameVirtualHost 127.0.0.1:[PORT SPECIFIED BY WEBFACTION]

ServerName www.example.com
DocumentRoot /home/[YOUR ACCOUNT]/webapps/apachewsgi/web2py/
applications

Options FollowSymLinks
AllowOverride None


Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all


 AllowOverride None
 Order Allow,Deny
 Deny from all
 
   Allow from all
 
 
  AliasMatch ˆ/([ˆ/]+)/static/(.*) /home/[YOUR ACCOUNT]/webapps/
apachewsgi/web2py/applications/$1/static/$2
 
Order Allow,Deny
Allow from all



LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\"
\
 \"%{User-Agent}i\"" combined
CustomLog logs/access_log combined
ServerLimit 2

=  END httpd.conf listing  ==
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30681] Re: cron error for no cron

2009-09-10 Thread Yarko Tymciurak
see output of:

python web2py.py -h

for the option to disable cron

On Thu, Sep 10, 2009 at 7:14 PM, Richard  wrote:

>
> hi,
>
> I have a backend job that I run periodically with:
> > python -u web2py.py --import_models --no-cron --shell=test
> --run=applications/test/modules/backend.py
>
>
> As you can see I am specifying no cron, but every so often I get this
> error:
> WARNING:root:alreadyrunning
> WARNING:root:WEB2PY CRON: Stale cron.master detected
> ERROR:root:WEB2PY CRON: Cron fail, reason: [Errno 2] No such file or
> directory: '/home/web2py/applications/admin/cron/cron.running'
>
>
> Do you have an idea what is going on?
> And is there a way to completely disable cron?
>
> Richard
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30680] Re: web2vy

2009-09-10 Thread Yarko Tymciurak
what would be the compelling reason to commit to that work regardless?


On Thu, Sep 10, 2009 at 7:14 PM, Thadeus Burgess
wrote:

> Why would anyone bother porting a system that is still in heavy
> development?
>
>
> On Thu, Sep 10, 2009 at 4:48 PM, David Hofmann wrote:
>
>> Hi all here, have somebody though on porting web2py framework in groovy ?(
>> Is somebody doing it already ? )
>>
>> I am asking this because groovy has the same potencial as python, just
>> with a liiitle more complexity than straigth python.
>>
>> I have made ( http://code.google.com/p/swebj/ ) a similar web2py request
>> dispatching mecanism for java servlets for some SE aplication that needed to
>> serve some dinamic content, It worked fine for me and I didn't even try to
>> imitate the whole framework in Java because it's just stupid the amount of
>> work that it will imply, but in groovy that's another thing. The project
>> does not even have a binaries to download, it was just a weekend of work and
>> just provides similar url dispatching mecanism to java method clases, it
>> does not worth to look at it.
>>
>> But going back to the first question made. The reason it's not done or is
>> not started yet is because
>> 1. Nobody cares about it here ?
>> 2. Somebody is doing it but need comunity help ?
>> 3. Nobody here is skilled enough ( like me ) in groovy ? ( which does not
>> make much sense because same python coding patterns and features I think is
>> very similar in groovy )
>> 4. X ( Somebody has a better reason why such a GREAT framework like web2py
>> can not be ported to another language ? )
>>
>> I have a couple of years working in java and a couple of months in
>> dynamic/functional languages now.
>> Don't take me wrong please, I just think that those ( Massimo :) ) who
>> create this framework would be able/maybeWant to lead a comunity porting
>> effort.
>>
>> What do you think ?
>>
>> --
>> David Daniel Hofmann
>> WebVAS, Nucleo S.A. - Telecom Personal Paraguay
>> http://www.google.com/profiles/hofmanndavid
>>
>>
>>
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30679] Re: Separation of Concerns

2009-09-10 Thread mdipierro

Yes. The fact that you can do it, does not man you should do it.

Sometime need to build HTML programmatically, for this reason web2py
provides a OOP server side representation of the DOM so that you never
have to manipulate strings in the controllers.

You can use this to build forms but you do not have to.

Often it is better to use

form=SQLFORM.factory(Field(...), Field(...), Field(...))

and then customize the form in the view.

Massimo


On Sep 10, 8:13 pm, Ryan Montgomery  wrote:
> I am new to web2py and I have some questions. The first one being:
>
> Does the ability to creating Forms with html tables in the controller
> violate the principal of "Separation of Concerns"? Shouldn't this
> "view logic" be handled in the view and not in the controller?
>
> Please reference example 
> #28http://www.web2py.com/examples/default/examples#form_examples
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30678] web2py newbee: INPUT looping

2009-09-10 Thread Denis

Hello,
I am well versed in Python but a newbie in web2py.

I have a list of elements and I'd like to generate INPUTs for it using
a for loop if possible

Specifically

myElem = [ ['id_x', 'One'], ['id_y', 'Two'], ['anotherId',
'SomeValue']]

should become


 One 
 Two 
 SomeValue 


I've played with
INPUT (.) for id,label in myElem
but I cannot figure out the syntax to change it to something like
INPUT(..), label, BR() for id,label in myElem

I went through the manual but couldn't find anything to help me.

Thanks in advance

Denis Rouleau

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30677] Separation of Concerns

2009-09-10 Thread Ryan Montgomery

I am new to web2py and I have some questions. The first one being:

Does the ability to creating Forms with html tables in the controller
violate the principal of "Separation of Concerns"? Shouldn't this
"view logic" be handled in the view and not in the controller?

Please reference example #28 
http://www.web2py.com/examples/default/examples#form_examples

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30676] Re: win32com and web2py

2009-09-10 Thread mdipierro

tell your friends. ;-)

On Sep 10, 9:58 pm, tvw  wrote:
> Thank you so much :)
>
> Been trying for ages to figure that out on my own - works like a dream
> now.
>
> Recent convert to python from perl. web2py automates a LOT of things I
> used to do very manually.
>
> I think this is going to be a big hit.
>
> On Sep 10, 9:08 am, mdipierro  wrote:
>
> > I would put the code below in a module in web2py/ and from the module
> > import serv in your apps.
>
> > On Sep 10, 7:16 am, tvw  wrote:
>
> > > Hi,
> > >     I've been trying to usewin32comwith web2py to get data from an
> > > external process. I have been using the following in a controller for
> > > my app (default.py)
>
> > > importwin32com.client
> > > serv =win32com.client.Dispatch("MyService")
>
> > > Once I installed web2py source this worked fine, however sometimes it
> > > seems to try to create a second instance of the com connection to my
> > > service which then fails (in another thread ?) as only one can exist
> > > at a time.
>
> > > I would like to create only one instance of the com connection when
> > > web2py starts and then share that with all applications. My question
> > > is where should I put the above lines in web2py so that the com
> > > connection is shared between apps and how should the instance be
> > > referenced from each app.
>
> > > I hope I have made sense here. Please let me know if anyone can help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30675] Re: Fixing Autocomplete for Web2Py With Pydev IDE

2009-09-10 Thread Bottiger

For anyone curious, I found out that pasting this at the top of your
web2py files seems to be the only way to fix pydev. Its a somewhat
updated version of Guido Kollerie's method all in one. Its too bad
there isn't a better fix.

if 0:
from gluon.sql import *
from gluon.sql import DAL
from gluon.validators import *
from gluon.html import *
from gluon.http import *
from gluon.sqlhtml import SQLFORM, SQLTABLE, form_factory
from gluon.globals import *
session = Session()
request = Request()
response = Response()

On Sep 10, 8:11 pm, Bottiger  wrote:
> Ah never mind. I forgot to enable the source analyzer, so you still
> have to import the data.
>
> On Sep 10, 7:55 pm, Bottiger  wrote:
>
> > I starting to use PyDev now that the extensions are now free. I
> > remembered some of you had problems with the autocomplete because of
> > the Web2Py globals. Here is a solution.
>
> > When you add a Python Interpreter, go into forced globals. Click new.
> > Copy and paste the following:
>
> > request,response,session,cache,redirect,HTTP,TR,XML,URL,BEAUTIFY,A,BODY,BR,B,CENTER,CODE,DIV,EM,EMBED,FIELDSET,LEGEND,FORM,H1,H2,H3,H4,H5,H6,IFRAME,HEAD,HR,HTML,IMG,INPUT,LABEL,LI,LINK,MENU,META,OBJECT,OL,ON,OPTION,P,PRE,SCRIPT,SELECT,SPAN,STYLE,TABLE,THEAD,TBODY,TFOOT,TAG,TD,TEXTAREA,TH,TITLE,TT,T,UL,IS_STRONG,IS_LOWER,IS_UPPER,IS_ALPHANUMERIC,IS_DATETIME,IS_DATE,IS_EMAIL,IS_EXPR,IS_FLOAT_IN_RANGE,IS_IMAGE,IS_INT_IN_RANGE,IS_IN_SET,IS_IPV4,IS_LIST_OF,IS_LENGTH,IS_MATCH,IS_NULL_OR,IS_NOT_EMPTY,IS_TIME,IS_UPLOAD_FILENAME,IS_URL,CLEANUP,CRYPT,IS_IN_DB,IS_NOT_IN_DB,SQLDB,SQLField,SQLFORM,SQLTABLE
>
> >http://imgur.com/SnRwh.png
>
> > I think this is one good solution.
>
> > Another possibility is to create a file that imports all of those
> > globals, and then at the top of your web2py files, you would import
> > that file.This solution would let you see docstrings and other details
> > but may be more inconvenient. I'll let one of you implement that.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30674] Re: Enable line numbering in the admin interface editor???

2009-09-10 Thread suiato

On 9月11日, 午前10:00, cesmiga  wrote:
> All:
>
> Is there a way to enable line numbering in the admin interface editor?

i see line numbers on the web2py editor when editing models/
controllers/views.
what is 'admin interface editor'?

>
> Thank you,
> Christopher
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30673] Re: Ajax

2009-09-10 Thread Jason Brower

If you looking for that it is in the manual.  And the examples.
I think you can create a page like generic.xml like in a new application
if you deleted one, just make it.
Then you just ask for the page with .xml at the end.
A new application has the framework for what I think your wanting to do.
And if I am not mistaken you have the manual, it talks about that in
great detail too.
Regards,
Jason Brower


On Thu, 2009-09-10 at 12:31 -0700, eddwinston wrote:
> Hi guys,
> 
> The login now works, the session is saved but the value returned from
> the server is still a full page html markup. How can I get either xml
> or json as a return value?
> 
> Thanks
> Winston
> 
> On Sep 10, 10:42 am, eddwinston  wrote:
> > Thanks a lot guys. I will try it when I get hands on my app again.
> >
> > Regards,
> > Winston
> >
> > On Sep 10, 9:28 am, "mr.freeze"  wrote:
> >
> > > Try this. u is the url, i is the form index (set to 0 for a single
> > > form on the page), and t is the target for the response.
> >
> > > function ajaxSubmit(u,i,t){
> > > frm = jQuery("form:eq(" + i + ")");
> > > query = 'undefined=' + i;
> > > if (frm.length==1){query = frm.serialize();}
> > > jQuery.ajax({type: "POST", url: u, data: query, success: function
> > > (msg) { if(t==':eval') eval(msg); else jQuery("#"+t).html(msg); } });
> >
> > > }
> >
> > > On Sep 10, 1:05 am, eddwinston  wrote:
> >
> > > > Hi,
> >
> > > > I am away from my app right now but I guess it would be something like
> > > > this:
> >
> > > >   data: '{ "name_of_ username_field": "username_field_value",
> > > > "name_of_password_field": "password_field_value",
> > > > "_formkey": "form_key_value",
> > > > "_formname": "formname_value" }'
> >
> > > > On Sep 10, 8:45 am, mdipierro  wrote:
> >
> > > > > But this line
> >
> > > > >data: {},
> >
> > > > > is not sending the username and password to the login page. It should
> > > > > also send the formkey and formname.
> >
> > > > > On Sep 10, 12:11 am, eddwinston  wrote:
> >
> > > > > > Hi,
> >
> > > > > > This is what I did:
> >
> > > > > > jQuery.ajax({
> > > > > >type: "POST",
> > > > > >url: "{{=URL(r=request,c='default', f='user', args='login'}}",
> > > > > >data: {},
> > > > > >success: function(response) {
> > > > > >   alert(response); // This line produced a complete page markup 
> > > > > > in
> > > > > > the alert dialog
> > > > > >},
> > > > > >error: failure_callback
> > > > > >  });
> >
> > > > > > On Sep 10, 6:31 am, mdipierro  wrote:
> >
> > > > > > > show us the code
> >
> > > > > > > On Sep 9, 10:21 pm, eddwinston  wrote:
> >
> > > > > > > > Hi,
> >
> > > > > > > > I am trying to make an ajax login, I am currently sending 
> > > > > > > > request to
> > > > > > > > this url: [app]/default/user/login. But it has been fruitless. 
> > > > > > > > I just
> > > > > > > > get a full page html markup and the user will not be logged in. 
> > > > > > > > Is
> > > > > > > > there a way I can do it?
> >
> > > > > > > > Regards,
> > > > > > > > Winston
> > 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30672] Re: autocomplete

2009-09-10 Thread suiato

i still think of this topic of autocompletion/snippets/collaboration
features when editing...

found a good editor called Ulipad with nice features like
autocompletion, snippets, etc. python-based with wxPython.  easy to
install and use.

found that its author wrote a web framework Uliweb(http://
uliwebproject.appspot.com/), too. it is built by combining existing
tools/ideas including Werkzeug, Django and web2py :), with
modification/addition.

--
Teru


On 9月5日, 午後1:21, suiato  wrote:
> quickly reading the manual of Amy Editor, its 'snippets' chapter shows
> rich features including  what i mentioned in the previous post.
> to make full use of its power, it can run on a server, written in PHP.
>
> Timmie in [web2py:29959] showed links to editors:
> *http://labs.mozilla.com/bespin/
> *http://codenode.org/
> Both are very young software (codenode ver.0.01, bespin ver.0.1?), and
> have attractive features including auto-completion and collaboration.
> codenote is written in python. bespin can run a python server.
>
> it looks such features as autocompletion and collaborative editing are
> being developed in new web-based code editors. developing
> autocompletion feature specific to web2py sounds still interesting to
> me, but may need some time before time matures.
>
> --
> Teru
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30671] Re: Fixing Autocomplete for Web2Py With Pydev IDE

2009-09-10 Thread Bottiger

Ah never mind. I forgot to enable the source analyzer, so you still
have to import the data.

On Sep 10, 7:55 pm, Bottiger  wrote:
> I starting to use PyDev now that the extensions are now free. I
> remembered some of you had problems with the autocomplete because of
> the Web2Py globals. Here is a solution.
>
> When you add a Python Interpreter, go into forced globals. Click new.
> Copy and paste the following:
>
> request,response,session,cache,redirect,HTTP,TR,XML,URL,BEAUTIFY,A,BODY,BR,B,CENTER,CODE,DIV,EM,EMBED,FIELDSET,LEGEND,FORM,H1,H2,H3,H4,H5,H6,IFRAME,HEAD,HR,HTML,IMG,INPUT,LABEL,LI,LINK,MENU,META,OBJECT,OL,ON,OPTION,P,PRE,SCRIPT,SELECT,SPAN,STYLE,TABLE,THEAD,TBODY,TFOOT,TAG,TD,TEXTAREA,TH,TITLE,TT,T,UL,IS_STRONG,IS_LOWER,IS_UPPER,IS_ALPHANUMERIC,IS_DATETIME,IS_DATE,IS_EMAIL,IS_EXPR,IS_FLOAT_IN_RANGE,IS_IMAGE,IS_INT_IN_RANGE,IS_IN_SET,IS_IPV4,IS_LIST_OF,IS_LENGTH,IS_MATCH,IS_NULL_OR,IS_NOT_EMPTY,IS_TIME,IS_UPLOAD_FILENAME,IS_URL,CLEANUP,CRYPT,IS_IN_DB,IS_NOT_IN_DB,SQLDB,SQLField,SQLFORM,SQLTABLE
>
> http://imgur.com/SnRwh.png
>
> I think this is one good solution.
>
> Another possibility is to create a file that imports all of those
> globals, and then at the top of your web2py files, you would import
> that file.This solution would let you see docstrings and other details
> but may be more inconvenient. I'll let one of you implement that.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30670] Re: Enable line numbering in the admin interface editor???

2009-09-10 Thread Wes James

On Thu, Sep 10, 2009 at 7:00 PM, cesmiga  wrote:
>
> All:
>
> Is there a way to enable line numbering in the admin interface editor?
>

You may want to consider using the free version of Wing IDE:

http://www.wingware.com/downloads/wingide-101

-wes

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30669] Re: win32com and web2py

2009-09-10 Thread tvw


Thank you so much :)

Been trying for ages to figure that out on my own - works like a dream
now.

Recent convert to python from perl. web2py automates a LOT of things I
used to do very manually.

I think this is going to be a big hit.


On Sep 10, 9:08 am, mdipierro  wrote:
> I would put the code below in a module in web2py/ and from the module
> import serv in your apps.
>
> On Sep 10, 7:16 am, tvw  wrote:
>
> > Hi,
> >     I've been trying to usewin32comwith web2py to get data from an
> > external process. I have been using the following in a controller for
> > my app (default.py)
>
> > importwin32com.client
> > serv =win32com.client.Dispatch("MyService")
>
> > Once I installed web2py source this worked fine, however sometimes it
> > seems to try to create a second instance of the com connection to my
> > service which then fails (in another thread ?) as only one can exist
> > at a time.
>
> > I would like to create only one instance of the com connection when
> > web2py starts and then share that with all applications. My question
> > is where should I put the above lines in web2py so that the com
> > connection is shared between apps and how should the instance be
> > referenced from each app.
>
> > I hope I have made sense here. Please let me know if anyone can help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30668] Fixing Autocomplete for Web2Py With Pydev IDE

2009-09-10 Thread Bottiger

I starting to use PyDev now that the extensions are now free. I
remembered some of you had problems with the autocomplete because of
the Web2Py globals. Here is a solution.

When you add a Python Interpreter, go into forced globals. Click new.
Copy and paste the following:

request,response,session,cache,redirect,HTTP,TR,XML,URL,BEAUTIFY,A,BODY,BR,B,CENTER,CODE,DIV,EM,EMBED,FIELDSET,LEGEND,FORM,H1,H2,H3,H4,H5,H6,IFRAME,HEAD,HR,HTML,IMG,INPUT,LABEL,LI,LINK,MENU,META,OBJECT,OL,ON,OPTION,P,PRE,SCRIPT,SELECT,SPAN,STYLE,TABLE,THEAD,TBODY,TFOOT,TAG,TD,TEXTAREA,TH,TITLE,TT,T,UL,IS_STRONG,IS_LOWER,IS_UPPER,IS_ALPHANUMERIC,IS_DATETIME,IS_DATE,IS_EMAIL,IS_EXPR,IS_FLOAT_IN_RANGE,IS_IMAGE,IS_INT_IN_RANGE,IS_IN_SET,IS_IPV4,IS_LIST_OF,IS_LENGTH,IS_MATCH,IS_NULL_OR,IS_NOT_EMPTY,IS_TIME,IS_UPLOAD_FILENAME,IS_URL,CLEANUP,CRYPT,IS_IN_DB,IS_NOT_IN_DB,SQLDB,SQLField,SQLFORM,SQLTABLE

http://imgur.com/SnRwh.png

I think this is one good solution.

Another possibility is to create a file that imports all of those
globals, and then at the top of your web2py files, you would import
that file.This solution would let you see docstrings and other details
but may be more inconvenient. I'll let one of you implement that.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30667] Re: Ajax

2009-09-10 Thread eddwinston

Hi Massimo,

I tried the above method but the return value is still a full page
markup. Don't know what I am doing wrong

On Sep 10, 11:32 pm, mdipierro  wrote:
> make a view like "user.json" that contains
> {{if user.is_logged_in():}}1{{else:}}0{{pass}}
>
> then call the use action with
>
> URL(r=request,c='default', f='user', args='login',extension='json')
>
> On Sep 10, 2:31 pm, eddwinston  wrote:
>
> > Hi guys,
>
> > The login now works, the session is saved but the value returned from
> > the server is still a full page html markup. How can I get either xml
> > or json as a return value?
>
> > Thanks
> > Winston
>
> > On Sep 10, 10:42 am, eddwinston  wrote:
>
> > > Thanks a lot guys. I will try it when I get hands on my app again.
>
> > > Regards,
> > > Winston
>
> > > On Sep 10, 9:28 am, "mr.freeze"  wrote:
>
> > > > Try this. u is the url, i is the form index (set to 0 for a single
> > > > form on the page), and t is the target for the response.
>
> > > > function ajaxSubmit(u,i,t){
> > > >     frm = jQuery("form:eq(" + i + ")");
> > > >     query = 'undefined=' + i;
> > > >     if (frm.length==1){query = frm.serialize();}
> > > >     jQuery.ajax({type: "POST", url: u, data: query, success: function
> > > > (msg) { if(t==':eval') eval(msg); else jQuery("#"+t).html(msg); } });
>
> > > > }
>
> > > > On Sep 10, 1:05 am, eddwinston  wrote:
>
> > > > > Hi,
>
> > > > > I am away from my app right now but I guess it would be something like
> > > > > this:
>
> > > > >   data: '{ "name_of_ username_field": "username_field_value",
> > > > >             "name_of_password_field": "password_field_value",
> > > > >             "_formkey": "form_key_value",
> > > > >             "_formname": "formname_value" }'
>
> > > > > On Sep 10, 8:45 am, mdipierro  wrote:
>
> > > > > > But this line
>
> > > > > >    data: {},
>
> > > > > > is not sending the username and password to the login page. It 
> > > > > > should
> > > > > > also send the formkey and formname.
>
> > > > > > On Sep 10, 12:11 am, eddwinston  wrote:
>
> > > > > > > Hi,
>
> > > > > > > This is what I did:
>
> > > > > > > jQuery.ajax({
> > > > > > >    type: "POST",
> > > > > > >    url: "{{=URL(r=request,c='default', f='user', args='login'}}",
> > > > > > >    data: {},
> > > > > > >    success: function(response) {
> > > > > > >       alert(response); // This line produced a complete page 
> > > > > > > markup in
> > > > > > > the alert dialog
> > > > > > >    },
> > > > > > >    error: failure_callback
> > > > > > >  });
>
> > > > > > > On Sep 10, 6:31 am, mdipierro  wrote:
>
> > > > > > > > show us the code
>
> > > > > > > > On Sep 9, 10:21 pm, eddwinston  wrote:
>
> > > > > > > > > Hi,
>
> > > > > > > > > I am trying to make an ajax login, I am currently sending 
> > > > > > > > > request to
> > > > > > > > > this url: [app]/default/user/login. But it has been 
> > > > > > > > > fruitless. I just
> > > > > > > > > get a full page html markup and the user will not be logged 
> > > > > > > > > in. Is
> > > > > > > > > there a way I can do it?
>
> > > > > > > > > Regards,
> > > > > > > > > Winston
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30666] Re: Any comments on Tornado Server?

2009-09-10 Thread Joe Barnhart
Looks kinda like Twisted to me, but without the generality of other
protocols.  But it supports epoll on Linux (and Mac?).  It *can* support
WSGI but you lose the cool asynchronous stuff so why do it?

In short, it sounds like an excellent solution for someone else's problem!

-- Joe B.



On Thu, Sep 10, 2009 at 5:48 PM, Anand Vaidya wrote:

>
> Facebook has released Tornado Server http://www.tornadoweb.org/
>
> Any comments?
>
> Regards
> Anand
>
> Tornado is an open source version of the scalable, non-blocking web
> server and tools that power FriendFeed. The FriendFeed application is
> written using a web framework that looks a bit like web.py or Google's
> webapp, but with additional tools and optimizations to take advantage
> of the underlying non-blocking infrastructure.
>
> The framework is distinct from most mainstream web server frameworks
> (and certainly most Python frameworks) because it is non-blocking and
> reasonably fast. Because it is non-blocking and uses epoll, it can
> handle thousands of simultaneous standing connections, which means it
> is ideal for real-time web services. We built the web server
> specifically to handle FriendFeed's real-time features — every active
> user of FriendFeed maintains an open connection to the FriendFeed
> servers. (For more information on scaling servers to support thousands
> of clients, see The C10K problem.)
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30665] Enable line numbering in the admin interface editor???

2009-09-10 Thread cesmiga

All:

Is there a way to enable line numbering in the admin interface editor?

Thank you,
Christopher
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30664] Any comments on Tornado Server?

2009-09-10 Thread Anand Vaidya

Facebook has released Tornado Server http://www.tornadoweb.org/

Any comments?

Regards
Anand

Tornado is an open source version of the scalable, non-blocking web
server and tools that power FriendFeed. The FriendFeed application is
written using a web framework that looks a bit like web.py or Google's
webapp, but with additional tools and optimizations to take advantage
of the underlying non-blocking infrastructure.

The framework is distinct from most mainstream web server frameworks
(and certainly most Python frameworks) because it is non-blocking and
reasonably fast. Because it is non-blocking and uses epoll, it can
handle thousands of simultaneous standing connections, which means it
is ideal for real-time web services. We built the web server
specifically to handle FriendFeed's real-time features — every active
user of FriendFeed maintains an open connection to the FriendFeed
servers. (For more information on scaling servers to support thousands
of clients, see The C10K problem.)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30663] Re: SQLite for Production?

2009-09-10 Thread Richard

One advantage of sqlite is that migrations work much better than
postgres, so it is great to use while developing your app.


On Sep 11, 4:14 am, Joe Barnhart  wrote:
> Good point.  Another factor is handling threads.  IIRC Sqlite won't handle
> more than 1 thread while the others will.
>
> On Thu, Sep 10, 2009 at 8:01 AM, ctalley  wrote:
>
> > FYI, something to consider is that SQLite doesn't natively support
> > foreign key constraints.  For example, ON DELETE CASCADE doesn't
> > work.  It is possible to write triggers to handle referential
> > integrity, but a dbms like postgresql just does it.  So, depending on
> > your requirements, postgresql might be a better option for that
> > reason.
>
> >http://www.sqlite.org/cvstrac/wiki?p=ForeignKeyTriggers
>
> > On Sep 9, 12:16 pm, greenpoise  wrote:
> > > Is it a good alternative? I am a fan of Postgresql myself BUT just for
> > > the simplicity of the whole development, can SQLite handle the job in
> > > the long run (users, record, db size)? I am sure is almost transparent
> > > when using both (correct me if I am wrong) but doesnt the Auth method
> > > changes?
>
> > > Feedback greatly appreciated.
>
> > > Dan
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30661] Re: web2vy

2009-09-10 Thread Thadeus Burgess
Why would anyone bother porting a system that is still in heavy development?

On Thu, Sep 10, 2009 at 4:48 PM, David Hofmann wrote:

> Hi all here, have somebody though on porting web2py framework in groovy ?(
> Is somebody doing it already ? )
>
> I am asking this because groovy has the same potencial as python, just with
> a liiitle more complexity than straigth python.
>
> I have made ( http://code.google.com/p/swebj/ ) a similar web2py request
> dispatching mecanism for java servlets for some SE aplication that needed to
> serve some dinamic content, It worked fine for me and I didn't even try to
> imitate the whole framework in Java because it's just stupid the amount of
> work that it will imply, but in groovy that's another thing. The project
> does not even have a binaries to download, it was just a weekend of work and
> just provides similar url dispatching mecanism to java method clases, it
> does not worth to look at it.
>
> But going back to the first question made. The reason it's not done or is
> not started yet is because
> 1. Nobody cares about it here ?
> 2. Somebody is doing it but need comunity help ?
> 3. Nobody here is skilled enough ( like me ) in groovy ? ( which does not
> make much sense because same python coding patterns and features I think is
> very similar in groovy )
> 4. X ( Somebody has a better reason why such a GREAT framework like web2py
> can not be ported to another language ? )
>
> I have a couple of years working in java and a couple of months in
> dynamic/functional languages now.
> Don't take me wrong please, I just think that those ( Massimo :) ) who
> create this framework would be able/maybeWant to lead a comunity porting
> effort.
>
> What do you think ?
>
> --
> David Daniel Hofmann
> WebVAS, Nucleo S.A. - Telecom Personal Paraguay
> http://www.google.com/profiles/hofmanndavid
>
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30662] cron error for no cron

2009-09-10 Thread Richard

hi,

I have a backend job that I run periodically with:
> python -u web2py.py --import_models --no-cron --shell=test 
> --run=applications/test/modules/backend.py


As you can see I am specifying no cron, but every so often I get this
error:
WARNING:root:alreadyrunning
WARNING:root:WEB2PY CRON: Stale cron.master detected
ERROR:root:WEB2PY CRON: Cron fail, reason: [Errno 2] No such file or
directory: '/home/web2py/applications/admin/cron/cron.running'


Do you have an idea what is going on?
And is there a way to completely disable cron?

Richard
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30660] Re: Using db field labels for column headers

2009-09-10 Thread villas

Wow, thanks!  Don't forget to include in the book.

BTW have you seen the Cakephp book?  It's a great collaborative
effort.  It would be great if everyone could proposed edits, fix typos
etc and take some of the strain off the core development team.  Just a
thought.

Thanks again for the labels!  D

On Sep 10, 7:12 pm, mdipierro  wrote:
> You can just do
>
> {{=SQLTABLE(rows, headers=dict([('mytable.'+f,db.mytable[f].label) for
> f in db.mytable.fields]))}}
>
> On Sep 10, 1:07 pm, villas  wrote:
>
>
>
> > I see it may not be straightforward, but if I may still make a non-
> > urgent suggestion for future consideration:
>
> > 1. Check whether it's a normal looking, unambiguous fieldname.
> > 2. If true, and a label exists,  then use the label.
>
> > After all, if there are any problems with column headers, we could
> > still set them manually as at present. I'm just trying to make things
> > easier for the most common case,  a standard field column which may
> > have a label.
>
> > Best wishes, David
>
> > On Sep 10, 6:28 pm, mdipierro  wrote:
>
> > > This comes up once in a while and the answer is no.
>
> > > The problem is that SQLTABLE may need to display the result of a join
> > > where the same field appears has two columns and some columns may be
> > > computed from expressions. They do not have a label and even if they
> > > do, using label would be confusing. This would require so much
> > > configuration that the best solution is NOT to use SQLTABLE but just
> > > loop over the rows.
>
> > > Massimo
>
> > > On Sep 10, 11:43 am, villas  wrote:
>
> > > > It seems strange that the db.field 'label' is not used as the column
> > > > header by default in SQLTABLE.  After all,  if someone has gone to the
> > > > trouble of specifying a 'label',  surely they would wish to use it
> > > > everywhere.  I eventually found this excellent tip from Massimo.
>
> > > > Controller:
> > > > headers=dict([(c,db[c.split('.')[0]][c.split('.')[1]].label) for c in
> > > > rows.colnames])
>
> > > > View:
> > > > {{=SQLTABLE(rows, headers=headers)}}
>
> > > > Please could we add this functionality to the core?  Or, at least
> > > > include it in the book, (sorry if I missed it).
>
> > > > Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30659] web2vy

2009-09-10 Thread David Hofmann
Hi all here, have somebody though on porting web2py framework in groovy ?(
Is somebody doing it already ? )

I am asking this because groovy has the same potencial as python, just with
a liiitle more complexity than straigth python.

I have made ( http://code.google.com/p/swebj/ ) a similar web2py request
dispatching mecanism for java servlets for some SE aplication that needed to
serve some dinamic content, It worked fine for me and I didn't even try to
imitate the whole framework in Java because it's just stupid the amount of
work that it will imply, but in groovy that's another thing. The project
does not even have a binaries to download, it was just a weekend of work and
just provides similar url dispatching mecanism to java method clases, it
does not worth to look at it.

But going back to the first question made. The reason it's not done or is
not started yet is because
1. Nobody cares about it here ?
2. Somebody is doing it but need comunity help ?
3. Nobody here is skilled enough ( like me ) in groovy ? ( which does not
make much sense because same python coding patterns and features I think is
very similar in groovy )
4. X ( Somebody has a better reason why such a GREAT framework like web2py
can not be ported to another language ? )

I have a couple of years working in java and a couple of months in
dynamic/functional languages now.
Don't take me wrong please, I just think that those ( Massimo :) ) who
create this framework would be able/maybeWant to lead a comunity porting
effort.

What do you think ?

--
David Daniel Hofmann
WebVAS, Nucleo S.A. - Telecom Personal Paraguay
http://www.google.com/profiles/hofmanndavid

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30658] Views with "\" instead of "/"

2009-09-10 Thread Chris S

I've been paying with some of the example apps and run across an
oddity in the 'Views'.

When I create a view, for example: default/index.html
It shows up in the list as: default\index.html

When I try to view or edit this file with the links on the Edit page I
get an 404 Error:
The requested URL /admin/default/edit/images/views/default\index.html
was not found on this server.

If I just move up to the URL bar and swap the "\" for a "/" it loads
right up.

I'm experience this with Firefox 3.0.13.  I've tried Chrome and when
you click on the edit link it's automatically converted into the
working "/" version for you.  However, Chrome has another display bug
in the Forum drop down box.  Any selection box is solid black so you
can't read the current selection.

Is there some way I can make the URL's save "default/index.html" so
that firefox will properly display it rather than hoping the browser
I'm using corrects all "\" to "/" when following links?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30657] Re: headers for crud.select()

2009-09-10 Thread mdipierro

http://groups.google.com/group/web2py/browse_thread/thread/9016f07f57605698#

On Sep 10, 4:00 pm, Oleg  wrote:
> Is something wrong with the idea, that labels, defined for the fields,
> will be also default headers for the crud.select() table. Just found
> myself  continuously filling up and updating headers parameters every
> time when I add new field in DB ;) but it is the same with label, I
> defined for the field.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30656] headers for crud.select()

2009-09-10 Thread Oleg

Is something wrong with the idea, that labels, defined for the fields,
will be also default headers for the crud.select() table. Just found
myself  continuously filling up and updating headers parameters every
time when I add new field in DB ;) but it is the same with label, I
defined for the field.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30655] Re: T3

2009-09-10 Thread mdipierro

Fran,

I would take a different approach. Instead of making a t3 brank I
would rewrite it.
I would only keep (the function that executed pages), the function
that creates menus recursively.
Instead of things like

t2.create expose crud.create and instead of t2.login expose
auth.login, etc.

The rest is just a wiki. I would use this as underlying wiki because
it has versioning.
http://groups.google.com/group/web2py/browse_thread/thread/ea62715b51521e1e

Massimo


On Sep 10, 3:37 pm, Fran  wrote:
> On Sep 10, 2:10 pm, mdipierro  wrote:
>
> > T3 is harder to explain. There is a video on vimeo. It is a handy app,
> > it's only problem is that it still use T2 stuff. It should be
> > rewritten. It will not take long so perhaps it is one of the first
> > things I would do.
>
> I just started developing a very simple website in Plone which was
> taking me ages, despite being familiar with the product from before.
> It took a lot of server resources & was ugly & difficult to style.
>
> I had a fresh play with T3 just now & found it *so* much nicer:
> really, really quick to setup, looks a lot nicer & will be easier to
> maintain being in Web2Py.
>
> The one thing that I'm missing right now is the ability to restrict
> functionality based on group membership.
> Currently there are just 3 roles: anonymous, authenticated, admin.
> So currently I can hide pages to just authenticated users, but not
> decide which subset can see which hidden pages & not allow a subset to
> be able to edit individual pages.
> Am I missing something in current T3 to be able to resolve this or
> will this require extra development?
>
> I'm started a T3 branch to start the update to current Web2Py - so far
> I've mainly done the DAL syntax updates & PEP8 
> cleanups:https://code.launchpad.net/~flavour/+junk/t3
>
> The big job, of course, is to use gluon/tools.py instead of modules/
> t2.py.
> I guess you'll do a complete rewrite to capture the same idea rather
> than migrate incrementally?
>
> The only bit that actually gave a failure was missing the cron/
> crontab...the rest works fine, but obviously can use a refresh to make
> it easier to maintain/extend in future.
>
> Best Wishes,
> Fran.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30654] Re: T3

2009-09-10 Thread Fran

On Sep 10, 2:10 pm, mdipierro  wrote:
> T3 is harder to explain. There is a video on vimeo. It is a handy app,
> it's only problem is that it still use T2 stuff. It should be
> rewritten. It will not take long so perhaps it is one of the first
> things I would do.

I just started developing a very simple website in Plone which was
taking me ages, despite being familiar with the product from before.
It took a lot of server resources & was ugly & difficult to style.

I had a fresh play with T3 just now & found it *so* much nicer:
really, really quick to setup, looks a lot nicer & will be easier to
maintain being in Web2Py.

The one thing that I'm missing right now is the ability to restrict
functionality based on group membership.
Currently there are just 3 roles: anonymous, authenticated, admin.
So currently I can hide pages to just authenticated users, but not
decide which subset can see which hidden pages & not allow a subset to
be able to edit individual pages.
Am I missing something in current T3 to be able to resolve this or
will this require extra development?

I'm started a T3 branch to start the update to current Web2Py - so far
I've mainly done the DAL syntax updates & PEP8 cleanups:
https://code.launchpad.net/~flavour/+junk/t3

The big job, of course, is to use gluon/tools.py instead of modules/
t2.py.
I guess you'll do a complete rewrite to capture the same idea rather
than migrate incrementally?

The only bit that actually gave a failure was missing the cron/
crontab...the rest works fine, but obviously can use a refresh to make
it easier to maintain/extend in future.

Best Wishes,
Fran.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30653] Re: web2py containers

2009-09-10 Thread mdipierro

There are dedicated web hosts that provide web2py pre-installed.

On Sep 10, 2:48 pm, Thadeus Burgess  wrote:
> This is a shame there is no one click support for web2py aside from google
> engine. I think web2py will suffice to a prototyping framework, and then use
> django for the real thing, considering that many web hosts have one click
> django support. (not that adminstering an apache server is difficult, it is
> just not prefered at this point in time.)
>
> web2py will help me get my application to a prototyping stage quickly so
> that business logic can be determined and bugs squashed, then rewrite it in
> the monolith that is django.
>
> Thank you for your response. I really like web2py and would hope it gains
> more commercial recognition.
>
> On Thu, Sep 10, 2009 at 2:13 PM, mdipierro  wrote:
>
> > I assume those are virtual machines.
> > Some users have posted virtual machines containing web2py.
>
> > I think there is still room for improvement. Ideally I would like a
> > ubuntu server virtual machine with
>
> > 1) apache preconfigured to run web2py via mod_wsgi
> > 2) postgresql preconfigured and perhaps a web2py appliances to list
> > databases, create/drop them, change permissions
> > 3) emacs + matplotlib
> > 4) postfix
>
> > I am sure the Django container you refer to can be used to run web2py
> > but probably it does not have the ideal setup.
>
> > Massimo
>
> > On Sep 10, 1:30 pm, Thadeus Burgess  wrote:
> > > mediatemple.net has "Django Containers", basically a VPS designed
> > > specifically to run Django, is there anything out there like this for
> > > web2py?
>
> > > I can imagine the having the dedicated django container is faster than
> > what
> > > could be set up with web2py?
>
> > > Could the django container be used to host web2py?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30652] Re: Database administration - db upload field

2009-09-10 Thread mdipierro

def upload():
import cStringIO
data=request.body.read()
f=cStringIO.StringIO(data)
current_filename='bla.bla' # how to you know the file extension if
you do not pass the name?
new_filename=db.mytable.picture.store(f,current_filename)
# do something with new_filename and data

On Sep 10, 2:40 pm, ab  wrote:
> I don't know uploaded file name. There is only stream of bytes to save
> in blob field.
>
> On Sep 10, 9:27 pm, mdipierro  wrote:
>
> > It depends on how you send the file. Can you send me an example?
>
> > On Sep 10, 2:19 pm, ab  wrote:
>
> > > Thanks. Working fine.
>
> > > I have one more question.
>
> > > When I upload file by database administration, field file contains for
> > > example following entry -
> > > picture.file.975598ae58526cda.
> > > 46697265666f785f77616c6c70617065722a706a67.png
>
> > > I want to upload files by REST. Is there function which I can use to
> > > calucate file field value as above?
>
> > > On Sep 10, 7:25 pm, mdipierro  wrote:
>
> > > > Please try
>
> > > >   Field('file_data','blob',default=''))
>
> > > > On Sep 10, 10:57 am, ab  wrote:
>
> > > > > Hi
>
> > > > >   I found issue in database administration module and blob field for
> > > > > files storage
>
> > > > >   When model is defined as below
>
> > > > >  db.define_table('picture', Field('file','upload'))
>
> > > > >   there is no problem with inserting new records using 'database
> > > > > administration'
>
> > > > > but when model is defined to store files in database as below
>
> > > > > db.define_table('picture',
> > > > >   Field('file','upload',uploadfield='file_data'),
> > > > >   Field('file_data','blob'))
>
> > > > > 'database administration' can't insert new record.
>
> > > > > I don't know if this is issue or current limitation.
>
> > > > > Regards
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30651] Re: Ajax

2009-09-10 Thread mdipierro

make a view like "user.json" that contains
{{if user.is_logged_in():}}1{{else:}}0{{pass}}

then call the use action with

URL(r=request,c='default', f='user', args='login',extension='json')


On Sep 10, 2:31 pm, eddwinston  wrote:
> Hi guys,
>
> The login now works, the session is saved but the value returned from
> the server is still a full page html markup. How can I get either xml
> or json as a return value?
>
> Thanks
> Winston
>
> On Sep 10, 10:42 am, eddwinston  wrote:
>
> > Thanks a lot guys. I will try it when I get hands on my app again.
>
> > Regards,
> > Winston
>
> > On Sep 10, 9:28 am, "mr.freeze"  wrote:
>
> > > Try this. u is the url, i is the form index (set to 0 for a single
> > > form on the page), and t is the target for the response.
>
> > > function ajaxSubmit(u,i,t){
> > > frm = jQuery("form:eq(" + i + ")");
> > > query = 'undefined=' + i;
> > > if (frm.length==1){query = frm.serialize();}
> > > jQuery.ajax({type: "POST", url: u, data: query, success: function
> > > (msg) { if(t==':eval') eval(msg); else jQuery("#"+t).html(msg); } });
>
> > > }
>
> > > On Sep 10, 1:05 am, eddwinston  wrote:
>
> > > > Hi,
>
> > > > I am away from my app right now but I guess it would be something like
> > > > this:
>
> > > >   data: '{ "name_of_ username_field": "username_field_value",
> > > > "name_of_password_field": "password_field_value",
> > > > "_formkey": "form_key_value",
> > > > "_formname": "formname_value" }'
>
> > > > On Sep 10, 8:45 am, mdipierro  wrote:
>
> > > > > But this line
>
> > > > >data: {},
>
> > > > > is not sending the username and password to the login page. It should
> > > > > also send the formkey and formname.
>
> > > > > On Sep 10, 12:11 am, eddwinston  wrote:
>
> > > > > > Hi,
>
> > > > > > This is what I did:
>
> > > > > > jQuery.ajax({
> > > > > >type: "POST",
> > > > > >url: "{{=URL(r=request,c='default', f='user', args='login'}}",
> > > > > >data: {},
> > > > > >success: function(response) {
> > > > > >   alert(response); // This line produced a complete page markup 
> > > > > > in
> > > > > > the alert dialog
> > > > > >},
> > > > > >error: failure_callback
> > > > > >  });
>
> > > > > > On Sep 10, 6:31 am, mdipierro  wrote:
>
> > > > > > > show us the code
>
> > > > > > > On Sep 9, 10:21 pm, eddwinston  wrote:
>
> > > > > > > > Hi,
>
> > > > > > > > I am trying to make an ajax login, I am currently sending 
> > > > > > > > request to
> > > > > > > > this url: [app]/default/user/login. But it has been fruitless. 
> > > > > > > > I just
> > > > > > > > get a full page html markup and the user will not be logged in. 
> > > > > > > > Is
> > > > > > > > there a way I can do it?
>
> > > > > > > > Regards,
> > > > > > > > Winston
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30650] Re: web2py containers

2009-09-10 Thread Thadeus Burgess
This is a shame there is no one click support for web2py aside from google
engine. I think web2py will suffice to a prototyping framework, and then use
django for the real thing, considering that many web hosts have one click
django support. (not that adminstering an apache server is difficult, it is
just not prefered at this point in time.)

web2py will help me get my application to a prototyping stage quickly so
that business logic can be determined and bugs squashed, then rewrite it in
the monolith that is django.

Thank you for your response. I really like web2py and would hope it gains
more commercial recognition.

On Thu, Sep 10, 2009 at 2:13 PM, mdipierro  wrote:

>
> I assume those are virtual machines.
> Some users have posted virtual machines containing web2py.
>
> I think there is still room for improvement. Ideally I would like a
> ubuntu server virtual machine with
>
> 1) apache preconfigured to run web2py via mod_wsgi
> 2) postgresql preconfigured and perhaps a web2py appliances to list
> databases, create/drop them, change permissions
> 3) emacs + matplotlib
> 4) postfix
>
> I am sure the Django container you refer to can be used to run web2py
> but probably it does not have the ideal setup.
>
> Massimo
>
> On Sep 10, 1:30 pm, Thadeus Burgess  wrote:
> > mediatemple.net has "Django Containers", basically a VPS designed
> > specifically to run Django, is there anything out there like this for
> > web2py?
> >
> > I can imagine the having the dedicated django container is faster than
> what
> > could be set up with web2py?
> >
> > Could the django container be used to host web2py?
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30649] Re: Database administration - db upload field

2009-09-10 Thread ab

I don't know uploaded file name. There is only stream of bytes to save
in blob field.

On Sep 10, 9:27 pm, mdipierro  wrote:
> It depends on how you send the file. Can you send me an example?
>
> On Sep 10, 2:19 pm, ab  wrote:
>
> > Thanks. Working fine.
>
> > I have one more question.
>
> > When I upload file by database administration, field file contains for
> > example following entry -
> > picture.file.975598ae58526cda.
> > 46697265666f785f77616c6c70617065722a706a67.png
>
> > I want to upload files by REST. Is there function which I can use to
> > calucate file field value as above?
>
> > On Sep 10, 7:25 pm, mdipierro  wrote:
>
> > > Please try
>
> > >   Field('file_data','blob',default=''))
>
> > > On Sep 10, 10:57 am, ab  wrote:
>
> > > > Hi
>
> > > >   I found issue in database administration module and blob field for
> > > > files storage
>
> > > >   When model is defined as below
>
> > > >  db.define_table('picture', Field('file','upload'))
>
> > > >   there is no problem with inserting new records using 'database
> > > > administration'
>
> > > > but when model is defined to store files in database as below
>
> > > > db.define_table('picture',
> > > >   Field('file','upload',uploadfield='file_data'),
> > > >   Field('file_data','blob'))
>
> > > > 'database administration' can't insert new record.
>
> > > > I don't know if this is issue or current limitation.
>
> > > > Regards
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30648] Re: Ajax

2009-09-10 Thread eddwinston

Hi guys,

The login now works, the session is saved but the value returned from
the server is still a full page html markup. How can I get either xml
or json as a return value?

Thanks
Winston

On Sep 10, 10:42 am, eddwinston  wrote:
> Thanks a lot guys. I will try it when I get hands on my app again.
>
> Regards,
> Winston
>
> On Sep 10, 9:28 am, "mr.freeze"  wrote:
>
> > Try this. u is the url, i is the form index (set to 0 for a single
> > form on the page), and t is the target for the response.
>
> > function ajaxSubmit(u,i,t){
> >     frm = jQuery("form:eq(" + i + ")");
> >     query = 'undefined=' + i;
> >     if (frm.length==1){query = frm.serialize();}
> >     jQuery.ajax({type: "POST", url: u, data: query, success: function
> > (msg) { if(t==':eval') eval(msg); else jQuery("#"+t).html(msg); } });
>
> > }
>
> > On Sep 10, 1:05 am, eddwinston  wrote:
>
> > > Hi,
>
> > > I am away from my app right now but I guess it would be something like
> > > this:
>
> > >   data: '{ "name_of_ username_field": "username_field_value",
> > >             "name_of_password_field": "password_field_value",
> > >             "_formkey": "form_key_value",
> > >             "_formname": "formname_value" }'
>
> > > On Sep 10, 8:45 am, mdipierro  wrote:
>
> > > > But this line
>
> > > >    data: {},
>
> > > > is not sending the username and password to the login page. It should
> > > > also send the formkey and formname.
>
> > > > On Sep 10, 12:11 am, eddwinston  wrote:
>
> > > > > Hi,
>
> > > > > This is what I did:
>
> > > > > jQuery.ajax({
> > > > >    type: "POST",
> > > > >    url: "{{=URL(r=request,c='default', f='user', args='login'}}",
> > > > >    data: {},
> > > > >    success: function(response) {
> > > > >       alert(response); // This line produced a complete page markup in
> > > > > the alert dialog
> > > > >    },
> > > > >    error: failure_callback
> > > > >  });
>
> > > > > On Sep 10, 6:31 am, mdipierro  wrote:
>
> > > > > > show us the code
>
> > > > > > On Sep 9, 10:21 pm, eddwinston  wrote:
>
> > > > > > > Hi,
>
> > > > > > > I am trying to make an ajax login, I am currently sending request 
> > > > > > > to
> > > > > > > this url: [app]/default/user/login. But it has been fruitless. I 
> > > > > > > just
> > > > > > > get a full page html markup and the user will not be logged in. Is
> > > > > > > there a way I can do it?
>
> > > > > > > Regards,
> > > > > > > Winston
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30647] Re: Database administration - db upload field

2009-09-10 Thread mdipierro

It depends on how you send the file. Can you send me an example?

On Sep 10, 2:19 pm, ab  wrote:
> Thanks. Working fine.
>
> I have one more question.
>
> When I upload file by database administration, field file contains for
> example following entry -
> picture.file.975598ae58526cda.
> 46697265666f785f77616c6c70617065722a706a67.png
>
> I want to upload files by REST. Is there function which I can use to
> calucate file field value as above?
>
> On Sep 10, 7:25 pm, mdipierro  wrote:
>
> > Please try
>
> >   Field('file_data','blob',default=''))
>
> > On Sep 10, 10:57 am, ab  wrote:
>
> > > Hi
>
> > >   I found issue in database administration module and blob field for
> > > files storage
>
> > >   When model is defined as below
>
> > >  db.define_table('picture', Field('file','upload'))
>
> > >   there is no problem with inserting new records using 'database
> > > administration'
>
> > > but when model is defined to store files in database as below
>
> > > db.define_table('picture',
> > >   Field('file','upload',uploadfield='file_data'),
> > >   Field('file_data','blob'))
>
> > > 'database administration' can't insert new record.
>
> > > I don't know if this is issue or current limitation.
>
> > > Regards
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30646] Re: Database administration - db upload field

2009-09-10 Thread ab

Thanks. Working fine.

I have one more question.

When I upload file by database administration, field file contains for
example following entry -
picture.file.975598ae58526cda.
46697265666f785f77616c6c70617065722a706a67.png

I want to upload files by REST. Is there function which I can use to
calucate file field value as above?

On Sep 10, 7:25 pm, mdipierro  wrote:
> Please try
>
>   Field('file_data','blob',default=''))
>
> On Sep 10, 10:57 am, ab  wrote:
>
> > Hi
>
> >   I found issue in database administration module and blob field for
> > files storage
>
> >   When model is defined as below
>
> >  db.define_table('picture', Field('file','upload'))
>
> >   there is no problem with inserting new records using 'database
> > administration'
>
> > but when model is defined to store files in database as below
>
> > db.define_table('picture',
> >   Field('file','upload',uploadfield='file_data'),
> >   Field('file_data','blob'))
>
> > 'database administration' can't insert new record.
>
> > I don't know if this is issue or current limitation.
>
> > Regards
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30645] Re: web2py containers

2009-09-10 Thread mdipierro

I assume those are virtual machines.
Some users have posted virtual machines containing web2py.

I think there is still room for improvement. Ideally I would like a
ubuntu server virtual machine with

1) apache preconfigured to run web2py via mod_wsgi
2) postgresql preconfigured and perhaps a web2py appliances to list
databases, create/drop them, change permissions
3) emacs + matplotlib
4) postfix

I am sure the Django container you refer to can be used to run web2py
but probably it does not have the ideal setup.

Massimo

On Sep 10, 1:30 pm, Thadeus Burgess  wrote:
> mediatemple.net has "Django Containers", basically a VPS designed
> specifically to run Django, is there anything out there like this for
> web2py?
>
> I can imagine the having the dedicated django container is faster than what
> could be set up with web2py?
>
> Could the django container be used to host web2py?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30644] Re: file descriptors leak

2009-09-10 Thread zahariash



> What OS do you use?
Debian 5.0.3

>
> Can you email me your full name, to log the patch?
Zahariash is ok ;)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30643] Re: get random record efficiently

2009-09-10 Thread Robin B

Also if you already have many existing rows w/o a random float field,
you will need to add a random field to those rows.

You could use the remote datastore API [ ru.ly/g6 ] to add a random
field to each row in the table.  It basically connects you to the
production datastore from your local machine, and you can iterate over
all rows and ensure they have a float random field.

Robin



On Sep 10, 1:11 am, Richard  wrote:
> neat!
>
> On Sep 10, 3:32 pm, Robin B  wrote:
>
> > On GAE, the default ordering depends on which index is needed to
> > answer the query, and it is stable, so it is non-random.
>
> > To get random rows on GAE, I use a float field called random, which is
> > assigned a float from 0 and 1, then to pull random rows, I just
> > generate a random float and query by table.random < value.
>
> > Robin
>
> > On Sep 9, 10:12 pm, mdipierro  wrote:
>
> > > No but I believe that without orderby it may be random by default on
> > > GAE. I would check the GAE docs because I am not sure.
>
> > > On Sep 9, 10:01 pm, Iceberg  wrote:
>
> > > > Thanks! Did not notice the '' is supported by web2py DAL for
> > > > its all db backend. That is great. Does it work on GAE too?
>
> > > > BTW, my less efficient way is db-independent however.
>
> > > > On Sep10, 9:55am, mdipierro  wrote:
>
> > > > > I thought I answered this
>
> > > > > random_record = db().select(db.mytable.ALL,orderby=',limitby=
> > > > > (0,1))[0]
>
> > > > > On Sep 9, 8:27 pm, Iceberg  wrote:
>
> > > > > > On Sep9, 8:07pm, Richard  wrote:
>
> > > > > > > hi,
>
> > > > > > > is there an efficient way to get a random record from a table?
> > > > > > > An obvious non-efficient way would be to get all the records and 
> > > > > > > do
> > > > > > > random.choice().
>
> > > > > > > thanks,
> > > > > > > Richard
>
> > > > > > Would like to see comments on this.
>
> > > > > >   import random
> > > > > >   total_count = db(db.mytable.id>1).count() # well, this is one 
> > > > > > extra
> > > > > > db query
> > > > > >   random_id = random.randint(1, total_count)
> > > > > >   random_record = db.mytable[random_id] # Does this work on GAE?
>
> > > > > > Iceberg
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30642] Re: who made this? I really like it

2009-09-10 Thread Wes James

Massimo,

use your mac.

run terminal

type in:

whois icoexist.org

might give a hint... :)

-wes

On Wed, Sep 9, 2009 at 4:23 PM, mdipierro wrote:
>
> http://www.icoexist.org/
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30641] web2py containers

2009-09-10 Thread Thadeus Burgess
mediatemple.net has "Django Containers", basically a VPS designed
specifically to run Django, is there anything out there like this for
web2py?

I can imagine the having the dedicated django container is faster than what
could be set up with web2py?

Could the django container be used to host web2py?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30640] Re: SQLite for Production?

2009-09-10 Thread Joe Barnhart
Good point.  Another factor is handling threads.  IIRC Sqlite won't handle
more than 1 thread while the others will.

On Thu, Sep 10, 2009 at 8:01 AM, ctalley  wrote:

>
> FYI, something to consider is that SQLite doesn't natively support
> foreign key constraints.  For example, ON DELETE CASCADE doesn't
> work.  It is possible to write triggers to handle referential
> integrity, but a dbms like postgresql just does it.  So, depending on
> your requirements, postgresql might be a better option for that
> reason.
>
> http://www.sqlite.org/cvstrac/wiki?p=ForeignKeyTriggers
>
> On Sep 9, 12:16 pm, greenpoise  wrote:
> > Is it a good alternative? I am a fan of Postgresql myself BUT just for
> > the simplicity of the whole development, can SQLite handle the job in
> > the long run (users, record, db size)? I am sure is almost transparent
> > when using both (correct me if I am wrong) but doesnt the Auth method
> > changes?
> >
> > Feedback greatly appreciated.
> >
> > Dan
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30639] Re: Using db field labels for column headers

2009-09-10 Thread mdipierro

You can just do

{{=SQLTABLE(rows, headers=dict([('mytable.'+f,db.mytable[f].label) for
f in db.mytable.fields]))}}

On Sep 10, 1:07 pm, villas  wrote:
> I see it may not be straightforward, but if I may still make a non-
> urgent suggestion for future consideration:
>
> 1. Check whether it's a normal looking, unambiguous fieldname.
> 2. If true, and a label exists,  then use the label.
>
> After all, if there are any problems with column headers, we could
> still set them manually as at present. I'm just trying to make things
> easier for the most common case,  a standard field column which may
> have a label.
>
> Best wishes, David
>
> On Sep 10, 6:28 pm, mdipierro  wrote:
>
> > This comes up once in a while and the answer is no.
>
> > The problem is that SQLTABLE may need to display the result of a join
> > where the same field appears has two columns and some columns may be
> > computed from expressions. They do not have a label and even if they
> > do, using label would be confusing. This would require so much
> > configuration that the best solution is NOT to use SQLTABLE but just
> > loop over the rows.
>
> > Massimo
>
> > On Sep 10, 11:43 am, villas  wrote:
>
> > > It seems strange that the db.field 'label' is not used as the column
> > > header by default in SQLTABLE.  After all,  if someone has gone to the
> > > trouble of specifying a 'label',  surely they would wish to use it
> > > everywhere.  I eventually found this excellent tip from Massimo.
>
> > > Controller:
> > > headers=dict([(c,db[c.split('.')[0]][c.split('.')[1]].label) for c in
> > > rows.colnames])
>
> > > View:
> > > {{=SQLTABLE(rows, headers=headers)}}
>
> > > Please could we add this functionality to the core?  Or, at least
> > > include it in the book, (sorry if I missed it).
>
> > > Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30638] Re: Using db field labels for column headers

2009-09-10 Thread villas

I see it may not be straightforward, but if I may still make a non-
urgent suggestion for future consideration:

1. Check whether it's a normal looking, unambiguous fieldname.
2. If true, and a label exists,  then use the label.

After all, if there are any problems with column headers, we could
still set them manually as at present. I'm just trying to make things
easier for the most common case,  a standard field column which may
have a label.

Best wishes, David



On Sep 10, 6:28 pm, mdipierro  wrote:
> This comes up once in a while and the answer is no.
>
> The problem is that SQLTABLE may need to display the result of a join
> where the same field appears has two columns and some columns may be
> computed from expressions. They do not have a label and even if they
> do, using label would be confusing. This would require so much
> configuration that the best solution is NOT to use SQLTABLE but just
> loop over the rows.
>
> Massimo
>
> On Sep 10, 11:43 am, villas  wrote:
>
>
>
> > It seems strange that the db.field 'label' is not used as the column
> > header by default in SQLTABLE.  After all,  if someone has gone to the
> > trouble of specifying a 'label',  surely they would wish to use it
> > everywhere.  I eventually found this excellent tip from Massimo.
>
> > Controller:
> > headers=dict([(c,db[c.split('.')[0]][c.split('.')[1]].label) for c in
> > rows.colnames])
>
> > View:
> > {{=SQLTABLE(rows, headers=headers)}}
>
> > Please could we add this functionality to the core?  Or, at least
> > include it in the book, (sorry if I missed it).
>
> > Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30637] Re: Django "polls" tutorial in web2py

2009-09-10 Thread mikech

Yes, I agree - good video.

On Sep 9, 7:05 pm, mdipierro  wrote:
> Conversion worked this time:
>
> http://vimeo.com/6507384
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30636] Re: Importing XML code

2009-09-10 Thread Jason Brower

Cool! Thanks!
Regards,
JAson Brower


On Thu, 2009-09-10 at 08:09 -0700, mdipierro wrote:
> Try
> 
> def xml_uploader():
> import xml.etree.ElementTree
> mytree=xml.etree.ElementTree.parse(request.body.read())
> # do something with mytree. look into python docs about it
> 
> On Sep 10, 9:22 am, encompass  wrote:
> > I know how to work with xml code.  I just wanted to make sure I do it
> > with all the built in libraries that are possible.
> > I have an existing tool that will be sending me an XML in a post
> > request.  What is the best way for me to take that data and use it in
> > my Web2py Application?  they are not Blogs, but a very large peices of
> > data about Elevators.
> > Regards,
> > Jason
> > 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30635] Re: file descriptors leak

2009-09-10 Thread mdipierro

Thank you.

What OS do you use?

Can you email me your full name, to log the patch?

Massimo

On Sep 10, 11:52 am, zahariash  wrote:
> Hello,
>
> I've found some weird behavior of web2py script. After few hours from
> script start it throw error:
> OSError: [Errno 24] Too many open files
>
> Indeed, there is many attached files:
> lsof -p 13149
>
> python2.5 13149 www-data   24u   REG   202,0   02702 /tmp/
> tmpkvWcld (deleted)
> python2.5 13149 www-data   36u   REG   202,0   02708 /tmp/
> tmpL9F9BA (deleted)
> python2.5 13149 www-data   30u   REG   202,0   02659 /tmp/
> tmpLNUWac (deleted)
> ...
>
> It seems, that temp file generated in wsgibase function isn't closed
> properly.
> Here is fix. Works for me...
>
> --- CUT -
> +++ /src/web2py/gluon/main.py   Thu Sep 10 18:18:43 2009
> @@ -464,7 +464,9 @@
>  return HTTP(http_error_status, error_message_ticket
>   % dict(ticket=ticket), web2py_error='ticket %s'
>   % ticket).to(responder)
> -
> +finally:
> +if request.body:
> +request.body.close()
>
>  (wsgibase, html.URL) = rewrite(wsgibase, html.URL)
>
> --- CUT -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30634] Re: Using db field labels for column headers

2009-09-10 Thread mdipierro

This comes up once in a while and the answer is no.

The problem is that SQLTABLE may need to display the result of a join
where the same field appears has two columns and some columns may be
computed from expressions. They do not have a label and even if they
do, using label would be confusing. This would require so much
configuration that the best solution is NOT to use SQLTABLE but just
loop over the rows.

Massimo


On Sep 10, 11:43 am, villas  wrote:
> It seems strange that the db.field 'label' is not used as the column
> header by default in SQLTABLE.  After all,  if someone has gone to the
> trouble of specifying a 'label',  surely they would wish to use it
> everywhere.  I eventually found this excellent tip from Massimo.
>
> Controller:
> headers=dict([(c,db[c.split('.')[0]][c.split('.')[1]].label) for c in
> rows.colnames])
>
> View:
> {{=SQLTABLE(rows, headers=headers)}}
>
> Please could we add this functionality to the core?  Or, at least
> include it in the book, (sorry if I missed it).
>
> Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30633] Re: Database administration - db upload field

2009-09-10 Thread mdipierro

Please try

  Field('file_data','blob',default=''))

On Sep 10, 10:57 am, ab  wrote:
> Hi
>
>   I found issue in database administration module and blob field for
> files storage
>
>   When model is defined as below
>
>  db.define_table('picture', Field('file','upload'))
>
>   there is no problem with inserting new records using 'database
> administration'
>
> but when model is defined to store files in database as below
>
> db.define_table('picture',
>   Field('file','upload',uploadfield='file_data'),
>   Field('file_data','blob'))
>
> 'database administration' can't insert new record.
>
> I don't know if this is issue or current limitation.
>
> Regards
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30632] file descriptors leak

2009-09-10 Thread zahariash

Hello,

I've found some weird behavior of web2py script. After few hours from
script start it throw error:
OSError: [Errno 24] Too many open files

Indeed, there is many attached files:
lsof -p 13149

python2.5 13149 www-data   24u   REG   202,0   02702 /tmp/
tmpkvWcld (deleted)
python2.5 13149 www-data   36u   REG   202,0   02708 /tmp/
tmpL9F9BA (deleted)
python2.5 13149 www-data   30u   REG   202,0   02659 /tmp/
tmpLNUWac (deleted)
...

It seems, that temp file generated in wsgibase function isn't closed
properly.
Here is fix. Works for me...

--- CUT -
+++ /src/web2py/gluon/main.py   Thu Sep 10 18:18:43 2009
@@ -464,7 +464,9 @@
 return HTTP(http_error_status, error_message_ticket
  % dict(ticket=ticket), web2py_error='ticket %s'
  % ticket).to(responder)
-
+finally:
+if request.body:
+request.body.close()

 (wsgibase, html.URL) = rewrite(wsgibase, html.URL)

--- CUT -


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30631] Re: Django "polls" tutorial in web2py

2009-09-10 Thread mengu

massimo,

this was an excellent screencast that made me understand how powerful
web2py is and how easy and fast to develop with web2py. i have been
examining many frameworks including ruby on rails, django and some php
frameworks, if i watch some of these more, i will definitely go with
web2py for my start-up.

thank you for creating the framework and the screencasts.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30630] Using db field labels for column headers

2009-09-10 Thread villas

It seems strange that the db.field 'label' is not used as the column
header by default in SQLTABLE.  After all,  if someone has gone to the
trouble of specifying a 'label',  surely they would wish to use it
everywhere.  I eventually found this excellent tip from Massimo.

Controller:
headers=dict([(c,db[c.split('.')[0]][c.split('.')[1]].label) for c in
rows.colnames])

View:
{{=SQLTABLE(rows, headers=headers)}}

Please could we add this functionality to the core?  Or, at least
include it in the book, (sorry if I missed it).

Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30629] Re: where is isoformat described?

2009-09-10 Thread Yarko Tymciurak
see date.isoformat() here:
http://docs.python.org/library/datetime.html

On Thu, Sep 10, 2009 at 11:36 AM, jayvandal  wrote:

>
> Hi,
> I have looked at the web2py 2nd edition and I see no description of
> isoformat.
> Jm
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30628] where is isoformat described?

2009-09-10 Thread jayvandal

Hi,
I have looked at the web2py 2nd edition and I see no description of
isoformat.
Jm
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30627] Dzone posting Coding Django "polls" tutorial in web2py

2009-09-10 Thread mikech

http://www.dzone.com/links/coding_django_polls_tutorial_in_web2py.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30626] Database administration - db upload field

2009-09-10 Thread ab

Hi

  I found issue in database administration module and blob field for
files storage

  When model is defined as below

 db.define_table('picture', Field('file','upload'))

  there is no problem with inserting new records using 'database
administration'

but when model is defined to store files in database as below

db.define_table('picture',
  Field('file','upload',uploadfield='file_data'),
  Field('file_data','blob'))

'database administration' can't insert new record.

I don't know if this is issue or current limitation.

Regards
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30625] Re: Building queries from strings

2009-09-10 Thread Don

Ahh.. Thanks I will try it out.


On Sep 10, 11:12 am, mdipierro  wrote:
> This is dangerous because vulnerable to SQL Injections. Anyway
>
> a query can be a valid SQL WHERE clause:
>
> x = "table.id == %i" % value
> query = x
> set = db(query)
> row = set.select()
>
> in this case x is valid SQL. Notice it is not 'db.table.id' but
> 'table.id' because db is a web2py animal not a SQL animal.
>
> On Sep 10, 9:41 am, Don  wrote:
>
> > Okay, that was a bad example and my fault.  Let's try again
>
> > x = 'db.table.id == value'
> > query = x
> > set = db(query)
> > row = set.select()
>
> > This will fail because the "query" variable is not a gluon.sql.Query
> > object, it is just a string.  How can I convert from a string to a
> > query?
>
> > On Sep 10, 10:32 am, Yarko Tymciurak  wrote:
>
> > > the "idiom" is db(WHERE_CLAUSE).select(FROM_CLAUSE)  (a simplification, 
> > > but
> > > you get the idea)
>
> > > so you want
>
> > > query_results = db(x).select()
>
> > > or (equivalently):
>
> > > query_results = db(x).select(db.table.ALL)
>
> > > On Thu, Sep 10, 2009 at 9:26 AM, Don  wrote:
>
> > > > Ex:
> > > > x = 'db.table.id == value'
> > > > query = db(x)
>
> > > > * This fails.  Is it possible to convert a string into a query?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30624] Re: Building queries from strings

2009-09-10 Thread mdipierro

This is dangerous because vulnerable to SQL Injections. Anyway

a query can be a valid SQL WHERE clause:

x = "table.id == %i" % value
query = x
set = db(query)
row = set.select()

in this case x is valid SQL. Notice it is not 'db.table.id' but
'table.id' because db is a web2py animal not a SQL animal.

On Sep 10, 9:41 am, Don  wrote:
> Okay, that was a bad example and my fault.  Let's try again
>
> x = 'db.table.id == value'
> query = x
> set = db(query)
> row = set.select()
>
> This will fail because the "query" variable is not a gluon.sql.Query
> object, it is just a string.  How can I convert from a string to a
> query?
>
> On Sep 10, 10:32 am, Yarko Tymciurak  wrote:
>
> > the "idiom" is db(WHERE_CLAUSE).select(FROM_CLAUSE)  (a simplification, but
> > you get the idea)
>
> > so you want
>
> > query_results = db(x).select()
>
> > or (equivalently):
>
> > query_results = db(x).select(db.table.ALL)
>
> > On Thu, Sep 10, 2009 at 9:26 AM, Don  wrote:
>
> > > Ex:
> > > x = 'db.table.id == value'
> > > query = db(x)
>
> > > * This fails.  Is it possible to convert a string into a query?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30623] Re: Importing XML code

2009-09-10 Thread mdipierro

Try

def xml_uploader():
import xml.etree.ElementTree
mytree=xml.etree.ElementTree.parse(request.body.read())
# do something with mytree. look into python docs about it

On Sep 10, 9:22 am, encompass  wrote:
> I know how to work with xml code.  I just wanted to make sure I do it
> with all the built in libraries that are possible.
> I have an existing tool that will be sending me an XML in a post
> request.  What is the best way for me to take that data and use it in
> my Web2py Application?  they are not Blogs, but a very large peices of
> data about Elevators.
> Regards,
> Jason
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30622] Re: SQLite for Production?

2009-09-10 Thread ctalley

FYI, something to consider is that SQLite doesn't natively support
foreign key constraints.  For example, ON DELETE CASCADE doesn't
work.  It is possible to write triggers to handle referential
integrity, but a dbms like postgresql just does it.  So, depending on
your requirements, postgresql might be a better option for that
reason.

http://www.sqlite.org/cvstrac/wiki?p=ForeignKeyTriggers

On Sep 9, 12:16 pm, greenpoise  wrote:
> Is it a good alternative? I am a fan of Postgresql myself BUT just for
> the simplicity of the whole development, can SQLite handle the job in
> the long run (users, record, db size)? I am sure is almost transparent
> when using both (correct me if I am wrong) but doesnt the Auth method
> changes?
>
> Feedback greatly appreciated.
>
> Dan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30621] Writing test codes

2009-09-10 Thread Maurice Ling

Hi everyone,

I have a problem here seeking assistance. I am confused about how to
start writing test codes in web2py. Say I want to test the following:

def input_SS():
if session.username == None:
redirect(URL(r=request, f='../account/log_in'))
form = FORM(
TABLE(
TR('Data: ', TEXTAREA(_name='data',
value='Enter the data, separated by commas')),
INPUT(_type='submit', _value='SUBMIT')))
if form.accepts(request.vars,session):
session.data = [float(x) for x in form.vars.data.split(',')]
redirect(URL(r=request, f='analyze_SS'))
return dict(form=form)

The data is analyzed by 'analyze_SS' function.

How should I write my tests?

Thanks in advance.

Maurice
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30620] Re: error on rendering just a record!

2009-09-10 Thread Carlos Aboim
>From Clientes/index (a list of clients) I want to pick up a record and edit
it.
with the earlier configuration I get the record but I can't edit it.

How I merge my confs with your suggestion?

maybe would be better explain everything again but if you can understand..

thanks
CA

2009/9/10 mdipierro 

>
> That is all. When you visit the page there will be a create form in
> the page.
> Perhaps I misunderstand what you want to do.
>
> On Sep 10, 8:14 am, Carlos Aboim  wrote:
> > I'm sorry I didn't get the point.
> >
> > What should I do with {{=crud.update(db.cliente, cliente)}}
> > I put it in the view and...
> >
> > thank you
> > CA
> >
> > 2009/9/9 mdipierro 
> >
> >
> >
> > > {{=crud.update(db.cliente,cliente)}}
> >
> > > On Sep 9, 9:50 am, Carlos Aboim  wrote:
> > > > Hey Massimo,
> > > > thanks for your reply,
> > > > I've changed the code as you said and now it's ok. But I whould like
> to
> > > edit
> > > > the record.
> > > > 1. How do I do to edit that record.
> > > > 2. How do I change the order of apearence of fields, because the
> fields
> > > > seams to be apearing in a random away maybe not...
> >
> > > > thanks again
> > > > CAboim
> >
> > > > 2009/9/9 mdipierro 
> >
> > > > > The problem is that you return cliente=clientes[0] i.e. a single
> > > > > client, not multimple Rows, but in view you loop over c{{for
> cliente
> > > > > in cliente:}} as if cliente were Rows and not a single cliente.
> >
> > > > > My advice is:
> >
> > > > > def show():
> > > > >''' ver cliente '''
> > > > >nome = request.vars.nome
> > > > >clientes=db(db.cliente.nome==nome).select(limitby=(0,1))
> > > > >if not len(clientes): redirect(URL(r=request, f='clientes'))
> > > > >return dict(cliente=clientes[0])
> >
> > > > > {{extend 'layout.html'}}
> >
> > > > > Clientes arquivados.
> > > > >{{=cliente.id}}
> > > > >Nome: {{=A(cliente.nome, _href=URL(r=request,
> f='show?nome=%s'
> > > > > % cliente.nome))}} 
> > > > >Contacto: {{=cliente.contacto}}
> > > > >Email: {{=cliente.email}}
> > > > >Morada: {{=cliente.morada}}
> > > > >
> >
> > > > > Massimo
> >
> > > > > On Sep 9, 6:51 am, Carlos Aboim  wrote:
> > > > > > Hi,
> >
> > > > > > I have the next files.
> > > > > > I want to retrieve just a record from a list in database.
> >
> > > > > > controller   --->  http://dpaste.com/hold/91386/
> > > > > > view   --->  http://dpaste.com/hold/91385/
> >
> > > > > > but it gives me the next error:
> >
> > > > > > error output ---> invalid function
> >
> > > > > > by the way, if the retrieved info has a special caracter it
> doesnt
> > > > > > render giving a unicode error. How do I declare a coding other
> than
> > > in
> > > > > > the controller that is already done?!
> >
> > > > > > thank you in advanced
> > > > > > Carlos Aboim
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30619] Re: Building queries from strings

2009-09-10 Thread Don

Okay, that was a bad example and my fault.  Let's try again

x = 'db.table.id == value'
query = x
set = db(query)
row = set.select()

This will fail because the "query" variable is not a gluon.sql.Query
object, it is just a string.  How can I convert from a string to a
query?


On Sep 10, 10:32 am, Yarko Tymciurak  wrote:
> the "idiom" is db(WHERE_CLAUSE).select(FROM_CLAUSE)  (a simplification, but
> you get the idea)
>
> so you want
>
> query_results = db(x).select()
>
> or (equivalently):
>
> query_results = db(x).select(db.table.ALL)
>
> On Thu, Sep 10, 2009 at 9:26 AM, Don  wrote:
>
> > Ex:
> > x = 'db.table.id == value'
> > query = db(x)
>
> > * This fails.  Is it possible to convert a string into a query?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30618] Re: action based on received email

2009-09-10 Thread Julio

I think the OP wanted to "execute something" based on an email
"trigger", i.e. when sending an email to a specific address with, say,
the contents of a blog post, and have the system automatically add the
post based on the contents of the email, something like that, this is
somewhat away from web2py, if this is the case you basically need to
configure the web server (and every webserver is somewhat unique) to
"pipe" the message to a (python?) script and have the script perform
the necessary parsing, etc..

My 2 cents.

On Sep 9, 9:14 pm, Yarko Tymciurak  wrote:
> not sure exactly what you are asking - but (for example) to register a user,
> you can send a verification email to the user, with a generated URL.  Upon
> registration you can create a UUID, and on your server, a controller to
> accept the UID as a argument, and thus uniquely identify and validate.
>
> E.g.:   user f...@bar.com  on registration gets assigned (by your software) a
> uuid of 123456;  You include a link in their verification email, such 
> as:http://mysite.net/myapp/verify/registration/123456
>
> Then in your controllers, you create a verify.py, with a registration()
> function that takes request.args(0)  --- the 123456 --- finds it in a user
> record (with a query / select), and marks that record as verified.
>
> Is this all you were asking?
>
> - Yarko
>
> On Wed, Sep 9, 2009 at 11:02 PM, Iceberg  wrote:
>
> > On Sep10, 9:05am, Victor  wrote:
> > > hello everyone just a quick question here. I noticed that the trend
> > > nowadays is having a client send an email to a specified address, and
> > > having an application on the server do something based on the address
> > > that it was sent to. Facebook does this with uploads. I just wanted to
> > > know how it is done . I understand that this is not necessarily a
> > > web2py question, but I would be grateful to get some directions as to
> > > where and how I can get more info. I tried google but I dont even know
> > > what phrase to use.
>
> > > Thanks Everyone
>
> > > Victor
>
> > With no doubt, this is not a web server question at all. You need to
> > setup (and customize) an email server to reactive on special mail. Try
> > to learn whatever email server then you will find your clue. That is
> > the only direction.
>
> > Iceberg
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30617] Re: Building queries from strings

2009-09-10 Thread Yarko Tymciurak
the "idiom" is db(WHERE_CLAUSE).select(FROM_CLAUSE)  (a simplification, but
you get the idea)

so you want

query_results = db(x).select()

or (equivalently):

query_results = db(x).select(db.table.ALL)

On Thu, Sep 10, 2009 at 9:26 AM, Don  wrote:

>
> Ex:
> x = 'db.table.id == value'
> query = db(x)
>
> * This fails.  Is it possible to convert a string into a query?
>
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30616] Re: Building queries from strings

2009-09-10 Thread Jose



On 10 sep, 14:26, Don  wrote:
> Ex:
> x = 'db.table.id == value'
> query = db(x)
>
> * This fails.  Is it possible to convert a string into a query?


Replace with:

x = (db.table.id == value)
query = db(x)

Jose
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30615] Re: Uploading File for Statistical Operations

2009-09-10 Thread Anand Vaidya

Have a look at the Algorithms Animator, Cool!

http://vimeo.com/1735226

Regards
Anand

On Sep 10, 4:11 pm, Timmie  wrote:
> > This does exactly what you want:
>
> >    http://vimeo.com/6401333
>
> > the source code is in
>
> >    http://bazaar.launchpad.net/~mdipierro/qcdmc/development/files
>
> Wow, thanks for posting this here and letting us know.
> It's great and shows a good enterprise directed application.
>
> Use such good examples and your framework will be more widespread.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30614] Building queries from strings

2009-09-10 Thread Don

Ex:
x = 'db.table.id == value'
query = db(x)

* This fails.  Is it possible to convert a string into a query?




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30613] Importing XML code

2009-09-10 Thread encompass

I know how to work with xml code.  I just wanted to make sure I do it
with all the built in libraries that are possible.
I have an existing tool that will be sending me an XML in a post
request.  What is the best way for me to take that data and use it in
my Web2py Application?  they are not Blogs, but a very large peices of
data about Elevators.
Regards,
Jason
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30612] Re: ticket tracking

2009-09-10 Thread mdipierro

make app "error" with a controller default.py and an action

def index():
from gluon.tools import Mail
mail=Mail()
mail.settings.server="smpt.example.com:port"
mail.settings.sender="y...@example.com"
mail.settings.login="you:password"
ticket=request.vars.ticket
subject="Ticket: %s" % ticket
message=bla bla bla
mail.sent
(to="administra...@example.com",subject=subject,message=message)
return "Sorry, an error occurred (%s), administrator has been
notified" % ticket

and then create a file web2py/routes.py and in it write:

error_handler = dict(application='error', controller='default',
function='index')





On Sep 10, 8:54 am, David Zejda  wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Hello,
>
> for a productive site I wish to touch the default error handler, maybe
> using some kind of decorator. IMO it would be good to
>
> 1. retain the ticket generation
> 2. notify admin by e-mail
> 3. redirect client to a custom error page
>
> I would like to do it site-wide - not using the decorators for all
> controller functions one-by-one.
>
> Please, I will appreciate your advices..
>
> Thanks a lot!
>
> David
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org
>
> iEYEARECAAYFAkqpBQ8ACgkQ3oCkkciamVEWpwCglAV9jvlB7qNYeqzBHe6kyj5a
> Z94AoKhys1cmmSRw9UYAnzIdIX3E57aU
> =/pZf
> -END PGP SIGNATURE-
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30611] Re: json errors

2009-09-10 Thread mdipierro

DAL Rows objects are not json serializable. It must be converted to a
list of dict first as below:

@service.json
@service.jsonrpc
def list_users():
return dict(users=db(db.auth_user.id>0).select().as_list())

On Sep 10, 8:28 am, Manoj  wrote:
> Hello,
> I have following code in my controller
>
> @service.json
> @service.jsonrpc
> def list_users():
>     return dict(users=db(db.auth_user.id>0).select())
>
> when i go tohttp://127.0.0.1:8000/userapp/default/list_users.json
>
> it gives me "no json"
>
> http://127.0.0.1:8000/userapp/default/list_users.xml
> works fine
>
> Is there any way to get json out of database rows? or do i need to
> create a list or dict first and then serialize it with simplejson ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30610] Re: error on rendering just a record!

2009-09-10 Thread mdipierro

That is all. When you visit the page there will be a create form in
the page.
Perhaps I misunderstand what you want to do.

On Sep 10, 8:14 am, Carlos Aboim  wrote:
> I'm sorry I didn't get the point.
>
> What should I do with {{=crud.update(db.cliente, cliente)}}
> I put it in the view and...
>
> thank you
> CA
>
> 2009/9/9 mdipierro 
>
>
>
> > {{=crud.update(db.cliente,cliente)}}
>
> > On Sep 9, 9:50 am, Carlos Aboim  wrote:
> > > Hey Massimo,
> > > thanks for your reply,
> > > I've changed the code as you said and now it's ok. But I whould like to
> > edit
> > > the record.
> > > 1. How do I do to edit that record.
> > > 2. How do I change the order of apearence of fields, because the fields
> > > seams to be apearing in a random away maybe not...
>
> > > thanks again
> > > CAboim
>
> > > 2009/9/9 mdipierro 
>
> > > > The problem is that you return cliente=clientes[0] i.e. a single
> > > > client, not multimple Rows, but in view you loop over c{{for cliente
> > > > in cliente:}} as if cliente were Rows and not a single cliente.
>
> > > > My advice is:
>
> > > > def show():
> > > >    ''' ver cliente '''
> > > >    nome = request.vars.nome
> > > >    clientes=db(db.cliente.nome==nome).select(limitby=(0,1))
> > > >    if not len(clientes): redirect(URL(r=request, f='clientes'))
> > > >    return dict(cliente=clientes[0])
>
> > > > {{extend 'layout.html'}}
>
> > > > Clientes arquivados.
> > > >    {{=cliente.id}}
> > > >    Nome: {{=A(cliente.nome, _href=URL(r=request, f='show?nome=%s'
> > > > % cliente.nome))}} 
> > > >    Contacto: {{=cliente.contacto}}
> > > >    Email: {{=cliente.email}}
> > > >    Morada: {{=cliente.morada}}
> > > >    
>
> > > > Massimo
>
> > > > On Sep 9, 6:51 am, Carlos Aboim  wrote:
> > > > > Hi,
>
> > > > > I have the next files.
> > > > > I want to retrieve just a record from a list in database.
>
> > > > > controller   --->  http://dpaste.com/hold/91386/
> > > > > view           --->  http://dpaste.com/hold/91385/
>
> > > > > but it gives me the next error:
>
> > > > > error output ---> invalid function
>
> > > > > by the way, if the retrieved info has a special caracter it doesnt
> > > > > render giving a unicode error. How do I declare a coding other than
> > in
> > > > > the controller that is already done?!
>
> > > > > thank you in advanced
> > > > > Carlos Aboim
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30609] ticket tracking

2009-09-10 Thread David Zejda

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello,

for a productive site I wish to touch the default error handler, maybe
using some kind of decorator. IMO it would be good to

1. retain the ticket generation
2. notify admin by e-mail
3. redirect client to a custom error page

I would like to do it site-wide - not using the decorators for all
controller functions one-by-one.

Please, I will appreciate your advices..

Thanks a lot!

David
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkqpBQ8ACgkQ3oCkkciamVEWpwCglAV9jvlB7qNYeqzBHe6kyj5a
Z94AoKhys1cmmSRw9UYAnzIdIX3E57aU
=/pZf
-END PGP SIGNATURE-

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30608] Re: return and redirect

2009-09-10 Thread __Kyo__

Becouse the form created, is configured to download a pdf (return),
but when I
resume using the form, it needs to be updated (redirect). thanks

On Sep 10, 12:50 am, Richard  wrote:
> why do you need to update the form?
>
> On Sep 10, 6:58 am, __Kyo__  wrote:
>
>
>
> > def reporte():
> >     form=FORM(TABLE(
> >     TR("Tirador",SELECT(_type="select",_name="usuario",
> >         *[OPTION(x.apellidopaterno,' ',x.apellidomaterno,'
> > ',x.nombre,_value=x.id)
> >         for x in db().select(db.usuario.ALL, orderby =
> > db.usuario.apellidopaterno)])),
> >     TR("", INPUT(_type='submit',_value='Reporte'))
> >         ))
> >     if form.accepts(request.vars, session):
> >         return reporte01(form.vars.usuario)
>
> > -->
> >         #here i want to redirect the funtion or update.
> > -->
>
> >     return dict(form=form)
>
> > Sorry the another post were incomplete and not make myself understood,
> > apologies, the post was a mistake.
> > Here is the function, so after donwload the pdf, i want to update my
> > form. Thank you very much
>
> > On Sep 9, 3:42 pm, mdipierro  wrote:
>
> > > Please explain more. I do not understand.
>
> > > On Sep 9, 3:36 pm, __Kyo__  wrote:
>
> > > > A form created, is configured to download a pdf (return), but when I
> > > > resume using the form, it needs to be updated (redirect), maybe
> > > > there's another way to do this, download and update the form... thanks
> > > > in advance.
>
> > > > On Sep 9, 3:06 pm, mdipierro  wrote:
>
> > > > > I do not understand. You can do this:
>
> > > > > if success:
> > > > >     return dict()
> > > > > else:
> > > > >     redirect(somewhere)
>
> > > > > but you cannot do both at the same time.
>
> > > > > technically redirect raises HTTP(303) while return raises HTTP(200).
>
> > > > > massimo
>
> > > > > On Sep 9, 3:03 pm, __Kyo__  wrote:
>
> > > > > > Is there any way to include return and redirect at same time, in one
> > > > > > function?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30607] Re: Default application with virtualhost

2009-09-10 Thread Jose



On 10 sep, 07:17, Fran  wrote:

> To redirect to your application, I use mod_rewrite:
>
> RewriteEngine On
> RewriteRule ^/$ /myapplication/ [R]
>
> F


Thanks Fran. Works well

Regards
Jose
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30606] json errors

2009-09-10 Thread Manoj

Hello,
I have following code in my controller

@service.json
@service.jsonrpc
def list_users():
return dict(users=db(db.auth_user.id>0).select())

when i go to
http://127.0.0.1:8000/userapp/default/list_users.json

it gives me "no json"

http://127.0.0.1:8000/userapp/default/list_users.xml
works fine

Is there any way to get json out of database rows? or do i need to
create a list or dict first and then serialize it with simplejson ?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30605] Re: error on rendering just a record!

2009-09-10 Thread Carlos Aboim
I'm sorry I didn't get the point.

What should I do with {{=crud.update(db.cliente, cliente)}}
I put it in the view and...

thank you
CA

2009/9/9 mdipierro 

>
> {{=crud.update(db.cliente,cliente)}}
>
> On Sep 9, 9:50 am, Carlos Aboim  wrote:
> > Hey Massimo,
> > thanks for your reply,
> > I've changed the code as you said and now it's ok. But I whould like to
> edit
> > the record.
> > 1. How do I do to edit that record.
> > 2. How do I change the order of apearence of fields, because the fields
> > seams to be apearing in a random away maybe not...
> >
> > thanks again
> > CAboim
> >
> > 2009/9/9 mdipierro 
> >
> >
> >
> > > The problem is that you return cliente=clientes[0] i.e. a single
> > > client, not multimple Rows, but in view you loop over c{{for cliente
> > > in cliente:}} as if cliente were Rows and not a single cliente.
> >
> > > My advice is:
> >
> > > def show():
> > >''' ver cliente '''
> > >nome = request.vars.nome
> > >clientes=db(db.cliente.nome==nome).select(limitby=(0,1))
> > >if not len(clientes): redirect(URL(r=request, f='clientes'))
> > >return dict(cliente=clientes[0])
> >
> > > {{extend 'layout.html'}}
> >
> > > Clientes arquivados.
> > >{{=cliente.id}}
> > >Nome: {{=A(cliente.nome, _href=URL(r=request, f='show?nome=%s'
> > > % cliente.nome))}} 
> > >Contacto: {{=cliente.contacto}}
> > >Email: {{=cliente.email}}
> > >Morada: {{=cliente.morada}}
> > >
> >
> > > Massimo
> >
> > > On Sep 9, 6:51 am, Carlos Aboim  wrote:
> > > > Hi,
> >
> > > > I have the next files.
> > > > I want to retrieve just a record from a list in database.
> >
> > > > controller   --->  http://dpaste.com/hold/91386/
> > > > view   --->  http://dpaste.com/hold/91385/
> >
> > > > but it gives me the next error:
> >
> > > > error output ---> invalid function
> >
> > > > by the way, if the retrieved info has a special caracter it doesnt
> > > > render giving a unicode error. How do I declare a coding other than
> in
> > > > the controller that is already done?!
> >
> > > > thank you in advanced
> > > > Carlos Aboim
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30604] Re: T3

2009-09-10 Thread mdipierro

Yes. Old ones. Proof of concepts for things to come. T2 was an example
of a possible plugin structure but everything in T2 is now in web2py.

T3 is harder to explain. There is a video on vimeo. It is a handy app,
it's only problem is that it still use T2 stuff. It should be
rewritten. It will not take long so perhaps it is one of the first
things I would do.

Massimo

On Sep 10, 7:13 am, eddwinston  wrote:
> Hi,
>
> What exactly is T2 or T3? Are they applications built with web2py or
> are not. I don't actually get it
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30603] Re: win32com and web2py

2009-09-10 Thread mdipierro

I would put the code below in a module in web2py/ and from the module
import serv in your apps.

On Sep 10, 7:16 am, tvw  wrote:
> Hi,
>     I've been trying to use win32com with web2py to get data from an
> external process. I have been using the following in a controller for
> my app (default.py)
>
> import win32com.client
> serv = win32com.client.Dispatch("MyService")
>
> Once I installed web2py source this worked fine, however sometimes it
> seems to try to create a second instance of the com connection to my
> service which then fails (in another thread ?) as only one can exist
> at a time.
>
> I would like to create only one instance of the com connection when
> web2py starts and then share that with all applications. My question
> is where should I put the above lines in web2py so that the com
> connection is shared between apps and how should the instance be
> referenced from each app.
>
> I hope I have made sense here. Please let me know if anyone can help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30602] Re: Uploading File for Statistical Operations

2009-09-10 Thread mdipierro

credits:

That is paid for by the Department of Energy.

I need to add the acknowledgment to the info page.

Massimo

On Sep 10, 3:11 am, Timmie  wrote:
> > This does exactly what you want:
>
> >    http://vimeo.com/6401333
>
> > the source code is in
>
> >    http://bazaar.launchpad.net/~mdipierro/qcdmc/development/files
>
> Wow, thanks for posting this here and letting us know.
> It's great and shows a good enterprise directed application.
>
> Use such good examples and your framework will be more widespread.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30601] win32com and web2py

2009-09-10 Thread tvw


Hi,
I've been trying to use win32com with web2py to get data from an
external process. I have been using the following in a controller for
my app (default.py)

import win32com.client
serv = win32com.client.Dispatch("MyService")

Once I installed web2py source this worked fine, however sometimes it
seems to try to create a second instance of the com connection to my
service which then fails (in another thread ?) as only one can exist
at a time.

I would like to create only one instance of the com connection when
web2py starts and then share that with all applications. My question
is where should I put the above lines in web2py so that the com
connection is shared between apps and how should the instance be
referenced from each app.

I hope I have made sense here. Please let me know if anyone can help.



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30600] T3

2009-09-10 Thread eddwinston

Hi,

What exactly is T2 or T3? Are they applications built with web2py or
are not. I don't actually get it
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30599] Re: Pycon

2009-09-10 Thread desfrenes

Also Tips on using the DAL with a domain model would be nice...

On 10 sep, 08:17, Richard  wrote:
> I would also be interested in understanding more about the DAL,
> particularly the new one in development.
>
> On Sep 10, 2:02 am, "mr.freeze"  wrote:
>
> > I would like to see a 'deep dive' into the DAL included complex
> > queries, best practices, limitations, tips and tricks.
>
> > On Sep 6, 4:05 pm, Massimo Di Pierro  wrote:
>
> > > I would like to propose a talk and a tutorial for PyCon 2010.
>
> > > I could use your help.
>
> > > What topic specifically would you like to hear more about in detail?
>
> > > Let me know if you are planning to any talk that is related or is  
> > > about a web2py project.
>
> > > Massimo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30598] Re: T3 rocks!

2009-09-10 Thread Timmie

> This would be an excellent addition to the appliances web2py already
> has. I was recently trying out GAE and set up a test site using T3.
> The installation was dead simple and T3 worked really well. With
> minimal effort I was able to set up -http://fightalzheimers.appspot.com
Yes, T3 is good. I started to convert my scaffolding-based app into a
T3 app.
Then I was told that development of T3 has stopped and the web2py has
absorbed its featured.
Like in the recent Nabble (Tutor list) posts it is not clear which
features are there and which not.

I think that there is really a need for a better infrstructure for
web2py development.

What is the latest plants concerning the following discussion?
Better infrastructure to developers -
http://groups.google.com/group/web2py-developers/t/e1232b6cc09b3d71

Best,
Timmie
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30597] Re: Uploading File for Statistical Operations

2009-09-10 Thread Timmie

> This does exactly what you want:
>
>    http://vimeo.com/6401333
>
> the source code is in
>
>    http://bazaar.launchpad.net/~mdipierro/qcdmc/development/files
Wow, thanks for posting this here and letting us know.
It's great and shows a good enterprise directed application.

Use such good examples and your framework will be more widespread.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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:30596] Re: Ajax

2009-09-10 Thread eddwinston

Thanks a lot guys. I will try it when I get hands on my app again.

Regards,
Winston

On Sep 10, 9:28 am, "mr.freeze"  wrote:
> Try this. u is the url, i is the form index (set to 0 for a single
> form on the page), and t is the target for the response.
>
> function ajaxSubmit(u,i,t){
>     frm = jQuery("form:eq(" + i + ")");
>     query = 'undefined=' + i;
>     if (frm.length==1){query = frm.serialize();}
>     jQuery.ajax({type: "POST", url: u, data: query, success: function
> (msg) { if(t==':eval') eval(msg); else jQuery("#"+t).html(msg); } });
>
> }
>
> On Sep 10, 1:05 am, eddwinston  wrote:
>
>
>
> > Hi,
>
> > I am away from my app right now but I guess it would be something like
> > this:
>
> >   data: '{ "name_of_ username_field": "username_field_value",
> >             "name_of_password_field": "password_field_value",
> >             "_formkey": "form_key_value",
> >             "_formname": "formname_value" }'
>
> > On Sep 10, 8:45 am, mdipierro  wrote:
>
> > > But this line
>
> > >    data: {},
>
> > > is not sending the username and password to the login page. It should
> > > also send the formkey and formname.
>
> > > On Sep 10, 12:11 am, eddwinston  wrote:
>
> > > > Hi,
>
> > > > This is what I did:
>
> > > > jQuery.ajax({
> > > >    type: "POST",
> > > >    url: "{{=URL(r=request,c='default', f='user', args='login'}}",
> > > >    data: {},
> > > >    success: function(response) {
> > > >       alert(response); // This line produced a complete page markup in
> > > > the alert dialog
> > > >    },
> > > >    error: failure_callback
> > > >  });
>
> > > > On Sep 10, 6:31 am, mdipierro  wrote:
>
> > > > > show us the code
>
> > > > > On Sep 9, 10:21 pm, eddwinston  wrote:
>
> > > > > > Hi,
>
> > > > > > I am trying to make an ajax login, I am currently sending request to
> > > > > > this url: [app]/default/user/login. But it has been fruitless. I 
> > > > > > just
> > > > > > get a full page html markup and the user will not be logged in. Is
> > > > > > there a way I can do it?
>
> > > > > > Regards,
> > > > > > Winston
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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
-~--~~~~--~~--~--~---



  1   2   >