[web2py] SQLFORM.smartgrid and auth_membership

2012-03-05 Thread Martin Weissenboeck
Hi, I habe some groups in auth_group with roles like "teacher", "student",
"administrator"
There are persons in auth_user with a membership to one or more of these
groups.
Now I want to show in a smartgrid only the "teacher"s

  sg = SQLFORM.smartgrid(db.auth_user, constraints=dict(auth_user=query))

but what would be the right query?

I have tried
query = (db.auth_user.id == db.auth_membership.id) &
  (db.auth_membership.group_id == 1)  # does not show all persons
query = db(auth.accessible_query('teacher', db.auth_user))
query = db(auth.has_membership(role='teacher'))  # ok, I know that's
wrong...

Regards, Martin


[web2py] load functionality in menu

2012-03-05 Thread Annet
In a view I have the following code in the right column of the
content:

{{=LOAD('vcardadmin','index.load',ajax=True,target='component')}}

The vcardadmin controller contains the following menu:

response.admin_menu=[
['Home',request.function=='index',URL('index')],
...
['Theme',request.function=='theme',URL('theme')]]


Which I would like to be rendered like this:


  Home
  ...
   Theme


Is it possible to adjust this code to get the above to work:


  {{for _name,_active,_link in response.admin_menu:}}
   
 {{=_name}}
   
 {{pass}}




[web2py] Fw: [security-77] Secure Coding (web app) Competition

2012-03-05 Thread Luther Goh Lu Feng
Fyi for web2py developers



- Forwarded Message -
> From: thomas lim 
> To: security...@meetup.com
> Cc: 
> Sent: Tuesday, February 28, 2012 10:39 AM
> Subject: [security-77] Secure Coding (web app) Competition
> 
> Hi readers of this mailing list
> 
> There will be a Secure Coding (Web Application) Competition at SyScan'12
> Singapore. This competition will be held 25-27 April and we will be
> accepting a maximum of 10 teams. So far, 6 teams have already signed up.
> The First Prize is S$10,000 (cash), Second Prize is S$7,000 (cash) and
> the Third Prize is S$3,000 (cash).
> 
> So do check out the SyScan website (www.syscan.org) to find out more
> about this competition and sign up quickly.
> 
> -- 
> Thank you
> Thomas Lim
> 
> 
> 
> 
> --
> Please Note: If you hit "REPLY", your message will be sent to everyone 
> on this mailing list (security...@meetup.com)
> http://www.meetup.com/SGSecurityMG/
> This message was sent by thomas lim (tho...@coseinc.com) from The Singapore 
> Security Meetup Group.
> To learn more about thomas lim, visit his/her member profile: 
> http://www.meetup.com/SGSecurityMG/members/11745624/
> Set my mailing list to email me
> 
> As they are sent
> http://www.meetup.com/SGSecurityMG/list_prefs/?pref=1
> 
> In one daily email
> http://www.meetup.com/SGSecurityMG/list_prefs/?pref=2
> 
> Don't send me mailing list messages
> http://www.meetup.com/SGSecurityMG/list_prefs/?pref=0
> Meetup, PO Box 4668 #37895 New York, New York 10163-4668 | supp...@meetup.com
> 


Re: [web2py] how to access auth.is_logged_in() from modules?

2012-03-05 Thread Bruno Rocha
in model after all (in the last line of the last model) include.

from gluon import current
current.auth = auth

so in module you will have access to current.auth.

http://zerp.ly/rochacbruno
Em 06/03/2012 03:40, "weheh"  escreveu:

> I'm finally migrating many, possibly all model functions to modules,
> where they belong. But one of my functions tests auth.is_logged_in(),
> which can not be found from within modules. Nor is it a
> current... I've done a bit of digging but haven't
> found the answer, yet. If someone knows how to do it, I'd appreciate a
> pointer. Thanks.
>


[web2py] how to access auth.is_logged_in() from modules?

2012-03-05 Thread weheh
I'm finally migrating many, possibly all model functions to modules,
where they belong. But one of my functions tests auth.is_logged_in(),
which can not be found from within modules. Nor is it a
current... I've done a bit of digging but haven't
found the answer, yet. If someone knows how to do it, I'd appreciate a
pointer. Thanks.


[web2py] Re: form.element() focus

2012-03-05 Thread Annet
Hi Alan,

> I think there is not (not sure). But what if more than one field has
> focus set to True?

It's just this one field in this one form which is the exception to
the rule, because it's an multiple table update form an organization's
name_address_locality data.

I'll use the workaround to solve the problem.


Kind regards,

Annet.


Re: [web2py] Re: more tutorials?

2012-03-05 Thread mikech
Bruno:

This sounds great, I'd like to hear a sample in English when it's available.

Mike

On Monday, March 5, 2012 4:47:06 PM UTC-8, rochacbruno wrote:
>
> I teach a Python and web2py online course for begginers[1], I teach the 
> course in Portuguese and now it is completing one year of existence, in 
> this last year I've trained 156 people in 10 class groups, normally each 
> group has 15-20 students and all the classes are recorded and available for 
> future referencing.
>
> Now I am starting to record a series "*Python and web2py from the 
> beginner to intermediate*" - This will be a payed on-line course in 
> videos a total of 12 classes (In English with Spanish subtitles), having 2 
> hours each class and total on-line support for the students. During the 
> course following the successful example of the Portuguese classes, the 
> students will develop an e-commerce system for a fictitious store.
>
> In the program we are going to see the Python basics, Object Oriented 
> Programming with Python, Most used modules and tools and development of 
> scripts, modules, packages, simple desktop application with Tkinter & DAL 
> and after that we will have 7 videos talking about almost everything of 
> web2py and basics of web development.
>
> I am studying to improve my English pronunciation and counting with the 
> help of a English teacher to be better understandable (but still with a 
> nice Portuguese accent..)
>
> The whole program will cost ~U$300 per student (almost the same I charge 
> in Brazil)
>
> You can watch an example class in Portuguese: 
> here: (Intro video) http://www.cursodepython.com.br/ and here: (3 hour 
> class) http://www.cursodepython.com.br/matricula/curso-gravado
>
> I just started to record it all in English and I am negotiating the 
> inclusion of Spanish subtitles.
>
> I will announce here when I get some videos ready!
>
> [1] http://www.cursodepython.com.br 
> -- 
>
> Bruno Rocha
> [http://rochacbruno.com.br]
>
>
On Monday, March 5, 2012 4:47:06 PM UTC-8, rochacbruno wrote:
>
> I teach a Python and web2py online course for begginers[1], I teach the 
> course in Portuguese and now it is completing one year of existence, in 
> this last year I've trained 156 people in 10 class groups, normally each 
> group has 15-20 students and all the classes are recorded and available for 
> future referencing.
>
> Now I am starting to record a series "*Python and web2py from the 
> beginner to intermediate*" - This will be a payed on-line course in 
> videos a total of 12 classes (In English with Spanish subtitles), having 2 
> hours each class and total on-line support for the students. During the 
> course following the successful example of the Portuguese classes, the 
> students will develop an e-commerce system for a fictitious store.
>
> In the program we are going to see the Python basics, Object Oriented 
> Programming with Python, Most used modules and tools and development of 
> scripts, modules, packages, simple desktop application with Tkinter & DAL 
> and after that we will have 7 videos talking about almost everything of 
> web2py and basics of web development.
>
> I am studying to improve my English pronunciation and counting with the 
> help of a English teacher to be better understandable (but still with a 
> nice Portuguese accent..)
>
> The whole program will cost ~U$300 per student (almost the same I charge 
> in Brazil)
>
> You can watch an example class in Portuguese: 
> here: (Intro video) http://www.cursodepython.com.br/ and here: (3 hour 
> class) http://www.cursodepython.com.br/matricula/curso-gravado
>
> I just started to record it all in English and I am negotiating the 
> inclusion of Spanish subtitles.
>
> I will announce here when I get some videos ready!
>
> [1] http://www.cursodepython.com.br 
> -- 
>
> Bruno Rocha
> [http://rochacbruno.com.br]
>
>

Re: [web2py] Re: Last Day for Submissions! -- Web2py Application Exhibition Version 3.0

2012-03-05 Thread Mr admin
Very soon, I hope.  I'm trying to contact the other judges.

Mr.NetAdmin


On Mon, Mar 5, 2012 at 12:26 PM, spiffytech  wrote:

> When will the winners be announced?
>
>
> On Feb 14, 11:04 pm, NetAdmin  wrote:
> > Hello All,
> >
> > February 15 is the last day for submissions for the
> Web2pyApplicationExhibitionVersion 3.0 so don't delay!
> >
> > For more details, see the pinned message at the top of the news-group.
> >
> > Mr.NetAdmin
> >
> > Mr.NetAdmin@gmail
>


Re: [web2py] Re: more tutorials?

2012-03-05 Thread Bruno Rocha
I teach a Python and web2py online course for begginers[1], I teach the
course in Portuguese and now it is completing one year of existence, in
this last year I've trained 156 people in 10 class groups, normally each
group has 15-20 students and all the classes are recorded and available for
future referencing.

Now I am starting to record a series "*Python and web2py from the beginner
to intermediate*" - This will be a payed on-line course in videos a total
of 12 classes (In English with Spanish subtitles), having 2 hours each
class and total on-line support for the students. During the course
following the successful example of the Portuguese classes, the students
will develop an e-commerce system for a fictitious store.

In the program we are going to see the Python basics, Object Oriented
Programming with Python, Most used modules and tools and development of
scripts, modules, packages, simple desktop application with Tkinter & DAL
and after that we will have 7 videos talking about almost everything of
web2py and basics of web development.

I am studying to improve my English pronunciation and counting with the
help of a English teacher to be better understandable (but still with a
nice Portuguese accent..)

The whole program will cost ~U$300 per student (almost the same I charge in
Brazil)

You can watch an example class in Portuguese:
here: (Intro video) http://www.cursodepython.com.br/ and here: (3 hour
class) http://www.cursodepython.com.br/matricula/curso-gravado

I just started to record it all in English and I am negotiating the
inclusion of Spanish subtitles.

I will announce here when I get some videos ready!

[1] http://www.cursodepython.com.br
-- 

Bruno Rocha
[http://rochacbruno.com.br]


Re: [web2py] Re: web2py 1.99.7 is OUT

2012-03-05 Thread Alvaro Lizama Molina
Again i suggest read this
http://nvie.com/posts/a-successful-git-branching-model/ for a best workflow
for git and github.


2012/3/5 pbreit 

> Until we have stable and dev branches I'm not sure we need to do any of
> this. And it still seems like the pace of change would make dev/stable
> branches difficult.
>
> There are a lot of people testing the current changeset so problems get
> fixed relatively quickly. If you don't want to take a chance, stay on the
> version you're on for a bit. The only major problem is that you won't get
> any bug fixes in the mean time.
>



-- 
Alvaro Lizama Molina  - http://alvarolizama.net


Re: [web2py] Re: web2py 1.99.7 is OUT

2012-03-05 Thread pbreit
Until we have stable and dev branches I'm not sure we need to do any of 
this. And it still seems like the pace of change would make dev/stable 
branches difficult.

There are a lot of people testing the current changeset so problems get 
fixed relatively quickly. If you don't want to take a chance, stay on the 
version you're on for a bit. The only major problem is that you won't get 
any bug fixes in the mean time.


[web2py] Using Spawn in Web2Py with Web2Py Python Implementation

2012-03-05 Thread james c.
At irregular intervals I need to cleanup files written by my
application for users. In the documentation it was suggested that one
of the possibilities is to launch a script to do this. I'm doing the
following from my controller and it works fine:

os.spawnl(os.P_NOWAIT, r'C:\Python25\python.exe', 'python',
'clean_up.py '+the_path);


Is there a way I can do the same and use Web2Py's Python interpreter?

thanks in advance for any advice, James


[web2py] apache https only need help

2012-03-05 Thread Richard
Hello,

Is there someone that could help with configuring apache and possibly nginx 
for serving only https?

Appreciate.

Richard


Re: [web2py] Re: web2py 1.99.7 is OUT

2012-03-05 Thread Michele Comitini
Maybe we should create another label such as "production" or "GA" vs
latest (instead of "nightly build").  "production" becomes latest
after no major bugs are found for a 5 days. The name change  also
encourage  testing "latest"... on could feel more comfortable at first
sight.

mic


Il 05 marzo 2012 23:27, Massimo Di Pierro 
ha scritto:
> we do. We have the nightly build and we do post release candidates in
> advance. The problem is that not many people test it.
>
>
> On Monday, 5 March 2012 12:31:49 UTC-6, spiffytech wrote:
>>
>> Have you considered publishing release candidates ~1 week ahead of a
>> release, to allow early-adopters to upgrade and see what's broken,
>> rather than having the rapid stream of releases? I saw you said "I'm
>> releasing 1.99.5 tomorrow, please test it today", but that's rather a
>> short and informal testing cycle.
>>
>>
>> On Mar 4, 5:29 pm, Massimo Di Pierro 
>> wrote:
>> > Same as 1.99.5 and 1.99.6 but should solve all the outstanding
>> > compatibility issues.
>> >
>> > Massimo


[web2py] Re: web2py 1.99.7 is OUT

2012-03-05 Thread Massimo Di Pierro
we do. We have the nightly build and we do post release candidates in 
advance. The problem is that not many people test it.

On Monday, 5 March 2012 12:31:49 UTC-6, spiffytech wrote:
>
> Have you considered publishing release candidates ~1 week ahead of a 
> release, to allow early-adopters to upgrade and see what's broken, 
> rather than having the rapid stream of releases? I saw you said "I'm 
> releasing 1.99.5 tomorrow, please test it today", but that's rather a 
> short and informal testing cycle. 
>
>
> On Mar 4, 5:29 pm, Massimo Di Pierro  
> wrote: 
> > Same as 1.99.5 and 1.99.6 but should solve all the outstanding 
> > compatibility issues. 
> > 
> > Massimo



[web2py] Re: Legacy databases

2012-03-05 Thread Massimo Di Pierro
It is safer to use the web2py API instead of raw SQL.

On Monday, 5 March 2012 12:17:56 UTC-6, Ralo Tannahill wrote:
>
> Is it safe (from the perspective of queries syntax or stability) to use 
> MySQLdb in web2py (DAL), or is it better to use it "manually" as an import 
> and use raw SQL for accessing MySQL 3?
> If have found this url showing the changes needed
>
> http://code.google.com/p/web2py/source/diff?spec=svnfc75444ca55590835b4d0dc0e6c06a85e3f282a8&r=fc75444ca55590835b4d0dc0e6c06a85e3f282a8&format=side&path=/gluon/dal.py
>
>
> On Saturday, March 3, 2012 9:06:41 PM UTC+1, Alan Etkin wrote:
>>
>> If web2py uses pymysql, then it should not work with version 3: 
>>
>> (pymysql) Requirements 
>>
>> Python 2.4 or higher 
>>
>> http://www.python.org/ 
>> 2.6 is the primary test environment. 
>>
>> MySQL 4.1 or higher 
>>
>> protocol41 support, experimental 4.0 support 
>>
>> With some modifications, it should be possible to accept another 
>> library in the MySQL adpater. For example, PostgreSQL adpater now 
>> accepts two optional db interface libraries specified in the db uri. 
>>
>> On 3 mar, 13:52, Ralo Tannahill  wrote: 
>> > Hello all 
>> > 
>> > I'm new to python and web2py, and I'm evaluating them to make new 
>> > developments accessing legacy databases (MSSQL 2000, MySQL 3 and MySQL 
>> 5 ). 
>> > I've tried the connection strings shown in the web2py book, but I can 
>> > connect only to MySQL 5. 
>> > 
>> > - The error connecting to MySQL 3 is "access denied for user 
>> > @databaseServer (using password: NO)", because no username or password 
>> is 
>> > passed to the server . 
>> > Is it a problem with pymysql? Searching in google, I found the python 
>> > module "MySQLdb" and with that module I can connect to both MySQL 3 and 
>> 5. 
>> > Could I configure web2py to use MySQLdb instead of pymysql? 
>> > 
>> > - The error connecting to MSSQL says that I don't specify a DSN or 
>> driver 
>> > 
>> > I am using CENTOS 6 (64bits) + python 2.6 + apache + mod_wsgi 
>> > I'd appreciate any help, thanks in advance
>
>

[web2py] Re: Using MYSql with DAL

2012-03-05 Thread Massimo Di Pierro
replace:

db = DAL('sqlite://storage.sqlite')

with

db = DAL('mysql://username:password@hostname/dbname')

replace username, password, hostname and dbname with your own. That's it. 
Everything is the same as with sqlite.

On Monday, 5 March 2012 09:55:10 UTC-6, Vijeenrosh PW Vijeen wrote:
>
> Hello , 
> greetings to all,
>
> Iam an new web2py user . Iam picking up the basics from the documetation 
> provided there . In those only SQLite  in conjuction with the DAL is 
> explained . 
> Unfortunately I have to use MySQL as the database.
>
> could somebody point out how to use mysql in conjuction with DAL and how 
> to execute basic queries .
>
> Iam using Ubuntu 10.10 and have installed MySQL and the daemon(mysqld) is 
> running . 
>
> what should I do to make an connection with DAL ?
>
> ---
> Vijeenrosh PW 
> www.BlackJackVijeen.blogspot.com
> Computer Science and Engineering , GEC Thrissur
> kerala, India
>
>

[web2py] Re: Unable to stream to ios devices

2012-03-05 Thread nick name
On Friday, March 2, 2012 12:43:03 PM UTC-5, Rajesh Subramanian wrote:
>
> Hello, 
> First of all, what a beautiful framework web2py is! Thank you! 
>
> I am having issues streaming a video file to ios devices. 
> The file is not the problem because the same file plays properly on 
> those devices when it is served by Amazon CloudFront (here is the URL 
>

What do you mean by problems?

If the playback stops after a few seconds, although the progress bar keeps 
advancing, and seeking around the stream seems to work only until that 
point where it breaks (the point may be different for different refreshes), 
then this is almost surely the rocket.py problem I documented here: 
https://github.com/explorigin/Rocket/issues/1#issuecomment-3734231 ; there 
is no simple fix, and the rocket.py guy has not been responsive.

I'm not familiar enough with rocket to offer a good solution. On my server 
I added a patch that violently closes the connection in the place I note in 
that patch - but that's not a good solution because the whole idea of 
streaming is that some clients consume slowly.


[web2py] Re: more tutorials?

2012-03-05 Thread Anthony
Maybe some of these will help:
http://www.web2py.com/examples/default/examples
http://www.web2py.com/AlterEgo (some of these entries are outdated)
http://www.web2pyslices.com
http://www.web2py.com/examples/default/videos/
http://www.youtube.com/playlist?list=PL5E2E223FE3777851
http://killer-web-development.com/ 

Anthony

On Monday, March 5, 2012 4:18:52 PM UTC-5, Larry Wapnitsky wrote:
>
> So, I seem to be getting stuck a lot as I'm learning web2py, but I'm not 
> finding the online documentation to be very thorough in answering my 
> questions.  Additionally, as much as have enjoyed the assistance I've 
> gotten from the newsgroup so far, the time delay on responses keeps me from 
> working sometimes.
>
> Are there any more detailed tutorials online related to web2py that go 
> into more depth?  I do have the Cookbook on order for when it is released, 
> but having information available at all times online would be beneficial. 
> This is how I learned Python in the first place.
>
> Thanks
>


Re: [web2py] Re: Translations file

2012-03-05 Thread Bruce Wade
Bigger issue with the translation file.

I had a file where I added 90% of the file that was translated already, and
it was missing some keys. The translator then truncated everything and only
added the keys that were missing.

On Mon, Mar 5, 2012 at 11:26 AM, Anthony  wrote:

> I agree -- if the file exists and appears corrupted, a warning or error
> would be more appropriate rather than silent overwriting (particularly
> since "corruption" will most likely just be a different encoding).
>
> Anthony
>
>
> On Monday, March 5, 2012 1:20:26 PM UTC-5, Detectedstealth wrote:
>>
>> That could work but my point is when I opened the file in a text editor
>> everything looked fine, however it was then overwritten so I was clueless
>> as to why it was happening, until I went to save as and seen the encoding.
>> Once I changed it to UTF-8 the file was no longer overwritten.
>>
>> --
>> Regards,
>> Bruce
>>
>> On Mon, Mar 5, 2012 at 10:10 AM, Alan Etkin  wrote:
>>
>>> Maybe allowing to override the behavior with a initial argument? In
>>> that way, developers could do:
>>>
>>> T.no_overwrite = True
>>>
>>> And default to the normal file managing.
>>>
>>>
>>> On Mar 5, 2:13 pm, Massimo Di Pierro 
>>> wrote:
>>> > web2py rewrites language files in order to add translation strings. If
>>> it
>>> > does not find a string, it adds it. The problem in your case is that
>>> the
>>> > file appears corrupted (not utf8, not created by web2py) and therefore
>>> it
>>> > find no translation string and needs to add them all.
>>> >
>>> > This is the intended behavior. Can we change it? How should it
>>> > behave exactly in this case?
>>> > If it does not overwrite it, you are going to get a ticket when you try
>>> > edit using the admin interface.
>>> >
>>> > massimo
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > On Monday, 5 March 2012 09:37:01 UTC-6, Detectedstealth wrote:
>>> >
>>> > > Was able to resolve the problem, the file was encoded as: GB18030
>>> changing
>>> > > to UTF-8 allowed the file to show up again.
>>> >
>>> > > However I think the framework should give a error like unable to
>>> read file
>>> > > etc... instead of just overwriting a file?
>>> >
>>> > > On Mon, Mar 5, 2012 at 7:29 AM, Bruce Wade 
>>> wrote:
>>> >
>>> > >> Hi,
>>> >
>>> > >> I gave someone a translation file to translate, however when I put
>>> the
>>> > >> new file in the languages folder it gets overridden by web2py
>>> > >> automatically. Any specific reason this would happen?
>>> >
>>> > >> --
>>> > >> --
>>> > >> Regards,
>>> > >> Bruce Wade
>>> > >>http://ca.linkedin.com/in/**brucelwade
>>> > >>http://www.wadecybertech.com
>>> > >>http://www.warplydesigned.**com 
>>> > >>http://www.**fitnessfriendsfinder.com
>>> >
>>> > > --
>>> > > --
>>> > > Regards,
>>> > > Bruce Wade
>>> > >http://ca.linkedin.com/in/**brucelwade
>>> > >http://www.wadecybertech.com
>>> > >http://www.warplydesigned.com
>>> > >http://www.**fitnessfriendsfinder.com
>>> >
>>> > On Monday, 5 March 2012 09:37:01 UTC-6, Detectedstealth wrote:
>>> >
>>> > > Was able to resolve the problem, the file was encoded as: GB18030
>>> changing
>>> > > to UTF-8 allowed the file to show up again.
>>> >
>>> > > However I think the framework should give a error like unable to
>>> read file
>>> > > etc... instead of just overwriting a file?
>>> >
>>> > > On Mon, Mar 5, 2012 at 7:29 AM, Bruce Wade 
>>> wrote:
>>> >
>>> > >> Hi,
>>> >
>>> > >> I gave someone a translation file to translate, however when I put
>>> the
>>> > >> new file in the languages folder it gets overridden by web2py
>>> > >> automatically. Any specific reason this would happen?
>>> >
>>> > >> --
>>> > >> --
>>> > >> Regards,
>>> > >> Bruce Wade
>>> > >>http://ca.linkedin.com/in/**brucelwade
>>> > >>http://www.wadecybertech.com
>>> > >>http://www.warplydesigned.**com 
>>> > >>http://www.**fitnessfriendsfinder.com
>>> >
>>> > > --
>>> > > --
>>> > > Regards,
>>> > > Bruce Wade
>>> > >http://ca.linkedin.com/in/**brucelwade
>>> > >http://www.wadecybertech.com
>>> > >http://www.warplydesigned.com
>>> > >http://www.**fitnessfriendsfinder.com
>>>
>>
>>
>>
>> --
>> --
>> Regards,
>> Bruce Wade
>> http://ca.linkedin.com/in/**brucelwade
>> http://www.wadecybertech.com
>> http://www.warplydesigned.com
>> http://www.**fitnessfriendsfinder.com
>>
>


-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


Re: [web2py] more tutorials?

2012-03-05 Thread Larry Wapnitsky
And this link (http://www.web2py.com/books/default/reference/29/alterego)
no longer works, as does the one on redirecting, which is where i"m
seriously getting stuck.

On Mon, Mar 5, 2012 at 16:18, Larry Wapnitsky  wrote:

> So, I seem to be getting stuck a lot as I'm learning web2py, but I'm not
> finding the online documentation to be very thorough in answering my
> questions.  Additionally, as much as have enjoyed the assistance I've
> gotten from the newsgroup so far, the time delay on responses keeps me from
> working sometimes.
>
> Are there any more detailed tutorials online related to web2py that go
> into more depth?  I do have the Cookbook on order for when it is released,
> but having information available at all times online would be beneficial.
> This is how I learned Python in the first place.
>
> Thanks
>


[web2py] more tutorials?

2012-03-05 Thread Larry Wapnitsky
So, I seem to be getting stuck a lot as I'm learning web2py, but I'm not 
finding the online documentation to be very thorough in answering my 
questions.  Additionally, as much as have enjoyed the assistance I've 
gotten from the newsgroup so far, the time delay on responses keeps me from 
working sometimes.

Are there any more detailed tutorials online related to web2py that go into 
more depth?  I do have the Cookbook on order for when it is released, but 
having information available at all times online would be beneficial. This 
is how I learned Python in the first place.

Thanks


Re: [web2py] Re: web2py[:]

2012-03-05 Thread Massimiliano
Very nice work! I think it could be a booster for web2py community!

Congratulations


On Mon, Mar 5, 2012 at 8:25 PM, Omi Chiba  wrote:

> It looks great !!
>
>


-- 
Massimiliano


Re: [web2py] Re: Translations file

2012-03-05 Thread Anthony
I agree -- if the file exists and appears corrupted, a warning or error 
would be more appropriate rather than silent overwriting (particularly 
since "corruption" will most likely just be a different encoding).

Anthony

On Monday, March 5, 2012 1:20:26 PM UTC-5, Detectedstealth wrote:
>
> That could work but my point is when I opened the file in a text editor 
> everything looked fine, however it was then overwritten so I was clueless 
> as to why it was happening, until I went to save as and seen the encoding. 
> Once I changed it to UTF-8 the file was no longer overwritten. 
>
> --
> Regards,
> Bruce
>
> On Mon, Mar 5, 2012 at 10:10 AM, Alan Etkin  wrote:
>
>> Maybe allowing to override the behavior with a initial argument? In
>> that way, developers could do:
>>
>> T.no_overwrite = True
>>
>> And default to the normal file managing.
>>
>>
>> On Mar 5, 2:13 pm, Massimo Di Pierro 
>> wrote:
>> > web2py rewrites language files in order to add translation strings. If 
>> it
>> > does not find a string, it adds it. The problem in your case is that the
>> > file appears corrupted (not utf8, not created by web2py) and therefore 
>> it
>> > find no translation string and needs to add them all.
>> >
>> > This is the intended behavior. Can we change it? How should it
>> > behave exactly in this case?
>> > If it does not overwrite it, you are going to get a ticket when you try
>> > edit using the admin interface.
>> >
>> > massimo
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > On Monday, 5 March 2012 09:37:01 UTC-6, Detectedstealth wrote:
>> >
>> > > Was able to resolve the problem, the file was encoded as: GB18030 
>> changing
>> > > to UTF-8 allowed the file to show up again.
>> >
>> > > However I think the framework should give a error like unable to read 
>> file
>> > > etc... instead of just overwriting a file?
>> >
>> > > On Mon, Mar 5, 2012 at 7:29 AM, Bruce Wade  
>> wrote:
>> >
>> > >> Hi,
>> >
>> > >> I gave someone a translation file to translate, however when I put 
>> the
>> > >> new file in the languages folder it gets overridden by web2py
>> > >> automatically. Any specific reason this would happen?
>> >
>> > >> --
>> > >> --
>> > >> Regards,
>> > >> Bruce Wade
>> > >>http://ca.linkedin.com/in/brucelwade
>> > >>http://www.wadecybertech.com
>> > >>http://www.warplydesigned.com
>> > >>http://www.fitnessfriendsfinder.com
>> >
>> > > --
>> > > --
>> > > Regards,
>> > > Bruce Wade
>> > >http://ca.linkedin.com/in/brucelwade
>> > >http://www.wadecybertech.com
>> > >http://www.warplydesigned.com
>> > >http://www.fitnessfriendsfinder.com
>> >
>> > On Monday, 5 March 2012 09:37:01 UTC-6, Detectedstealth wrote:
>> >
>> > > Was able to resolve the problem, the file was encoded as: GB18030 
>> changing
>> > > to UTF-8 allowed the file to show up again.
>> >
>> > > However I think the framework should give a error like unable to read 
>> file
>> > > etc... instead of just overwriting a file?
>> >
>> > > On Mon, Mar 5, 2012 at 7:29 AM, Bruce Wade  
>> wrote:
>> >
>> > >> Hi,
>> >
>> > >> I gave someone a translation file to translate, however when I put 
>> the
>> > >> new file in the languages folder it gets overridden by web2py
>> > >> automatically. Any specific reason this would happen?
>> >
>> > >> --
>> > >> --
>> > >> Regards,
>> > >> Bruce Wade
>> > >>http://ca.linkedin.com/in/brucelwade
>> > >>http://www.wadecybertech.com
>> > >>http://www.warplydesigned.com
>> > >>http://www.fitnessfriendsfinder.com
>> >
>> > > --
>> > > --
>> > > Regards,
>> > > Bruce Wade
>> > >http://ca.linkedin.com/in/brucelwade
>> > >http://www.wadecybertech.com
>> > >http://www.warplydesigned.com
>> > >http://www.fitnessfriendsfinder.com
>>
>
>
>
> -- 
> -- 
> Regards,
> Bruce Wade
> http://ca.linkedin.com/in/brucelwade
> http://www.wadecybertech.com
> http://www.warplydesigned.com
> http://www.fitnessfriendsfinder.com
>  


Re: [web2py] Re: web2py[:]

2012-03-05 Thread Omi Chiba

>
> It looks great !! 



[web2py] Re: web2py 1.99.7 is OUT

2012-03-05 Thread spiffytech
Have you considered publishing release candidates ~1 week ahead of a
release, to allow early-adopters to upgrade and see what's broken,
rather than having the rapid stream of releases? I saw you said "I'm
releasing 1.99.5 tomorrow, please test it today", but that's rather a
short and informal testing cycle.


On Mar 4, 5:29 pm, Massimo Di Pierro 
wrote:
> Same as 1.99.5 and 1.99.6 but should solve all the outstanding
> compatibility issues.
>
> Massimo


[web2py] Re: Last Day for Submissions! -- Web2py Application Exhibition Version 3.0

2012-03-05 Thread spiffytech
When will the winners be announced?


On Feb 14, 11:04 pm, NetAdmin  wrote:
> Hello All,
>
> February 15 is the last day for submissions for the 
> Web2pyApplicationExhibitionVersion 3.0 so don't delay!
>
> For more details, see the pinned message at the top of the news-group.
>
> Mr.NetAdmin
>
> Mr.NetAdmin@gmail


Re: [web2py] Re: Translations file

2012-03-05 Thread Bruce Wade
That could work but my point is when I opened the file in a text editor
everything looked fine, however it was then overwritten so I was clueless
as to why it was happening, until I went to save as and seen the encoding.
Once I changed it to UTF-8 the file was no longer overwritten.

--
Regards,
Bruce

On Mon, Mar 5, 2012 at 10:10 AM, Alan Etkin  wrote:

> Maybe allowing to override the behavior with a initial argument? In
> that way, developers could do:
>
> T.no_overwrite = True
>
> And default to the normal file managing.
>
>
> On Mar 5, 2:13 pm, Massimo Di Pierro 
> wrote:
> > web2py rewrites language files in order to add translation strings. If it
> > does not find a string, it adds it. The problem in your case is that the
> > file appears corrupted (not utf8, not created by web2py) and therefore it
> > find no translation string and needs to add them all.
> >
> > This is the intended behavior. Can we change it? How should it
> > behave exactly in this case?
> > If it does not overwrite it, you are going to get a ticket when you try
> > edit using the admin interface.
> >
> > massimo
> >
> >
> >
> >
> >
> >
> >
> > On Monday, 5 March 2012 09:37:01 UTC-6, Detectedstealth wrote:
> >
> > > Was able to resolve the problem, the file was encoded as: GB18030
> changing
> > > to UTF-8 allowed the file to show up again.
> >
> > > However I think the framework should give a error like unable to read
> file
> > > etc... instead of just overwriting a file?
> >
> > > On Mon, Mar 5, 2012 at 7:29 AM, Bruce Wade 
> wrote:
> >
> > >> Hi,
> >
> > >> I gave someone a translation file to translate, however when I put the
> > >> new file in the languages folder it gets overridden by web2py
> > >> automatically. Any specific reason this would happen?
> >
> > >> --
> > >> --
> > >> Regards,
> > >> Bruce Wade
> > >>http://ca.linkedin.com/in/brucelwade
> > >>http://www.wadecybertech.com
> > >>http://www.warplydesigned.com
> > >>http://www.fitnessfriendsfinder.com
> >
> > > --
> > > --
> > > Regards,
> > > Bruce Wade
> > >http://ca.linkedin.com/in/brucelwade
> > >http://www.wadecybertech.com
> > >http://www.warplydesigned.com
> > >http://www.fitnessfriendsfinder.com
> >
> > On Monday, 5 March 2012 09:37:01 UTC-6, Detectedstealth wrote:
> >
> > > Was able to resolve the problem, the file was encoded as: GB18030
> changing
> > > to UTF-8 allowed the file to show up again.
> >
> > > However I think the framework should give a error like unable to read
> file
> > > etc... instead of just overwriting a file?
> >
> > > On Mon, Mar 5, 2012 at 7:29 AM, Bruce Wade 
> wrote:
> >
> > >> Hi,
> >
> > >> I gave someone a translation file to translate, however when I put the
> > >> new file in the languages folder it gets overridden by web2py
> > >> automatically. Any specific reason this would happen?
> >
> > >> --
> > >> --
> > >> Regards,
> > >> Bruce Wade
> > >>http://ca.linkedin.com/in/brucelwade
> > >>http://www.wadecybertech.com
> > >>http://www.warplydesigned.com
> > >>http://www.fitnessfriendsfinder.com
> >
> > > --
> > > --
> > > Regards,
> > > Bruce Wade
> > >http://ca.linkedin.com/in/brucelwade
> > >http://www.wadecybertech.com
> > >http://www.warplydesigned.com
> > >http://www.fitnessfriendsfinder.com
>



-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


[web2py] Re: Legacy databases

2012-03-05 Thread Ralo Tannahill
Is it safe (from the perspective of queries syntax or stability) to use 
MySQLdb in web2py (DAL), or is it better to use it "manually" as an import 
and use raw SQL for accessing MySQL 3?
If have found this url showing the changes needed
http://code.google.com/p/web2py/source/diff?spec=svnfc75444ca55590835b4d0dc0e6c06a85e3f282a8&r=fc75444ca55590835b4d0dc0e6c06a85e3f282a8&format=side&path=/gluon/dal.py


On Saturday, March 3, 2012 9:06:41 PM UTC+1, Alan Etkin wrote:
>
> If web2py uses pymysql, then it should not work with version 3: 
>
> (pymysql) Requirements 
>
> Python 2.4 or higher 
>
> http://www.python.org/ 
> 2.6 is the primary test environment. 
>
> MySQL 4.1 or higher 
>
> protocol41 support, experimental 4.0 support 
>
> With some modifications, it should be possible to accept another 
> library in the MySQL adpater. For example, PostgreSQL adpater now 
> accepts two optional db interface libraries specified in the db uri. 
>
> On 3 mar, 13:52, Ralo Tannahill  wrote: 
> > Hello all 
> > 
> > I'm new to python and web2py, and I'm evaluating them to make new 
> > developments accessing legacy databases (MSSQL 2000, MySQL 3 and MySQL 5 
> ). 
> > I've tried the connection strings shown in the web2py book, but I can 
> > connect only to MySQL 5. 
> > 
> > - The error connecting to MySQL 3 is "access denied for user 
> > @databaseServer (using password: NO)", because no username or password 
> is 
> > passed to the server . 
> > Is it a problem with pymysql? Searching in google, I found the python 
> > module "MySQLdb" and with that module I can connect to both MySQL 3 and 
> 5. 
> > Could I configure web2py to use MySQLdb instead of pymysql? 
> > 
> > - The error connecting to MSSQL says that I don't specify a DSN or 
> driver 
> > 
> > I am using CENTOS 6 (64bits) + python 2.6 + apache + mod_wsgi 
> > I'd appreciate any help, thanks in advance



[web2py] Re: Translations file

2012-03-05 Thread Alan Etkin
Maybe allowing to override the behavior with a initial argument? In
that way, developers could do:

T.no_overwrite = True

And default to the normal file managing.


On Mar 5, 2:13 pm, Massimo Di Pierro 
wrote:
> web2py rewrites language files in order to add translation strings. If it
> does not find a string, it adds it. The problem in your case is that the
> file appears corrupted (not utf8, not created by web2py) and therefore it
> find no translation string and needs to add them all.
>
> This is the intended behavior. Can we change it? How should it
> behave exactly in this case?
> If it does not overwrite it, you are going to get a ticket when you try
> edit using the admin interface.
>
> massimo
>
>
>
>
>
>
>
> On Monday, 5 March 2012 09:37:01 UTC-6, Detectedstealth wrote:
>
> > Was able to resolve the problem, the file was encoded as: GB18030 changing
> > to UTF-8 allowed the file to show up again.
>
> > However I think the framework should give a error like unable to read file
> > etc... instead of just overwriting a file?
>
> > On Mon, Mar 5, 2012 at 7:29 AM, Bruce Wade  wrote:
>
> >> Hi,
>
> >> I gave someone a translation file to translate, however when I put the
> >> new file in the languages folder it gets overridden by web2py
> >> automatically. Any specific reason this would happen?
>
> >> --
> >> --
> >> Regards,
> >> Bruce Wade
> >>http://ca.linkedin.com/in/brucelwade
> >>http://www.wadecybertech.com
> >>http://www.warplydesigned.com
> >>http://www.fitnessfriendsfinder.com
>
> > --
> > --
> > Regards,
> > Bruce Wade
> >http://ca.linkedin.com/in/brucelwade
> >http://www.wadecybertech.com
> >http://www.warplydesigned.com
> >http://www.fitnessfriendsfinder.com
>
> On Monday, 5 March 2012 09:37:01 UTC-6, Detectedstealth wrote:
>
> > Was able to resolve the problem, the file was encoded as: GB18030 changing
> > to UTF-8 allowed the file to show up again.
>
> > However I think the framework should give a error like unable to read file
> > etc... instead of just overwriting a file?
>
> > On Mon, Mar 5, 2012 at 7:29 AM, Bruce Wade  wrote:
>
> >> Hi,
>
> >> I gave someone a translation file to translate, however when I put the
> >> new file in the languages folder it gets overridden by web2py
> >> automatically. Any specific reason this would happen?
>
> >> --
> >> --
> >> Regards,
> >> Bruce Wade
> >>http://ca.linkedin.com/in/brucelwade
> >>http://www.wadecybertech.com
> >>http://www.warplydesigned.com
> >>http://www.fitnessfriendsfinder.com
>
> > --
> > --
> > Regards,
> > Bruce Wade
> >http://ca.linkedin.com/in/brucelwade
> >http://www.wadecybertech.com
> >http://www.warplydesigned.com
> >http://www.fitnessfriendsfinder.com


[web2py] Re: Using MYSql with DAL

2012-03-05 Thread Alan Etkin
Have a look at the sections "Dependencies" and "Connection strings"
in the book chapter "The database abstraction layer"

You will need a db driver for your system (check if it's already
installed):
pymysql or MySQLdb

Replace the uri string in DAL(...)
with something like this

mysql://username:password@localhost/test

Then you can use the common web2py query commands as described in the
same chapter.

On Mar 5, 12:55 pm, Vijeenrosh PW Vijeen 
wrote:
> Hello ,
> greetings to all,
>
> Iam an new web2py user . Iam picking up the basics from the documetation
> provided there . In those only SQLite  in conjuction with the DAL is
> explained .
> Unfortunately I have to use MySQL as the database.
>
> could somebody point out how to use mysql in conjuction with DAL and how to
> execute basic queries .
>
> Iam using Ubuntu 10.10 and have installed MySQL and the daemon(mysqld) is
> running .
>
> what should I do to make an connection with DAL ?
>
> ---
> Vijeenrosh PWwww.BlackJackVijeen.blogspot.com
> Computer Science and Engineering , GEC Thrissur
> kerala, India


[web2py] Re: how do I setup a GWT client app for a web2py server app within Eclipse?

2012-03-05 Thread Carl
After a walk in some sunshine...

Place the war folder under web2py's static folder (just like using
pyjs.org)


On Mar 5, 4:18 pm, Carl  wrote:
> I've used the excellent video athttp://vimeo.com/23145118as a proof
> of concept of writing an AJAX app in GWT and have this app communicate
> with my server based on Web2py.
>
> Locally, I've disabled security on Google Chrome using its --disable-
> web-security flag but a) I'd like to stop doing that and b) I'd like
> to deploy this proof of concept up onto GAE.
>
> Using Google's GWT StockWatcher as an example, how do I add it to my
> Web2py Eclipse project so that the app will be served from the same
> web address and port as the Web2py service?


[web2py] Using MYSql with DAL

2012-03-05 Thread Vijeenrosh PW Vijeen
Hello , 
greetings to all,

Iam an new web2py user . Iam picking up the basics from the documetation 
provided there . In those only SQLite  in conjuction with the DAL is 
explained . 
Unfortunately I have to use MySQL as the database.

could somebody point out how to use mysql in conjuction with DAL and how to 
execute basic queries .

Iam using Ubuntu 10.10 and have installed MySQL and the daemon(mysqld) is 
running . 

what should I do to make an connection with DAL ?

---
Vijeenrosh PW 
www.BlackJackVijeen.blogspot.com
Computer Science and Engineering , GEC Thrissur
kerala, India



Re: [web2py] Re: Translations file

2012-03-05 Thread Bruce Wade
Wouldn't it be better to get an ticket saying it can't read the file?
Instead of just truncating the file/creating a new file? At least if there
was an error we would know the problem, it was just a fluke that I noticed
the formatting was not UTF-8 because I gave it to a translator to change
using a text editor.

On Mon, Mar 5, 2012 at 9:13 AM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> web2py rewrites language files in order to add translation strings. If it
> does not find a string, it adds it. The problem in your case is that the
> file appears corrupted (not utf8, not created by web2py) and therefore it
> find no translation string and needs to add them all.
>
> This is the intended behavior. Can we change it? How should it
> behave exactly in this case?
> If it does not overwrite it, you are going to get a ticket when you try
> edit using the admin interface.
>
> massimo
>
> On Monday, 5 March 2012 09:37:01 UTC-6, Detectedstealth wrote:
>>
>> Was able to resolve the problem, the file was encoded as: GB18030
>> changing to UTF-8 allowed the file to show up again.
>>
>> However I think the framework should give a error like unable to read
>> file etc... instead of just overwriting a file?
>>
>> On Mon, Mar 5, 2012 at 7:29 AM, Bruce Wade  wrote:
>>
>>> Hi,
>>>
>>> I gave someone a translation file to translate, however when I put the
>>> new file in the languages folder it gets overridden by web2py
>>> automatically. Any specific reason this would happen?
>>>
>>> --
>>> --
>>> Regards,
>>> Bruce Wade
>>> http://ca.linkedin.com/in/**brucelwade
>>> http://www.wadecybertech.com
>>> http://www.warplydesigned.com
>>> http://www.**fitnessfriendsfinder.com
>>>
>>
>>
>>
>> --
>> --
>> Regards,
>> Bruce Wade
>> http://ca.linkedin.com/in/**brucelwade
>> http://www.wadecybertech.com
>> http://www.warplydesigned.com
>> http://www.**fitnessfriendsfinder.com
>>
>
> On Monday, 5 March 2012 09:37:01 UTC-6, Detectedstealth wrote:
>>
>> Was able to resolve the problem, the file was encoded as: GB18030
>> changing to UTF-8 allowed the file to show up again.
>>
>> However I think the framework should give a error like unable to read
>> file etc... instead of just overwriting a file?
>>
>> On Mon, Mar 5, 2012 at 7:29 AM, Bruce Wade  wrote:
>>
>>> Hi,
>>>
>>> I gave someone a translation file to translate, however when I put the
>>> new file in the languages folder it gets overridden by web2py
>>> automatically. Any specific reason this would happen?
>>>
>>> --
>>> --
>>> Regards,
>>> Bruce Wade
>>> http://ca.linkedin.com/in/**brucelwade
>>> http://www.wadecybertech.com
>>> http://www.warplydesigned.com
>>> http://www.**fitnessfriendsfinder.com
>>>
>>
>>
>>
>> --
>> --
>> Regards,
>> Bruce Wade
>> http://ca.linkedin.com/in/**brucelwade
>> http://www.wadecybertech.com
>> http://www.warplydesigned.com
>> http://www.**fitnessfriendsfinder.com
>>
>


-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


[web2py] Re: improvement in web2py compatibility with legacy postgresql datbases column sequence name

2012-03-05 Thread Massimo Di Pierro
please open a ticket and append the patch. Perhaps this was an oversight.

Massimo

On Monday, 5 March 2012 09:55:13 UTC-6, Bruce Dickey wrote:
>
>
> Hi all,
>
> I'm using PostgreSQL with schemas w/ web2py 1.97. The patch shown here 
> from 2 years ago made that work. 
>
> I just downloaded v1.99.7 and noticed that this patch is not implemented 
> in /gluon/dal.py PostgreSQLAdapter.lastrowid().
>
> So I'm wondering what the outcome of this discussion was -- was some other 
> change made? Or will this be added in the future?
>
> Thanks,
> Bruce
>
>
>
> On Friday, February 5, 2010 4:58:56 AM UTC-7, kralin wrote:
>>
>> since in the same schema there are many to many tables with no primary
>> key,
>> a further improvement to the one described above can permitt the DAL
>> to write also this table
>> with the side effect of returning None on an insert instead of the
>> inserted record id (since there is no one)
>>
>>
>> this write to all tables:
>>
>> def lastrowid(self,tablename):
>> self.execute("""SELECT column_default from
>> information_schema.columns where table_name='%s'; """%tablename)
>> column_default=self.cursor.fetchone()
>> if column_default[0]:#if there is no sequence in the table
>> first column
>> get_currval_string ='select ' +
>> column_default[0].replace('nextval', 'currval')
>> self.execute(get_currval_string)
>> return int(self.cursor.fetchone()[0])
>> else:
>> return None #or the appropriate value
>>
>> On 5 Feb, 12:22, kralin  wrote:
>> > Hi,
>> > In the last days I've been trying to use the web2py DAL  to access a
>> > public DB shema widely used in bioinformatics (BioSQL,www.biosql.org).
>> >
>> > this schema does not follow web2py constraints, however  most of the
>> > tables have a primarykey that can be set as the 'id' fields.
>> >
>> > howver web2py DAL as it is is only able to read data, but fails to
>> > write because it assumes that in the postgresql db, each sequence for
>> > the 'id' field is named
>> >
>> > ''%s_id_Seq''%tablename
>> >
>> > while this is the default postgresql behaviour, and works most of the
>> > time, it fails if the sequence has a different name in this case:
>> >
>> > ''%s_pk_Seq''%tablename
>> >
>> > so after a lot o googleing I end up to made the following modification
>> > to the PostgreSQLAdapter class in gluon.dal
>> >
>> > orginal:
>> >
>> > def lastrowid(self,tablename):
>> > self.execute("select currval('%s_id_Seq')" % tablename)
>> > return int(self.cursor.fetchone()[0])
>> >
>> > improved:
>> >
>> > def lastrowid(self,tablename):
>> > self.execute("""select column_default from
>> > information_schema.columns where table_name='%s'; """%tablename)
>> > get_currval_string ='select ' + self.cursor.fetchone()
>> > [0].replace('nextval', 'currval')
>> > self.execute(get_currval_string)
>> > return int(self.cursor.fetchone()[0])
>> >
>> > this way, the sequence name is dynamically retrieved from the db, and
>> > should work on any situation.
>> >
>> > Hope this help!
>> >
>> > Andrea
>>
>>
> On Friday, February 5, 2010 4:58:56 AM UTC-7, kralin wrote:
>>
>> since in the same schema there are many to many tables with no primary
>> key,
>> a further improvement to the one described above can permitt the DAL
>> to write also this table
>> with the side effect of returning None on an insert instead of the
>> inserted record id (since there is no one)
>>
>>
>> this write to all tables:
>>
>> def lastrowid(self,tablename):
>> self.execute("""SELECT column_default from
>> information_schema.columns where table_name='%s'; """%tablename)
>> column_default=self.cursor.fetchone()
>> if column_default[0]:#if there is no sequence in the table
>> first column
>> get_currval_string ='select ' +
>> column_default[0].replace('nextval', 'currval')
>> self.execute(get_currval_string)
>> return int(self.cursor.fetchone()[0])
>> else:
>> return None #or the appropriate value
>>
>> On 5 Feb, 12:22, kralin  wrote:
>> > Hi,
>> > In the last days I've been trying to use the web2py DAL  to access a
>> > public DB shema widely used in bioinformatics (BioSQL,www.biosql.org).
>> >
>> > this schema does not follow web2py constraints, however  most of the
>> > tables have a primarykey that can be set as the 'id' fields.
>> >
>> > howver web2py DAL as it is is only able to read data, but fails to
>> > write because it assumes that in the postgresql db, each sequence for
>> > the 'id' field is named
>> >
>> > ''%s_id_Seq''%tablename
>> >
>> > while this is the default postgresql behaviour, and works most of the
>> > time, it fails if the sequence has a different name in this case:
>> >
>> > ''%s_pk_Seq''%tablename
>> >
>> > so after a lot o googleing I end up to made the following modification
>> > to the PostgreSQLAdapter class in gluon.dal
>> >
>> > orginal:
>> >
>>

[web2py] Re: Translations file

2012-03-05 Thread Massimo Di Pierro
web2py rewrites language files in order to add translation strings. If it 
does not find a string, it adds it. The problem in your case is that the 
file appears corrupted (not utf8, not created by web2py) and therefore it 
find no translation string and needs to add them all.

This is the intended behavior. Can we change it? How should it 
behave exactly in this case?
If it does not overwrite it, you are going to get a ticket when you try 
edit using the admin interface.

massimo

On Monday, 5 March 2012 09:37:01 UTC-6, Detectedstealth wrote:
>
> Was able to resolve the problem, the file was encoded as: GB18030 changing 
> to UTF-8 allowed the file to show up again.
>
> However I think the framework should give a error like unable to read file 
> etc... instead of just overwriting a file?
>
> On Mon, Mar 5, 2012 at 7:29 AM, Bruce Wade  wrote:
>
>> Hi,
>>
>> I gave someone a translation file to translate, however when I put the 
>> new file in the languages folder it gets overridden by web2py 
>> automatically. Any specific reason this would happen?
>>
>> -- 
>> -- 
>> Regards,
>> Bruce Wade
>> http://ca.linkedin.com/in/brucelwade
>> http://www.wadecybertech.com
>> http://www.warplydesigned.com
>> http://www.fitnessfriendsfinder.com
>>  
>
>
>
> -- 
> -- 
> Regards,
> Bruce Wade
> http://ca.linkedin.com/in/brucelwade
> http://www.wadecybertech.com
> http://www.warplydesigned.com
> http://www.fitnessfriendsfinder.com
>  

On Monday, 5 March 2012 09:37:01 UTC-6, Detectedstealth wrote:
>
> Was able to resolve the problem, the file was encoded as: GB18030 changing 
> to UTF-8 allowed the file to show up again.
>
> However I think the framework should give a error like unable to read file 
> etc... instead of just overwriting a file?
>
> On Mon, Mar 5, 2012 at 7:29 AM, Bruce Wade  wrote:
>
>> Hi,
>>
>> I gave someone a translation file to translate, however when I put the 
>> new file in the languages folder it gets overridden by web2py 
>> automatically. Any specific reason this would happen?
>>
>> -- 
>> -- 
>> Regards,
>> Bruce Wade
>> http://ca.linkedin.com/in/brucelwade
>> http://www.wadecybertech.com
>> http://www.warplydesigned.com
>> http://www.fitnessfriendsfinder.com
>>  
>
>
>
> -- 
> -- 
> Regards,
> Bruce Wade
> http://ca.linkedin.com/in/brucelwade
> http://www.wadecybertech.com
> http://www.warplydesigned.com
> http://www.fitnessfriendsfinder.com
>  


Re: [web2py] Weird behavior of decimal stored in session.

2012-03-05 Thread Carlos Costa
I dont know why but you can fix it explicitly using Decimal.
http://docs.python.org/library/decimal.html#module-decimal

2012/3/5 Francisco :
> Hi everyone. I just came across a weird behavior and I'm wondering if it's
> some kind of bug or just my fault.
>
> I have a model for a product like this:
>
> db.define_table('products',
>     Field('name',length=128, notnull=True),
>     Field('sale_price',type='decimal(14,4)',default=0, notnull=True))
>
> Now when the user adds a product to the cart I'm storing the row for the
> product in a dictionary in the session like this:
>
> session.cart[product.id] = product
>
> finally the view that displays it lets you pick among several payment
> options and based on the option it multiplies the price by another number
> like this:
>
> {{=session.cart[id].sale_price * session.payment_factor}}
>
> Both sale price and payment factor are store in DB as decimal(14,4). The
> first time the code is run the view executes correctly. But when you add
> another product to the cart, or modify any other thing that requires a
> reload or repost of the page I get an error like this:
>
> TypeError: unsupported operand type(s) for *: 'float' and 'Decimal'
>
>
> So what is happening is that after the first time my variable which is store
> in the session and that should be treated like a Decimal is being returned
> as a float. This is happening in the development environment with SQLite, I
> have not tested this yet under MySQL. I think it is caused by the fact that
> SQLite stores decimals as float, buy I wonder why does the first time it is
> transformed to Decimal, and then just used as a float? And I wonder if I
> must manually converted them to Decimal every time I use this variables.
>
> Hope someone can help.



-- 
Carlos J. Costa
Cientista da Computação
Esp. Gestão em Telecom

EL MELECH NEEMAN!
אָמֵן


Re: [web2py] How to use XML data

2012-03-05 Thread Carlos Costa
You can do something like in http://web2py.com/books/default/chapter/29/5 :
Parsing

The TAG object is also an XML/HTML parser. It can read text and
convert into a tree structure of helpers. This allows manipulation
using the API above:
>>> html = 'Titlethis is a test'
>>> parsed_html = TAG(html)
>>> parsed_html.element('span')[0]='TEST'
>>> print parsed_html
Titlethis is a TEST

2012/3/5 Praveen Bhat :
> Hello,
>
> I am using http://worldweatheronline.com API to display weather info. The
> API returns the data in XML format.
>
> How can i render the same in a HTML page in Web2py.
>
> Link for accessing the API Data:
>
> Weather API
>
> I have done the same in PHP as following:
>
>  $xml =
> simplexml_load_file('http://free.worldweatheronline.com/feed/weather.ashx?q=udupi&format=xml&num_of_days=5&key=b019cd7d6a135850110711');
> $current = $xml->xpath("/data/current_condition");
> ?>
>
> 
> Weather :
> temp_C ?>° C,
> weatherDesc ?>
> 
>
> How can I do the same in web2py?
>
>
> Regards,
> Praveen
>



-- 
Carlos J. Costa
Cientista da Computação
Esp. Gestão em Telecom

EL MELECH NEEMAN!
אָמֵן


[web2py] how do I setup a GWT client app for a web2py server app within Eclipse?

2012-03-05 Thread Carl
I've used the excellent video at http://vimeo.com/23145118 as a proof
of concept of writing an AJAX app in GWT and have this app communicate
with my server based on Web2py.

Locally, I've disabled security on Google Chrome using its --disable-
web-security flag but a) I'd like to stop doing that and b) I'd like
to deploy this proof of concept up onto GAE.

Using Google's GWT StockWatcher as an example, how do I add it to my
Web2py Eclipse project so that the app will be served from the same
web address and port as the Web2py service?


[web2py] Weird behavior of decimal stored in session.

2012-03-05 Thread Francisco
Hi everyone. I just came across a weird behavior and I'm wondering if it's 
some kind of bug or just my fault.

I have a model for a product like this:

db.define_table('products',
Field('name',length=128, notnull=True),
Field('sale_price',type='decimal(14,4)',default=0, notnull=True))

Now when the user adds a product to the cart I'm storing the row for the 
product in a dictionary in the session like this:

session.cart[product.id] = product

finally the view that displays it lets you pick among several payment 
options and based on the option it multiplies the price by another number 
like this:

{{=session.cart[id].sale_price * session.payment_factor}}

Both sale price and payment factor are store in DB as decimal(14,4). The 
first time the code is run the view executes correctly. But when you add 
another product to the cart, or modify any other thing that requires a 
reload or repost of the page I get an error like this:

TypeError: unsupported operand type(s) for *: 'float' and 'Decimal'


So what is happening is that after the first time my variable which is 
store in the session and that should be treated like a Decimal is being 
returned as a float. This is happening in the development environment with 
SQLite, I have not tested this yet under MySQL. I think it is caused by the 
fact that SQLite stores decimals as float, buy I wonder why does the first 
time it is transformed to Decimal, and then just used as a float? And I 
wonder if I must manually converted them to Decimal every time I use this 
variables.

Hope someone can help.


[web2py] Re: improvement in web2py compatibility with legacy postgresql datbases column sequence name

2012-03-05 Thread Bruce Dickey

Hi all,

I'm using PostgreSQL with schemas w/ web2py 1.97. The patch shown here from 
2 years ago made that work. 

I just downloaded v1.99.7 and noticed that this patch is not implemented in 
/gluon/dal.py PostgreSQLAdapter.lastrowid().

So I'm wondering what the outcome of this discussion was -- was some other 
change made? Or will this be added in the future?

Thanks,
Bruce



On Friday, February 5, 2010 4:58:56 AM UTC-7, kralin wrote:
>
> since in the same schema there are many to many tables with no primary
> key,
> a further improvement to the one described above can permitt the DAL
> to write also this table
> with the side effect of returning None on an insert instead of the
> inserted record id (since there is no one)
>
>
> this write to all tables:
>
> def lastrowid(self,tablename):
> self.execute("""SELECT column_default from
> information_schema.columns where table_name='%s'; """%tablename)
> column_default=self.cursor.fetchone()
> if column_default[0]:#if there is no sequence in the table
> first column
> get_currval_string ='select ' +
> column_default[0].replace('nextval', 'currval')
> self.execute(get_currval_string)
> return int(self.cursor.fetchone()[0])
> else:
> return None #or the appropriate value
>
> On 5 Feb, 12:22, kralin  wrote:
> > Hi,
> > In the last days I've been trying to use the web2py DAL  to access a
> > public DB shema widely used in bioinformatics (BioSQL,www.biosql.org).
> >
> > this schema does not follow web2py constraints, however  most of the
> > tables have a primarykey that can be set as the 'id' fields.
> >
> > howver web2py DAL as it is is only able to read data, but fails to
> > write because it assumes that in the postgresql db, each sequence for
> > the 'id' field is named
> >
> > ''%s_id_Seq''%tablename
> >
> > while this is the default postgresql behaviour, and works most of the
> > time, it fails if the sequence has a different name in this case:
> >
> > ''%s_pk_Seq''%tablename
> >
> > so after a lot o googleing I end up to made the following modification
> > to the PostgreSQLAdapter class in gluon.dal
> >
> > orginal:
> >
> > def lastrowid(self,tablename):
> > self.execute("select currval('%s_id_Seq')" % tablename)
> > return int(self.cursor.fetchone()[0])
> >
> > improved:
> >
> > def lastrowid(self,tablename):
> > self.execute("""select column_default from
> > information_schema.columns where table_name='%s'; """%tablename)
> > get_currval_string ='select ' + self.cursor.fetchone()
> > [0].replace('nextval', 'currval')
> > self.execute(get_currval_string)
> > return int(self.cursor.fetchone()[0])
> >
> > this way, the sequence name is dynamically retrieved from the db, and
> > should work on any situation.
> >
> > Hope this help!
> >
> > Andrea
>
>
On Friday, February 5, 2010 4:58:56 AM UTC-7, kralin wrote:
>
> since in the same schema there are many to many tables with no primary
> key,
> a further improvement to the one described above can permitt the DAL
> to write also this table
> with the side effect of returning None on an insert instead of the
> inserted record id (since there is no one)
>
>
> this write to all tables:
>
> def lastrowid(self,tablename):
> self.execute("""SELECT column_default from
> information_schema.columns where table_name='%s'; """%tablename)
> column_default=self.cursor.fetchone()
> if column_default[0]:#if there is no sequence in the table
> first column
> get_currval_string ='select ' +
> column_default[0].replace('nextval', 'currval')
> self.execute(get_currval_string)
> return int(self.cursor.fetchone()[0])
> else:
> return None #or the appropriate value
>
> On 5 Feb, 12:22, kralin  wrote:
> > Hi,
> > In the last days I've been trying to use the web2py DAL  to access a
> > public DB shema widely used in bioinformatics (BioSQL,www.biosql.org).
> >
> > this schema does not follow web2py constraints, however  most of the
> > tables have a primarykey that can be set as the 'id' fields.
> >
> > howver web2py DAL as it is is only able to read data, but fails to
> > write because it assumes that in the postgresql db, each sequence for
> > the 'id' field is named
> >
> > ''%s_id_Seq''%tablename
> >
> > while this is the default postgresql behaviour, and works most of the
> > time, it fails if the sequence has a different name in this case:
> >
> > ''%s_pk_Seq''%tablename
> >
> > so after a lot o googleing I end up to made the following modification
> > to the PostgreSQLAdapter class in gluon.dal
> >
> > orginal:
> >
> > def lastrowid(self,tablename):
> > self.execute("select currval('%s_id_Seq')" % tablename)
> > return int(self.cursor.fetchone()[0])
> >
> > improved:
> >
> > def lastrowid(self,tablename):
> > self.execute("""select column_default from
> > information_schema.

[web2py] Re: Translations file

2012-03-05 Thread Anthony
Please submit an issue: http://code.google.com/p/web2py/issues/list

On Monday, March 5, 2012 10:37:01 AM UTC-5, Detectedstealth wrote:
>
> Was able to resolve the problem, the file was encoded as: GB18030 changing 
> to UTF-8 allowed the file to show up again.
>
> However I think the framework should give a error like unable to read file 
> etc... instead of just overwriting a file?
>
> On Mon, Mar 5, 2012 at 7:29 AM, Bruce Wade  wrote:
>
>> Hi,
>>
>> I gave someone a translation file to translate, however when I put the 
>> new file in the languages folder it gets overridden by web2py 
>> automatically. Any specific reason this would happen?
>>
>> -- 
>> -- 
>> Regards,
>> Bruce Wade
>> http://ca.linkedin.com/in/brucelwade
>> http://www.wadecybertech.com
>> http://www.warplydesigned.com
>> http://www.fitnessfriendsfinder.com
>>  
>
>
>
> -- 
> -- 
> Regards,
> Bruce Wade
> http://ca.linkedin.com/in/brucelwade
> http://www.wadecybertech.com
> http://www.warplydesigned.com
> http://www.fitnessfriendsfinder.com
>  


[web2py] Re: Translations file

2012-03-05 Thread Bruce Wade
Was able to resolve the problem, the file was encoded as: GB18030 changing
to UTF-8 allowed the file to show up again.

However I think the framework should give a error like unable to read file
etc... instead of just overwriting a file?

On Mon, Mar 5, 2012 at 7:29 AM, Bruce Wade  wrote:

> Hi,
>
> I gave someone a translation file to translate, however when I put the new
> file in the languages folder it gets overridden by web2py automatically.
> Any specific reason this would happen?
>
> --
> --
> Regards,
> Bruce Wade
> http://ca.linkedin.com/in/brucelwade
> http://www.wadecybertech.com
> http://www.warplydesigned.com
> http://www.fitnessfriendsfinder.com
>



-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


[web2py] Translations file

2012-03-05 Thread Bruce Wade
Hi,

I gave someone a translation file to translate, however when I put the new
file in the languages folder it gets overridden by web2py automatically.
Any specific reason this would happen?

-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


Re: [web2py] Re: web2py 1.99.5 is OUT

2012-03-05 Thread Phyo Arkar
corrupted download / upload problems.


On Mon, Mar 5, 2012 at 9:55 PM, Phyo Arkar  wrote:

> never yet , does that resolve most of the issues?
>
> On Mon, Mar 5, 2012 at 9:51 PM, Vasile Ermicioi  wrote:
>
>> have you tried uwsgi?
>
>
>


Re: [web2py] Re: web2py 1.99.5 is OUT

2012-03-05 Thread Phyo Arkar
never yet , does that resolve most of the issues?

On Mon, Mar 5, 2012 at 9:51 PM, Vasile Ermicioi  wrote:

> have you tried uwsgi?


Re: [web2py] Re: web2py 1.99.5 is OUT

2012-03-05 Thread Vasile Ermicioi
have you tried uwsgi?


Re: [web2py] Re: web2py 1.99.5 is OUT

2012-03-05 Thread Phyo Arkar
I think i am going to implement a file server (for upload and download)
using Tornado while Rocket is unstable at that. My work requires huge
amount of GBs of data to be uploaded / downloaded by users.

What you guys recommend? a separate Tornado server , (coz i would like
upload progressbar) or a separate web2py server just for uploading (and
downloading) behind Cherokee . Or any other stable soultions?

On Mon, Mar 5, 2012 at 7:05 PM, Phyo Arkar  wrote:

>  Do you experience the problem?
>
>
> Yes it happens even on large JSON output (rows of table as json . about 20
> MB) also , it courrpts in between (not server timeout but json at recving
> get corrupted)
>
> On Mon, Mar 5, 2012 at 6:48 PM, Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>> Do you experience the problem?
>
>
>


Re: [web2py] Re: smartgrid query on 2 or more tables

2012-03-05 Thread Johann Spies
On 5 March 2012 15:21, Roderick  wrote:

So, can you please help me - how do I do this:
> "as long as all the tables are presented in the original query"
> query = ?
> form = SQLFROM.grid(query,...)
>
> I.e. I need a grid that displays all data from all 10 of my tables so
> my users can run a complex query on any of them including joins?
>

Give me an example of a raw sql query that will do what you want.

Appadmin uses SQLTABLE which is easy to use with complex queries.

There are at least two plugins which can be used with complex queries:

Powertable http://powertable.blouweb.com/
and
Solidtable http://dev.s-cubism.com/plugin_solidtable

Regards
Johann
-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)


Re: [web2py] SQLFORM and scientific notation support.

2012-03-05 Thread Anthony
On Monday, March 5, 2012 7:22:05 AM UTC-5, Massimo Di Pierro wrote:
>
> Actually I think the problem is simply the JS validator. Try comment this 
> line in static/js/web2py.js
>
> doc.on('keyup', 'input.double, input.decimal', 
> function(){this.value=this.value.reverse().replace(/[^0-9\-\.,]|[\-](?=.)|[\.,](?=[0-9]*[\.,])/g,'').reverse();});
>

Note, the above Javascript only has an effect if the class of the input 
element is "double". By default, SQLFORM adds a "double" class to input 
elements for fields of type double, but you can override that by explicitly 
specifying an alternate widget for the field (you could create a custom 
widget, but I think a standard string widget should work in this case). So, 
in your table definition:

db.define_table('mytable', Field('myfield', 'double', 
widget=SQLFORM.widgets.string.widget))

That will give the input field a class of "string" instead of "double", so 
the above Javascript will no longer affect it.

Anthony



[web2py] Re: SQLFORM and scientific notation support.

2012-03-05 Thread Kimmo

Thank you again for your quick response!

I commented out the line and I can now submit E notation values like
"1e-06" which is excellent. After testing I noticed that if you return
to see the update form again the field will show value "1e-06.00" and
if you press submit it will produce a warning for the ".00" part. Is
there an easy way around this one also?

- Kimmo



On 5 maalis, 14:22, Massimo Di Pierro 
wrote:
> Actually I think the problem is simply the JS validator. Try comment this
> line in static/js/web2py.js
>
> doc.on('keyup', 'input.double, input.decimal',
> function(){this.value=this.value.reverse().replace(/[^0-9\-\.,]|[\-](?=.)|[\.,](?=[0-9]*[\.,])/g,'').reverse();});
>
>
>
>
>
>
>
> On Monday, 5 March 2012 05:25:39 UTC-6, Manuele wrote:
>
> > Il 05/03/2012 11:18, Kimmo ha scritto:
> > > Hi,
>
> > > I have an update SQLFORM for db record which includes double type
> > > fields. I noticed that the form does not permit values for example
> > > "1e6". Letter "e" is automatically removed when it's typed in.
> > > Behaviour is understandable but is there a way to get scientific
> > > notation support for double fields?
>
> > > One solution would be to use strings instead of double type fields but
> > > i really would like to avoid this.
>
> > maybe you need to write a custom widget...
>
> >      M.
>
> > > Best regards
> > > - Kimmo


[web2py] Re: smartgrid query on 2 or more tables

2012-03-05 Thread Roderick
Hi Johann

I'm really struggling to figure out the DAL query syntax (the
documentation I could find has minimalistic examples)...

So, can you please help me - how do I do this:
"as long as all the tables are presented in the original query"
query = ?
form = SQLFROM.grid(query,...)

I.e. I need a grid that displays all data from all 10 of my tables so
my users can run a complex query on any of them including joins?
(Note 1: I would prefer the original grid to be blank - having all
rows from all tables would be meaningless and crowded)
(Note 2: I have achieved some degree of success trying to do this from
"appadmin" but that doesn't use grids :( and I'd prefer to give my
users a cleaner interface... )

Thanks!

Roderick

On Mar 1, 8:51 am, Johann Spies  wrote:
> On 29 February 2012 16:44, Roderick  wrote:
>
> > Thanks Johann!
>
> > 1. Can this be done with smartgrid?
>
> Not in a similar way.  You can read more about that 
> inhttp://www.web2py.com/books/default/chapter/29/7?search=smartgrid#SQL...
>
> > 2. Can you give me an example of a dynamic query (e.g. what users
> > would type into the search field)? (for grid or smartgrid).
>
> Here is one built with the query button on one of my grids:
>
> akb_articles.title contains "water" and akb_articles.pubyear > "1990" and
> akb_articles.pubyear <= "2010"
>
> Experiment for yourself and explore the options.
>
> There is also a slice with examples on using SQLFORM.grid 
> athttp://www.web2pyslices.com/slices/take_slice/148
>
>  Regards
> Johann
> --
> Because experiencing your loyal love is better than life itself,
> my lips will praise you.  (Psalm 63:3)


[web2py] Re: Invalid Query invalid literal for int() with base 10: '12f'

2012-03-05 Thread Alan Etkin
How is the insertion made (with a custom form, from the appadmin
interface)?. It might be that the db stored an incompatible data
format for the model definition. If your application is providing a
form, make sure that it uses validation.

On Mar 5, 9:13 am, rinosh  wrote:
> After i insert into the table. i get that the record is inserted. But when
> i go tohttp://127.0.0.1:8000/patient_test/appadmin/select/dbi get Invalid
> Query
>
> invalid literal for int() with base 10: '12f' and no value is listed. What 
> should i do?


[web2py] Re: form.element() focus

2012-03-05 Thread Alan Etkin
I think there is not (not sure). But what if more than one field has
focus set to True?

A workaround is to set focus on document load with jQuery in a view
script:

$(document).ready(function(){$("#no_table_cocNumber").focus();});

On Mar 5, 5:49 am, Annet  wrote:
> In my init_ajax.js file I set this:
>
> jQuery("input:text:not(.date):first:visible").focus();
>
> I have a form in which I set the first field to:
>
> form.element('#no_table_name')['_readonly']=True
>
> ... therefore, in this single form, I would like to give the second
> form field the focus (the form shares its view with other forms).
>
> Is there something like:
>
> form.element('#no_table_cocNumber')['_focus']=True
>
> Kind regards,
>
> Annet


Re: [web2py] Re: web2py 1.99.5 is OUT

2012-03-05 Thread Phyo Arkar
>
> Do you experience the problem?


Yes it happens even on large JSON output (rows of table as json . about 20
MB) also , it courrpts in between (not server timeout but json at recving
get corrupted)

On Mon, Mar 5, 2012 at 6:48 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> Do you experience the problem?


[web2py] Invalid Query invalid literal for int() with base 10: '12f'

2012-03-05 Thread rinosh
After i insert into the table. i get that the record is inserted. But when 
i go to http://127.0.0.1:8000/patient_test/appadmin/select/db i get Invalid 
Query

invalid literal for int() with base 10: '12f' and no value is listed. What 
should i do?



Re: [web2py] SQLFORM and scientific notation support.

2012-03-05 Thread Massimo Di Pierro
Actually I think the problem is simply the JS validator. Try comment this 
line in static/js/web2py.js

doc.on('keyup', 'input.double, input.decimal', 
function(){this.value=this.value.reverse().replace(/[^0-9\-\.,]|[\-](?=.)|[\.,](?=[0-9]*[\.,])/g,'').reverse();});

On Monday, 5 March 2012 05:25:39 UTC-6, Manuele wrote:
>
> Il 05/03/2012 11:18, Kimmo ha scritto:
> > Hi,
> >
> > I have an update SQLFORM for db record which includes double type
> > fields. I noticed that the form does not permit values for example
> > "1e6". Letter "e" is automatically removed when it's typed in.
> > Behaviour is understandable but is there a way to get scientific
> > notation support for double fields?
> >
> > One solution would be to use strings instead of double type fields but
> > i really would like to avoid this.
>
> maybe you need to write a custom widget...
>
>  M.
>
> >
> >
> > Best regards
> > - Kimmo
>
>

Re: [web2py] Re: web2py 1.99.5 is OUT

2012-03-05 Thread Massimo Di Pierro


On Monday, 5 March 2012 04:19:07 UTC-6, Phyo Arkar wrote:
>
> Regarding download corruption and timeout on slow lines ,


the timeout can be set. There is a web2py.py command line option.
The download corruption has been reported by some but I was unable to 
reproduce (on mac and linux).
Do you experience the problem? 
 

> if i host on non-rocket http server does it fixed? (cherokee . etc).


yes
 

>
> also how about handling uploads/download seprately using another web 
> server?
>
> On Sat, Mar 3, 2012 at 12:31 PM, Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>> better to have a false positive than an un-reported bug. :-) 
>>
>>
>> On Friday, 2 March 2012 23:51:25 UTC-6, Sanjeet Kumar wrote:
>>>
>>> Sorry Massimo its my mistake it was the layout problem  
>>>
>>> On Sat, Mar 3, 2012 at 11:19 AM, Massimo Di Pierro <
>>> massimo.dipie...@gmail.com> wrote:
>>>
 How does it break it? Can you post a traceback?


 On Friday, 2 March 2012 21:28:38 UTC-6, Sanjeet Kumar wrote:
>
> In the new version 1.99.6 database administration problem are fixed 
> but it is also breaking the plugin_instant_admin backward compatibility 
> actually i am using the plugin_instant_admin in my application and when i 
> copied the application in new version and run it than 
> plugin_instant_admin 
> layout is not working.
>
> On Fri, Mar 2, 2012 at 9:35 PM, Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>> what specifically breaks?
>>
>>
>> On Friday, 2 March 2012 00:46:28 UTC-6, Sanjeet Kumar wrote:
>>>
>>> i am very excited to use the new version of web2py 1.99.5 . when i 
>>> downloaded it and use than i face the to many problems i am not be able 
>>> to 
>>> go the database administration when i click on the database 
>>> administration 
>>> it is redirecting to the site view and i also copied the my application 
>>> which i developed in the previous version it is breaking the backward 
>>> compatibility with plugin_instant_admin .
>>
>>
>
>>>
>

[web2py] Re: Trunk from GIT?

2012-03-05 Thread Tim Michelsen

Hi,


web2py was not owned my be. Now it is. I will move trunk from
mdipierro/web2py to web2py/web2py. Probably later today.
I'd be interested to know how you keep github auomatically in sync with 
your mercurial stuff.


Could you explain that?
Thanks.



Re: [web2py] SQLFORM and scientific notation support.

2012-03-05 Thread Manuele Pesenti

Il 05/03/2012 11:18, Kimmo ha scritto:

Hi,

I have an update SQLFORM for db record which includes double type
fields. I noticed that the form does not permit values for example
"1e6". Letter "e" is automatically removed when it's typed in.
Behaviour is understandable but is there a way to get scientific
notation support for double fields?

One solution would be to use strings instead of double type fields but
i really would like to avoid this.


maybe you need to write a custom widget...

M.




Best regards
- Kimmo




Re: [web2py] Use the other login page instead of index

2012-03-05 Thread Sanjeet Kumar
My problem is solved through capturing the login event

On Mon, Mar 5, 2012 at 1:48 PM, Sanjeet Kumar  wrote:

> Actually i want to go to the another function in the default controller
> when i click on the login it should be call the function such as emp()
> istead of index and after login i want to stay on the emp() only
>
>
> On Mon, Mar 5, 2012 at 1:14 PM, Bruno Rocha  wrote:
>
>> the login is by default in defautl/user/login not in index.
>>
>> you can set your own controller and function.
>>
>> Create a new controller with a function to expose dict(form=auth()) and
>> in models set:
>>
>> auth.settings.controller = "myothercontroller"
>> auth.settings.function = "myfunction"
>>
>> I am not sure if navbar will be automatically updated but you can create
>> your own links using URL("controller", "function", args="login")
>>
>>
>>
>> http://zerp.ly/rochacbruno
>> Em 05/03/2012 04:13, "Sanjeet Kumar"  escreveu:
>>
>> I am using the index as my home page and i want to call the another
>>> controller for login when the user click on the login link
>>
>>
>


Re: [web2py] Re: web2py 1.99.5 is OUT

2012-03-05 Thread Phyo Arkar
Regarding download corruption and timeout on slow lines , if i host on
non-rocket http server does it fixed? (cherokee . etc).

also how about handling uploads/download seprately using another web server?

On Sat, Mar 3, 2012 at 12:31 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> better to have a false positive than an un-reported bug. :-)
>
>
> On Friday, 2 March 2012 23:51:25 UTC-6, Sanjeet Kumar wrote:
>>
>> Sorry Massimo its my mistake it was the layout problem
>>
>> On Sat, Mar 3, 2012 at 11:19 AM, Massimo Di Pierro <
>> massimo.dipie...@gmail.com> wrote:
>>
>>> How does it break it? Can you post a traceback?
>>>
>>>
>>> On Friday, 2 March 2012 21:28:38 UTC-6, Sanjeet Kumar wrote:

 In the new version 1.99.6 database administration problem are fixed but
 it is also breaking the plugin_instant_admin backward compatibility
 actually i am using the plugin_instant_admin in my application and when i
 copied the application in new version and run it than plugin_instant_admin
 layout is not working.

 On Fri, Mar 2, 2012 at 9:35 PM, Massimo Di Pierro <
 massimo.dipie...@gmail.com> wrote:

> what specifically breaks?
>
>
> On Friday, 2 March 2012 00:46:28 UTC-6, Sanjeet Kumar wrote:
>>
>> i am very excited to use the new version of web2py 1.99.5 . when i
>> downloaded it and use than i face the to many problems i am not be able 
>> to
>> go the database administration when i click on the database 
>> administration
>> it is redirecting to the site view and i also copied the my application
>> which i developed in the previous version it is breaking the backward
>> compatibility with plugin_instant_admin .
>
>

>>


[web2py] SQLFORM and scientific notation support.

2012-03-05 Thread Kimmo

Hi,

I have an update SQLFORM for db record which includes double type
fields. I noticed that the form does not permit values for example
"1e6". Letter "e" is automatically removed when it's typed in.
Behaviour is understandable but is there a way to get scientific
notation support for double fields?

One solution would be to use strings instead of double type fields but
i really would like to avoid this.


Best regards
- Kimmo


[web2py] web2py TImeout

2012-03-05 Thread Phyo Arkar
What is default timeout for JSONRPC requests in web2py?

I set timeout to 60 seconds at qooxdoo's rpc.setTimeout() which is 10
mins but it always time out at 1.1 mins (while receiving Data) .
JSON Data goes over slow line (256kbps) But it is over 10mb of rows .


Thanks.


[web2py] Re: Trunk from GIT?

2012-03-05 Thread lyn2py
Thank you all, I looked at the VERSION file and it said "stable", so I 
thought it was the stable version.

It actually is the trunk version right?

On Monday, March 5, 2012 4:15:52 AM UTC+8, Anthony wrote:
>
> The mdipierro one looks to be the latest stable version. I was looking 
>> for the trunk version.
>
>
> The mdipierro/web2py repository on Github appears to be latest trunk, in 
> sync with the hg version on Google Code.
>
> Anthony 
>


[web2py] form.element() focus

2012-03-05 Thread Annet
In my init_ajax.js file I set this:

jQuery("input:text:not(.date):first:visible").focus();


I have a form in which I set the first field to:

form.element('#no_table_name')['_readonly']=True

... therefore, in this single form, I would like to give the second
form field the focus (the form shares its view with other forms).

Is there something like:

form.element('#no_table_cocNumber')['_focus']=True


Kind regards,

Annet


Re: [web2py] Re: web2py[:]

2012-03-05 Thread Johann Spies
+1




-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)


Re: [web2py] Use the other login page instead of index

2012-03-05 Thread Sanjeet Kumar
Actually i want to go to the another function in the default controller
when i click on the login it should be call the function such as emp()
istead of index and after login i want to stay on the emp() only

On Mon, Mar 5, 2012 at 1:14 PM, Bruno Rocha  wrote:

> the login is by default in defautl/user/login not in index.
>
> you can set your own controller and function.
>
> Create a new controller with a function to expose dict(form=auth()) and in
> models set:
>
> auth.settings.controller = "myothercontroller"
> auth.settings.function = "myfunction"
>
> I am not sure if navbar will be automatically updated but you can create
> your own links using URL("controller", "function", args="login")
>
>
>
> http://zerp.ly/rochacbruno
> Em 05/03/2012 04:13, "Sanjeet Kumar"  escreveu:
>
> I am using the index as my home page and i want to call the another
>> controller for login when the user click on the login link
>
>


Re: [web2py] Date search and smartgrid

2012-03-05 Thread Johann Spies
On 2 March 2012 19:20, Roberto Perdomo  wrote:

> Sorry,  the date search is implemented in grid and smartgrid?
>
> I Haven a table only with date fields and  this option not works
>

It works here.  Here is an example of a query built with the 'query' button:

akb_authors.birthdate > "1950-02-15"

In the model:

 Field('birthdate', 'date'),


Regards
Johann
-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)


Re: [web2py] Question about views syntax

2012-03-05 Thread Johann Spies
On 2 March 2012 18:18, davidkw  wrote:

> I've looked through the views chapter, but I'm not sure what these
> brackets [ ] are doing in this line.
>
> [ {{=A('search', _href=URL('search'))}} ]
>
> What do the brackets around the link syntax do? Thanks.
>
>
They place the url in square brackets :)

Regards
Johann

-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)