[web2py] Re: Cant make a simple database

2011-03-09 Thread pbreit
I'm so bummed I can't use the table name "order". So far I've considered 
"orders" but that would be my only plural and "purchase". Are there any other 
good names for orders. I know, this isn't world peace or anything.


Re: [web2py] Re: advanced form question

2011-03-09 Thread Manuele Pesenti

Il 09/03/2011 04:44, DenesL ha scritto:

That is called cascaded fields.
One example:http://groups.google.com/group/web2py/msg/b2d536d444001565

Use the advanced group search
http://groups.google.com/groups/advanced_search?safe=off&q=group:web2py
to find more entries with "cascaded"
(type the word in the form where it says "all these words:").

Thank you Denes,
I'll try ASAP :)

M.


[web2py] CascadingSelect class (slice 85)

2011-03-09 Thread Nik
Found this slice earlier.

My objective is to display a filtered lists of villages based on
user's previous selection. I get the error ('village') after I cloned CascadingSelect class
from slice 85[1] for use in the  tables[2]. the difference here is
that my keys are strings instead of the integer used in the original.

the common field between tables region and  province is geocode_r,
between province and town is geocode_p, between town and village is
geocode_t.

Note that table 'town' connect to it's province using the geocode_p
but uses geocode_t to connect to the villages.  (I could'n't change
the geocode structure, and I need the same codes to maintain inter-
operability.)

Do I need a "straight" link between these tables? I'm thinking that I
could work on a copy of the database then create a new field that will
make a direct reference from village to town to province to region,
and still keep the geocodes for reference but not for generating the
cascades fields.

What do you think is the error here?

[1] http://web2pyslices.com/main/slices/take_slice/85

[2]  my tables are defined as follows:

gdb.define_table('region',
Field('geocode_r', 'string', length=2, default=''),
Field('name', 'string', length=12, default=''),
format='%(name_short)s', migrate=False)

gdb.define_table('province',
Field('geocode_r', 'string', length=2, default=''),
Field('geocode_p', 'string', length=2, default=''),
Field('name', 'string', length=128, default=''),
format='%(name)s', migrate=False)

gdb.define_table('town',
Field('geocode_p', 'string', length=2, default=''),
Field('geocode_t', 'string', length=4, default='' ),
Field('name', length=128, default=''),
format='%(name)s', migrate=False)

gdb.define_table('village',
Field('geocode_t', 'string', length=4, default=''),
Field('geocode', 'string', length=9, default=''),
Field('name', 'string', length=128, default=''),
format='%(name)s', migrate=False)

#instantiate
cascade = CascadingSelect(gdb.province, gdb.town, gdb.village)



[web2py] Re: very slow pageload time (20+ secs)

2011-03-09 Thread cjrh
On Mar 9, 7:52 pm, Philip  wrote:
> Does anyone know of any common root causes of performance problems
> like that?

You are going to have to find the part that is slow.  That means some
kind of profiling or instrumenting scheme where you can gather
measurements.


[web2py] Re: greetings from PyCon

2011-03-09 Thread Anthony
I think it went very well from the audience perspective as well. Massimo's 
computer was set on Chicago time (Atlanta is an hour later), so he 
accidentally gave us our break an hour late -- but no one seemed to notice 
or care because Massimo's tour de force of web2py's capabilities was so 
engaging. Most attendees were relatively new to web2py, so Massimo had to 
spend some extra time on the basics, but folks seemed quite impressed with 
what they saw (looks like a couple of them sent out some tweets during the 
tutorial). Massimo had a prepared script, but as questions came up, he 
quickly whipped up some cool examples on the fly as well (e.g., 
demonstrating web services). Near the end, Massimo said, "Now let's do 
something more complex -- we've got 20 minutes left, so let's build a 
Facebook clone." The audience thought he was joking a chuckled, but sure 
enough, 20 minutes later we had a working Facebook clone created from 
scratch (friend relationships and wall postings). Although it ended right in 
the middle of lunch hour, most folks stayed an extra 20 minutes or so for 
some Q&A (including more impromptu coding examples by Massimo). A number of 
folks stayed even later to chat with Massimo. Overall, I think it was very 
successful. We even had Guido van Rossum drop in for a good chunk of the 
tutorial.
 
Anthony

On Wednesday, March 9, 2011 5:41:09 PM UTC-5, Massimo Di Pierro wrote:

> I am at PyCon in Atlanta. Greetings to all of you. The web2py tutorial 
> went very well (at least from my prospective) there were about 18 in 
> the room which is more than I was told would attend. 
>
> If you are in Atlanta,  see you in the lobby at 6pm and we go out for 
> dinner. 
>
> Massimo 
>
>

[web2py] Re: Cant make a simple database

2011-03-09 Thread DenesL

order is a keyword in the database,
just change the table name to orders.


On Mar 9, 10:49 pm, Jamboo  wrote:
> I tried making this simple database, and then tried the db admin panel
> and then a ticket gets generated. I tried copying the examples from
> Chapter 3 of the web2py book and I get the same type of message. I
> have the db and error herehttp://www.pastie.org/1654196
>
> 
>
> ## db.py
>
> db = DAL('sqlite://storage.sqlite')
>
> db.define_table('order',
>    Field('name'),
>    Field('address'),
>    Field('city'),
>    Field('state'),
>    Field('zipcode','integer'))
>
> db.order.name.requires=IS_NOT_EMPTY()
> db.order.address.requires=IS_NOT_EMPTY()
> db.order.city.requires=IS_NOT_EMPTY()
> db.order.state.requires=IS_NOT_EMPTY()
> db.order.zipcode.requires=IS_NOT_EMPTY()


[web2py] Cant make a simple database

2011-03-09 Thread Jamboo
I tried making this simple database, and then tried the db admin panel
and then a ticket gets generated. I tried copying the examples from
Chapter 3 of the web2py book and I get the same type of message. I
have the db and error here http://www.pastie.org/1654196



## db.py

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

db.define_table('order',
   Field('name'),
   Field('address'),
   Field('city'),
   Field('state'),
   Field('zipcode','integer'))

db.order.name.requires=IS_NOT_EMPTY()
db.order.address.requires=IS_NOT_EMPTY()
db.order.city.requires=IS_NOT_EMPTY()
db.order.state.requires=IS_NOT_EMPTY()
db.order.zipcode.requires=IS_NOT_EMPTY()


[web2py] Re: some functionality to mix html and {{python expression}} is broken since 1.92.3, even back to 1.91.6

2011-03-09 Thread dlypka
I have now reproduced the issue in a small project. So I will create
an incident and attach a zip tomorrow.

On Mar 8, 2:33 pm, dlypka  wrote:
> I will try to reduce it to a small example. From the call stack it
> looks like web2py is confused between python code and html.  It seems
> to be executing the html thinking it is python.
>
> On Mar 8, 12:57 pm, pbreit  wrote:
>
>
>
>
>
>
>
> > We cannot confirm that it is broken unless we are able to re-produce which
> > we are not. We would need a specific code example from you that does not
> > work to have any chance of fixing something that is broken.


[web2py] Re: plugin_wiki: KeyError: 'active'

2011-03-09 Thread Anthony
Yes, this error occurred during the PyCon tutorial this morning. Massimo 
used his Emacs foo to fix the problem on the spot in about 30 seconds and 
then proceeded with his example without skipping a beat. I think he's 
planning to push a fix out tonight or tomorrow.
 
Anthony

On Wednesday, March 9, 2011 9:03:29 PM UTC-5, villas wrote:

> I have already posted several messages about this issue.  Plugin_wiki 
> is broken at the moment.  Massimo has deleted the 'active' field 
> (because 'active' is a reserved word).  He may eventually replace it 
> with another field named 'activated' or similar. 
>
>
> On Mar 10, 1:16 am, LotS  wrote: 
> > I use the source version of web2py: Version 1.93.2 (2011-03-04 
> > 23:48:59) 
> > on Windows XP. 
> > 
> > I managed to install plugin_wiki. 
> > 
> > After I signed in with an authenticated user id, the "Pages" on the 
> > menu will be shown. 
> > Click on it and I can access to the /plugin_wiki/index 
> > 
> > After I created a meta-menu page, and try to access  /plugin_wiki/ 
> > index again.  I hit into an error as follow, 
> > 
> >  
> > Traceback (most recent call last): 
> >   File "C:\web2py\gluon\restricted.py", line 188, in restricted 
> > exec ccode in environment 
> >   File "C:\web2py\applications\myapp2/views\plugin_wiki/index.html", 
> > line 113, in  
> >   File "C:\web2py\gluon\dal.py", line 3347, in __getattr__ 
> > return self[key] 
> >   File "C:\web2py\gluon\dal.py", line 3338, in __getitem__ 
> > return dict.__getitem__(self, key) 
> > KeyError: 'active' 
> >  
> > 
> > But I still can point my browser directly to "http://127.0.0.1:8000/ 
> > myapp2/plugin_wiki/page/meta-menu" and the rest of the pages works as 
> > normal. 
> > 
> > Hope someone can help.



[web2py] Re: [tip] Head JS script loader

2011-03-09 Thread Carlos
Hi Bruno,

How does HeadJs compare with RequireJs and LabJs?.

http://requirejs.org/

http://labjs.com/

Thanks,

   Carlos



[web2py] Re: ('active') when running plugin_wiki

2011-03-09 Thread villas
Yes, plugin_wiki is broken because the field active was deleted. I
already reported this and I hope Massimo will fix it soon.

On Mar 9, 11:24 pm, mat --  wrote:
> Hi
>
> I downloaded latest version of Web2py and plugin_wiki.
>
> I setup Janrain. I can login.
>
> I created a new app and uploaded plugin_wiki as a plugin.
>
> I can create a first page and save it using plugin_wiki features.
>
> But second time I click the "Page" tab i get the following error:
>
> Version
>  web2py™ Version 1.93.2 (2011-03-06 10:18:04)  Python Python 2.6.6:
> /usr/bin/python
> Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
>
> Traceback (most recent call last):
>   File "/home/linux/Dev/web2py/gluon/restricted.py", line 188, in restricted
>     exec ccode in environment
>   File 
> "/home/linux/Dev/web2py/applications/Docs/views/plugin_wiki/index.html",
> line 113, in 
>   File "/home/linux/Dev/web2py/gluon/dal.py", line 3347, in __getattr__
>     return self[key]
>   File "/home/linux/Dev/web2py/gluon/dal.py", line 3338, in __getitem__
>     return dict.__getitem__(self, key)
> KeyError: 'active'
>
> Error snapshot [image: help] Detailed traceback description
>
> ('active')
>
> Anyone knows what is the issue here?
>
> Thanks!
>
> Mat


[web2py] [tip] Head JS script loader

2011-03-09 Thread Bruno Rocha
  Head JS script loader

With Head JS your scripts load like images - completely separated from the
page rendering process. The page is ready sooner. Always. This is guaranteed
even with a single combined JavaScript file. See it yourself:

Sample page with 5 SCRIPT SRC tags 

Same scripts loaded with Head JS 

Non-blocking loading is the key to fast pages. Moreover Head JS loads
scripts in *parallel* no matter how many of them and what the browser is.
The speed difference can be dramatic especially on the initial page load
when the scripts are not yet in cache. It's your crucial first impression.

Pages no longer "hang" and there is less or zero "flashing" between pages.
User only cares when the page is ready. Unfortunately current networking
tools don't highlight this crucial point. They focus on the overall loading
of assets instead.

Head JS can make your pages load 100% or even 400% faster. It can make the
largest impact on client side optimization.


http://headjs.com/
--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]


[web2py] Re: plugin_wiki: KeyError: 'active'

2011-03-09 Thread villas
I have already posted several messages about this issue.  Plugin_wiki
is broken at the moment.  Massimo has deleted the 'active' field
(because 'active' is a reserved word).  He may eventually replace it
with another field named 'activated' or similar.


On Mar 10, 1:16 am, LotS  wrote:
> I use the source version of web2py: Version 1.93.2 (2011-03-04
> 23:48:59)
> on Windows XP.
>
> I managed to install plugin_wiki.
>
> After I signed in with an authenticated user id, the "Pages" on the
> menu will be shown.
> Click on it and I can access to the /plugin_wiki/index
>
> After I created a meta-menu page, and try to access  /plugin_wiki/
> index again.  I hit into an error as follow,
>
> 
> Traceback (most recent call last):
>   File "C:\web2py\gluon\restricted.py", line 188, in restricted
>     exec ccode in environment
>   File "C:\web2py\applications\myapp2/views\plugin_wiki/index.html",
> line 113, in 
>   File "C:\web2py\gluon\dal.py", line 3347, in __getattr__
>     return self[key]
>   File "C:\web2py\gluon\dal.py", line 3338, in __getitem__
>     return dict.__getitem__(self, key)
> KeyError: 'active'
> 
>
> But I still can point my browser directly to "http://127.0.0.1:8000/
> myapp2/plugin_wiki/page/meta-menu" and the rest of the pages works as
> normal.
>
> Hope someone can help.


[web2py] filtering selection list

2011-03-09 Thread Nik
i need to validate a field based on an external read-only database (i
call it gdb)

there are four tables that are related by their own codes
gdb.r_table.code
gdb.p_table.code
gdb.t_table.code
gdb.v_table.code

I have no use for the the id field of each table. Each table has,
among others:
r_table.code is unique but r_table.name may not be so.
p_table.code is unique but p_table.name may not be.
t_table.code is uniquely composed of r_table.code + p_table.code.
t_table.name may not be unique.
v_table-code is uniquely composed of t.table-code+serial numbers
v_table.name may not be unique.

In my app database, I only need to store the v_table-code since I can
programatically find out what the other codes are from it. But for the
convenience of the user (who is probably unaware of the codes), I need
to present a selection list of v_table.names based on choices they
made from p_table.name and t_table.name. There are 100 records in
p_table, 1,500 in t_table and 40,000 in v_table.

What's the best way to do this?

I thought that I could populate a variable with the list of each
p_list = gdb(gdb.select(gdb.p_table.code, gdb.p_table_name))
t_list = gdb(gdb.select(gdb.t_table.code, gdb.t_table_name))
v_list = gdb(gdb.select(gdb.v_table.code, gdb.v_table_name)) # prolly
not a good idea to retrieve all 40,000 but 

then in the requires argument of each field
form = SQLFORM.factory(
# snip. other fields here

Field('p', requires = [IS_NOT_EMPTY(), IS_IN_SET(p_list)), # this
works
Field('t', requires = [IS_NOT_EMPTY(), IS_IN_SET(t_list)), # how to
trigger controller to present a sublist of t_list
Field('v', requires = [IS_NOT_EMPTY(), IS_IN_SET(v_list)) # how to
trigger controller to present a sublist of v_list

# snip. other fields here)

Above works but no validation is enforced. (i.e. a user can select a
'v' that is not actually a member of his/her 't' selection)
How can i trigger a controller that will filter t_list based on
selection made on 'p' field, and another controller to do the same for
v_list based on 'T' selection from t_list.

thanks.


[web2py] Re: plugin_wiki: KeyError: 'active'

2011-03-09 Thread pbreit
One thing that looks odd to men is the mixed slashes in the file path:
C:\web2py\applications\myapp2/views\plugin_wiki/index.html

Is that how it works on Windows?


[web2py] Re: plugin_wiki: KeyError: 'active'

2011-03-09 Thread pbreit
Looks like the same issue:
https://groups.google.com/d/topic/web2py/eCaXXPR67CM/discussion

I unfortunately don't know much about plugin_wiki but with 2 people now 
experiencing the problem good chance of a bug.


[web2py] plugin_wiki: KeyError: 'active'

2011-03-09 Thread LotS
I use the source version of web2py: Version 1.93.2 (2011-03-04
23:48:59)
on Windows XP.

I managed to install plugin_wiki.

After I signed in with an authenticated user id, the "Pages" on the
menu will be shown.
Click on it and I can access to the /plugin_wiki/index

After I created a meta-menu page, and try to access  /plugin_wiki/
index again.  I hit into an error as follow,


Traceback (most recent call last):
  File "C:\web2py\gluon\restricted.py", line 188, in restricted
exec ccode in environment
  File "C:\web2py\applications\myapp2/views\plugin_wiki/index.html",
line 113, in 
  File "C:\web2py\gluon\dal.py", line 3347, in __getattr__
return self[key]
  File "C:\web2py\gluon\dal.py", line 3338, in __getitem__
return dict.__getitem__(self, key)
KeyError: 'active'


But I still can point my browser directly to "http://127.0.0.1:8000/
myapp2/plugin_wiki/page/meta-menu" and the rest of the pages works as
normal.

Hope someone can help.


[web2py] Lacking nginx deployment guide

2011-03-09 Thread minux
Hi folks,

As a newbie to the fabulous framework, I am a bit put off when I
reached to the end of the web2py chapter about deployment and (as it
happened to me with Django before) I saw no receipt to deploy on
nginx, which is my favorite web server.

I searched around but could not find any complete tutorial, while
there are few scattered blog notes here and there.

As I am going to deploy on a tiny VPS, I am reluctant to use  apache
recepit (to save memory). Also  lighthttpd, does not seem to be the
best candidate, as it is discontinued and (apparently) memory
leaking.

So I left with Cherokee. However I did not like the idea of a GUI
config interface, I tried the official book's receipt as the last
resort. For some reason, I ended up with a " nohup: ignoring input and
appending output to `nohup.out'".

Cutting the long story short, I really appreciate it if someone could
point me to a complete guide for nginx deployment, or writhe one :)

cheers



[web2py] PyCon-web2py

2011-03-09 Thread Ovidio Marinho
No primeiro dia web2py eh o primeiro tutorial do evento

On the first day eh web2py the first tutorial of the event


http://us.pycon.org/2011/schedule/tutorials/
-- 
Ovidio Marinho Falcao Neto
 ovidio...@gmail.com
 Tecnologia da Informaçao
 Casa Civil do Governador
 83 3214 7885 - 88269088
  Paraiba


[web2py] Re: Cron not running/starting on windows

2011-03-09 Thread Brian M
I don't think cron works when running as a Windows service - at least it 
didn't in the past 
https://groups.google.com/forum/#!searchin/web2py/windows$20cron/web2py/OX7pXEGlSGM/hkspXZWKV1gJ

I ended up just using a scheduled task that used wget to fetch certain 
controllers I wanted to run regularily.


Re: [web2py] Dotcloud hosting great tutorial but stuck

2011-03-09 Thread Jonathan Lundell
On Mar 9, 2011, at 3:49 PM, stargate wrote:
> 
> I am following the following tutorial for web2py deployment
> 
> http://docs.dotcloud.com/static/tutorials/web2py/
> 
> the problem i am stuck at is when i try to run the following command

What exactly do you mean by "stuck"?

> 
> web2py$ ln -s wsgihandler.py wsgi.py
> 
> I am doing this from macos Terminal
> 
> Thanks for any help




[web2py] Re: Dotcloud hosting great tutorial but stuck

2011-03-09 Thread pbreit
That command is going to create an alias on your Mac that when will go along 
with the rest of your files when you do the "dotcloud push". You can see the 
alias if you type this into your terminal: ls -al

[web2py] Re: Dotcloud hosting great tutorial but stuck

2011-03-09 Thread ron_m
That is a symlink creation so the assumption if using that command is 
wsgihandler.py exists in the current directory and you are creating a 
symbolic link named wsgi.py which points to wsgihandler.py.

If you use ls while logged in on the server do you see wsgihandler.py, run 
the ls command. If not then you need to be in the web2py install directory

$ ls -l wsgihandler.py

should show you the file. The ln command is a standard UNIX command. Do you 
get an error message?


[web2py] Dotcloud hosting great tutorial but stuck

2011-03-09 Thread stargate
I am following the following tutorial for web2py deployment

http://docs.dotcloud.com/static/tutorials/web2py/

the problem i am stuck at is when i try to run the following command

web2py$ ln -s wsgihandler.py wsgi.py

I am doing this from macos Terminal

Thanks for any help


[web2py] ('active') when running plugin_wiki

2011-03-09 Thread mat --
Hi

I downloaded latest version of Web2py and plugin_wiki.

I setup Janrain. I can login.

I created a new app and uploaded plugin_wiki as a plugin.

I can create a first page and save it using plugin_wiki features.

But second time I click the "Page" tab i get the following error:

Version
 web2py™ Version 1.93.2 (2011-03-06 10:18:04)  Python Python 2.6.6:
/usr/bin/python
Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.

Traceback (most recent call last):
  File "/home/linux/Dev/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
  File "/home/linux/Dev/web2py/applications/Docs/views/plugin_wiki/index.html",
line 113, in 
  File "/home/linux/Dev/web2py/gluon/dal.py", line 3347, in __getattr__
return self[key]
  File "/home/linux/Dev/web2py/gluon/dal.py", line 3338, in __getitem__
return dict.__getitem__(self, key)
KeyError: 'active'

Error snapshot [image: help] Detailed traceback description

('active')


Anyone knows what is the issue here?

Thanks!

Mat


[web2py] Re: conditionally include in view

2011-03-09 Thread ron_m
I use this in a portion of the views coded for what I am working on and it 
works for me. I just ran the page with the test true and again with the test 
false and I get the include file content inside the {{if condition:}} branch 
if the condition is True and the html in the {{else:} branch if the 
condition is False. I verified with a View Source in the browser, the code 
from the include file is not there when the condition is False. I am on 
1.93.2 but this has been consistent for several months now.

Here is a chunk of code

{{site_names =  session.user_access['site_names']}}
{{if len(site_names) > 1:}}
{{include 'common/site_switcher.html'}}

{{else:}}
{{=B(header)}}
{{pass}}
{{include 'live/display_mode_switcher.html'}}


I think the include is indeed expanded out unconditionally but when the 
Python logic runs the response.write is not executed for that portion of the 
code if condition is False.

Replace someData in your example with True and then with False and refresh 
the page to see what you get in each case. The truthness or falseness of a 
variable can be deceiving. Also the include file name should be the path 
portion past views.


[web2py] Re: No login possible in Firefox, but in chrome

2011-03-09 Thread ron_m
The symptoms look exactly like a user I had a problem with logging into my 
application but for them cookies were disabled, re-enabling cookies fixed 
it.

Firefox cookie settings are a little obscure, here is a web reference

http://support.mozilla.com/en-US/kb/Websites%20say%20cookies%20are%20blocked

there are 2 flags, accept and accept third party cookies.

You say you have cookies enabled but I run the same configuration as you and 
have no trouble logging in on my applications. The fact that it works in 
Chrome would indicate to me that your application is in working order for 
the most part. Are there any Javascript errors reported?


Re: [web2py] greetings from PyCon

2011-03-09 Thread Ovidio Marinho
After what happened to publish it with web2py

2011/3/9 Massimo Di Pierro 

> I am at PyCon in Atlanta. Greetings to all of you. The web2py tutorial
> went very well (at least from my prospective) there were about 18 in
> the room which is more than I was told would attend.
>
> If you are in Atlanta,  see you in the lobby at 6pm and we go out for
> dinner.
>
> Massimo
>
>


-- 
Ovidio Marinho Falcao Neto
 ovidio...@gmail.com
 Tecnologia da Informaçao
 Casa Civil do Governador
 83 3214 7885 - 88269088
  Paraiba


[web2py] greetings from PyCon

2011-03-09 Thread Massimo Di Pierro
I am at PyCon in Atlanta. Greetings to all of you. The web2py tutorial
went very well (at least from my prospective) there were about 18 in
the room which is more than I was told would attend.

If you are in Atlanta,  see you in the lobby at 6pm and we go out for
dinner.

Massimo



[web2py] Re: conditionally include in view

2011-03-09 Thread Massimo Di Pierro
Include is executed whether or not the condition is true. It is not
python code therefore it is executed before the python code is
executed.
It is not a good idea to put the include in a condition.

On Mar 9, 12:24 pm, m t  wrote:
> Hi,
>
> I have such code:
> {{if someData:}}
>      {{include 'additional.html'}}
> {{pass}}
>
> problem is that even when 'someData' is NOT true - file
> 'additional.html' is included.
>
> Is there some trick to select on view level which includes shall be
> loaded?


[web2py] Re: problem with type Int

2011-03-09 Thread Massimo Di Pierro
Can I see more of the code without ...

On Mar 9, 3:17 pm, LightOfMooN  wrote:
> value=request.vars.myvar
>
> try:
>     value = int(value)
> except:
>     pass
>
> if type(value)==int:
>     insert()
>
> it rises
> (current transaction is aborted,
> commands ignored until end of transaction block)
> even if value > 2147483647
>
> But why?
> It's so strange, because type(value) must be long.


[web2py] Re: character special in DAL

2011-03-09 Thread Massimo Di Pierro
you cannot. You can have a field.label with the id but not in the
field name.

On Mar 9, 6:51 am, cabildocl  wrote:
> I need create a field in DAL, what include a character special "-".
> How i can do this?
>
> Greetings


[web2py] Re: 1.93.2 broken update_record!

2011-03-09 Thread Massimo Di Pierro
This should not cause corpupted data in the database, anyway, expect a
new stable web2py tomorrow since this is fixed in trunk.

On Mar 8, 7:08 pm, Clayton  wrote:
> Please note that this bug silently causes corrupt data to be written
> to the database! Please, please release an update pronto...
>
> Clayton
>
> On Mar 8, 2:41 pm, Vasile Ermicioi  wrote:
>
>
>
>
>
>
>
> > I think web2py needs regression tests, at least for core functionality


[web2py] Re: DAL tutorial video

2011-03-09 Thread mikech
I posted the link in Dzone so vote up if you can.  Any search on Web2py 
should bring it up.
re: the text of the session, I would like this too.


[web2py] Re: very slow pageload time (20+ secs)

2011-03-09 Thread howesc
I agree with villas - *but* check for those renegade queries in your models. 
 once upon a time i tried loading config options and other data in db.py so 
they would be globally available as lookups without querying the DB each 
time.  it worked like a champ, until i got lots of data, then it was 
horrible.

so my guess is that there is something in your models takes a long time to 
execute as the amount of data increases.

good luck!

christian


[web2py] Re: redirection to /default/user/profile

2011-03-09 Thread DenesL
plus the decoration of index:
@auth.requires_login()

On Mar 9, 11:04 am, Jonathan Lundell  wrote:
> On Mar 9, 2011, at 5:00 AM, DenesL wrote:
>
>
>
> > I did use -I but it did not show any redirects.
> > Anyway, I still don't know why it gets redirected to profile when it
> > is not properly defined.
>
> What was the minimum you needed to do to get the redirection? Just the 
> double-form version of user?


[web2py] conditionally include in view

2011-03-09 Thread m t
Hi,

I have such code:
{{if someData:}}
 {{include 'additional.html'}}
{{pass}}

problem is that even when 'someData' is NOT true - file
'additional.html' is included.

Is there some trick to select on view level which includes shall be
loaded?


[web2py] problem with type Int

2011-03-09 Thread LightOfMooN
value=request.vars.myvar

try:
value = int(value)
except:
pass

if type(value)==int:
insert()

it rises
(current transaction is aborted,
commands ignored until end of transaction block)
even if value > 2147483647

But why?
It's so strange, because type(value) must be long.


[web2py] Re: Cron not running/starting on windows

2011-03-09 Thread pbreit
Do you know if the script runs without error? What I do sometimes is put the 
script into controller.py and try to run it from there. My only guess at 
this point is perhaps there might be a permission problem writing to the 
"cron" directory.

In your Windows Task Manager can you see that multiple python processes are 
running? To make absolutely certain, you might want to kill all of the 
python processes (or restart Windows) and then watch your Task Manager as 
web2py starts up.


[web2py] Re: very slow pageload time (20+ secs)

2011-03-09 Thread Philip
Would that impact appadmin?  Just going to app/appadmin/index takes
15-20 seconds, and viewing a table in the admin interface takes almost
30 seconds, even for a table of only 50 rows.  It seems that something
is bogging down the whole thing, not specific functions or
controllers.
Since database size was the only change, I'm assuming it was the root
cause, yet I can't figure out why a larger database would cause a
slowdown for the whole application.  It would make sense to me if the
controllers that were hitting large tables or doing joins were slow,
but I am confused as to why everything across the board would be so
slow.

Thanks for any help.

On Mar 9, 1:43 pm, villas  wrote:
> Somewhere in your code you are probably fetching all the rows.
> Look at all your queries and see whether you can paginate results
> somehow (using limitby).
> Look at IS_IN_DB validators etc which create drop down boxes and
> consider using sub-sets of data to populate them,  or replace with
> autocomplete.
>
> Without seeing any code,  it is difficult to be specific.
>
> Regards, D
>
> On Mar 9, 5:52 pm, Philip  wrote:
>
>
>
>
>
>
>
> > I am having an issue with an application.  Page load times are 20+
> > seconds.  This is true for all pages, even in admin functions (as soon
> > you select the application in question).  It appears to be a database
> > problem, since the problem appeared after adding about 15,000 records
> > to an application that was working well with far fewer (probably
> > ~2000).  I am using sqlite as the backend and running an internal
> > application on a windows server that is also used as a fileshare.  The
> > applications has 8 tables, 4 of 5 which have over 2000 records, the
> > largest is about 6000 records.  The tables are quite small, so the
> > total db.db file size is still just over 1MB (worked great when it was
> > only 250kB), despite the number of records.  Problem occurs both when
> > running locally installed on my machine or over the network to the
> > server-hosted version.  In both cases, only one user was using the
> > application.
>
> > I have tried migrate=false and compiling the app as the web2py book
> > suggests - no noticable improvement.
>
> > Looking online for performance and scalability of sqlite, it seems
> > that I am still well under any size that would cause an sqlite
> > performance issue.
>
> > Does anyone know of any common root causes of performance problems
> > like that?
>
> > Thanks


[web2py] Re: very slow pageload time (20+ secs)

2011-03-09 Thread villas
Somewhere in your code you are probably fetching all the rows.
Look at all your queries and see whether you can paginate results
somehow (using limitby).
Look at IS_IN_DB validators etc which create drop down boxes and
consider using sub-sets of data to populate them,  or replace with
autocomplete.

Without seeing any code,  it is difficult to be specific.

Regards, D

On Mar 9, 5:52 pm, Philip  wrote:
> I am having an issue with an application.  Page load times are 20+
> seconds.  This is true for all pages, even in admin functions (as soon
> you select the application in question).  It appears to be a database
> problem, since the problem appeared after adding about 15,000 records
> to an application that was working well with far fewer (probably
> ~2000).  I am using sqlite as the backend and running an internal
> application on a windows server that is also used as a fileshare.  The
> applications has 8 tables, 4 of 5 which have over 2000 records, the
> largest is about 6000 records.  The tables are quite small, so the
> total db.db file size is still just over 1MB (worked great when it was
> only 250kB), despite the number of records.  Problem occurs both when
> running locally installed on my machine or over the network to the
> server-hosted version.  In both cases, only one user was using the
> application.
>
> I have tried migrate=false and compiling the app as the web2py book
> suggests - no noticable improvement.
>
> Looking online for performance and scalability of sqlite, it seems
> that I am still well under any size that would cause an sqlite
> performance issue.
>
> Does anyone know of any common root causes of performance problems
> like that?
>
> Thanks


[web2py] Re: No login possible in Firefox, but in chrome

2011-03-09 Thread pbreit
Have you customized your login at all? Can you think of any edits you have 
made to your app that could impact login/register? CSS files? JavaScript 
files? Auth settings? Does it seem like the form does not even submit? Do 
you have the file web2py_ajax.html in your app folder?

[web2py] very slow pageload time (20+ secs)

2011-03-09 Thread Philip
I am having an issue with an application.  Page load times are 20+
seconds.  This is true for all pages, even in admin functions (as soon
you select the application in question).  It appears to be a database
problem, since the problem appeared after adding about 15,000 records
to an application that was working well with far fewer (probably
~2000).  I am using sqlite as the backend and running an internal
application on a windows server that is also used as a fileshare.  The
applications has 8 tables, 4 of 5 which have over 2000 records, the
largest is about 6000 records.  The tables are quite small, so the
total db.db file size is still just over 1MB (worked great when it was
only 250kB), despite the number of records.  Problem occurs both when
running locally installed on my machine or over the network to the
server-hosted version.  In both cases, only one user was using the
application.

I have tried migrate=false and compiling the app as the web2py book
suggests - no noticable improvement.

Looking online for performance and scalability of sqlite, it seems
that I am still well under any size that would cause an sqlite
performance issue.

Does anyone know of any common root causes of performance problems
like that?

Thanks


[web2py] Re: From and action disambiguation

2011-03-09 Thread StUStD
SOLVED: the magic formname in:

 if form.accepts(request.vars, formname=):
  ...

with different formname for both forms solved the problem.

Thanks for the wonderful web2py!


On Mar 9, 5:06 pm, StUStD  wrote:
> I have two selection forms in one html page (see below), each with two
> submit buttons, one to "update" a selected database item, and another
> to select the item (i.e. store it in a session database) -- the code
> for "multiple submit buttons" in one form was found in a web2py
> thread. The first form works fine, but the second form after
> submission (select or update) is processed by the action(s) of the
> first form... I guess it probably has to do with the same "action"
> name used in both forms, but I don't know whether it's related to the
> _name, _id or "this.form..value" aspect, or to a combination
> of these... Help appreciated! Thanks.
>
> def process_A():
>     """
>     Single form for A objects with multiple submit buttons (update and
> select)
>     that trigger one submit function with different parameters
>     """
>     o = < options list for A objects >
>
>     form=FORM(SELECT(*o, _name="aid"),
>
> INPUT(_type='hidden',_name='action',_id='action',_value='undefined'),
>
> INPUT(_type='button',_value='Update',_onclick='''this.form.action.value="1"­;this.form.submit();''',),
>               A("  "),
>
> INPUT(_type='button',_value='Select',_onclick='''this.form.action.value="2"­;this.form.submit();''',),)
>
>     if form.accepts(request.vars):
>         if request.vars.action=='1':
>             < update an A obj >
>         elif request.vars.action=='2':
>             < select an A obj >
>             redirect(URL('index'))
>         else:
>             raise Exception("Invalid action")
>     #
>     return form
>
> def process_B():
>     """
>     Single form for B objects with multiple submit buttons (update and
> select) that trigger one submit function
>     with different parameters.
>     """
>     o = < options list for B objects >
>
>     form=FORM(SELECT(*o, _name="bid"),
>
> INPUT(_type='hidden',_name='action',_id='action',_value='undefined'),
>
> INPUT(_type='button',_value='Update',_onclick='''this.form.action.value="1"­;this.form.submit();''',),
>               A("  "),
>
> INPUT(_type='button',_value='Select',_onclick='''this.form.action.value="2"­;this.form.submit();''',),)
>
>     if form.accepts(request.vars):
>         if request.vars.action=='1':
>             < update a B obj >
>         elif request.vars.action=='2':
>             < select a B obj >
>             redirect(URL('index'))
>         else:
>             raise Exception("Invalid action")
>     #
>     return form


Re: [web2py] routes on GAE

2011-03-09 Thread howesc
+1 for app.example.yaml  if it weren't for source control i would have been 
SOL a crap-ton of times. :)

[web2py] Re: python tutorial video

2011-03-09 Thread stefaan

> It is a tool I am working out, trying to automate my teaching job.

I seem to remember you mentioned using some mac os program "Say" to
generate the speech.
If it could be replaced with e.g. the text-to-speech as offered by
google on their translate.google.com page,
it 'd become cross-platform and multi-lingual... (apparently someone
even made a python module for that: gtexttospeech - disclaimer: I
haven't tried it out.)

I think declaratively generating screencasts is a seriously cool idea,
a bit like the screencast equivalent of
"slide generation via LaTeX".


Re: [web2py] Re: python tutorial video

2011-03-09 Thread David J.
No it not ok: I dont think that will be Massimo's intention; When he 
releases the update it will kept a BIG secret and he will not notify 
anyone; as he usually does!


Only kidding; you will be the first to know!



On 3/9/11 11:42 AM, Vinicius Assef wrote:

Let us know when new version will be available, ok?


On Wed, Mar 9, 2011 at 9:43 AM, Massimo Di Pierro
  wrote:

will fix typos, change music and redo it.

On Mar 8, 4:10 pm, Stefaan Himpe  wrote:

   My suggestion ->Konstantin Scherbakov, maybe


Liszt's transcriptions of Beethoven symphonies for the Piano

His Lyapunov etudes are well worth listening to as well :)




Re: [web2py] Re: python tutorial video

2011-03-09 Thread Vinicius Assef
Let us know when new version will be available, ok?


On Wed, Mar 9, 2011 at 9:43 AM, Massimo Di Pierro
 wrote:
> will fix typos, change music and redo it.
>
> On Mar 8, 4:10 pm, Stefaan Himpe  wrote:
>>   My suggestion ->  Konstantin Scherbakov, maybe
>>
>> >> Liszt's transcriptions of Beethoven symphonies for the Piano
>>
>> His Lyapunov etudes are well worth listening to as well :)


[web2py] From and action disambiguation

2011-03-09 Thread StUStD
I have two selection forms in one html page (see below), each with two
submit buttons, one to "update" a selected database item, and another
to select the item (i.e. store it in a session database) -- the code
for "multiple submit buttons" in one form was found in a web2py
thread. The first form works fine, but the second form after
submission (select or update) is processed by the action(s) of the
first form... I guess it probably has to do with the same "action"
name used in both forms, but I don't know whether it's related to the
_name, _id or "this.form..value" aspect, or to a combination
of these... Help appreciated! Thanks.

def process_A():
"""
Single form for A objects with multiple submit buttons (update and
select)
that trigger one submit function with different parameters
"""
o = < options list for A objects >

form=FORM(SELECT(*o, _name="aid"),
 
INPUT(_type='hidden',_name='action',_id='action',_value='undefined'),
 
INPUT(_type='button',_value='Update',_onclick='''this.form.action.value="1";this.form.submit();''',),
  A("  "),
 
INPUT(_type='button',_value='Select',_onclick='''this.form.action.value="2";this.form.submit();''',),)

if form.accepts(request.vars):
if request.vars.action=='1':
< update an A obj >
elif request.vars.action=='2':
< select an A obj >
redirect(URL('index'))
else:
raise Exception("Invalid action")
#
return form

def process_B():
"""
Single form for B objects with multiple submit buttons (update and
select) that trigger one submit function
with different parameters.
"""
o = < options list for B objects >

form=FORM(SELECT(*o, _name="bid"),
 
INPUT(_type='hidden',_name='action',_id='action',_value='undefined'),
 
INPUT(_type='button',_value='Update',_onclick='''this.form.action.value="1";this.form.submit();''',),
  A("  "),
 
INPUT(_type='button',_value='Select',_onclick='''this.form.action.value="2";this.form.submit();''',),)

if form.accepts(request.vars):
if request.vars.action=='1':
< update a B obj >
elif request.vars.action=='2':
< select a B obj >
redirect(URL('index'))
else:
raise Exception("Invalid action")
#
return form


Re: [web2py] Re: redirection to /default/user/profile

2011-03-09 Thread Jonathan Lundell
On Mar 9, 2011, at 5:00 AM, DenesL wrote:
> 
> I did use -I but it did not show any redirects.
> Anyway, I still don't know why it gets redirected to profile when it
> is not properly defined.

What was the minimum you needed to do to get the redirection? Just the 
double-form version of user?

[web2py] Re: Multiple form flash problem.

2011-03-09 Thread villas
Glad to help and sounds like an interesting project.

> I am building this web application for a psychologist
> and he insisted on implementing it this way for
> cognitive ergonomic reasons.

Hmm, I thought 'cognitive ergonomic reasons' was just an excuse for
lying on the couch!

:-) D


[web2py] Re: about SQLFORM

2011-03-09 Thread DenesL
Can you show us your current code?.

On Mar 9, 9:03 am, cyber  wrote:
> Hi
>
> How can I update new (just created) record in the table?
> Table consists of several fields but in the form page user have to
> enter only one value for one row.
> So, I need insert in the current row not only this value but user name
> and datetime.
> I can insert first value but I have no idea of how to auto update new
> row with required values.
>
> Any ideas?


[web2py] character special in DAL

2011-03-09 Thread cabildocl
I need create a field in DAL, what include a character special "-".
How i can do this?

Greetings


[web2py] about SQLFORM

2011-03-09 Thread cyber
Hi

How can I update new (just created) record in the table?
Table consists of several fields but in the form page user have to
enter only one value for one row.
So, I need insert in the current row not only this value but user name
and datetime.
I can insert first value but I have no idea of how to auto update new
row with required values.

Any ideas?


[web2py] Re: redirection to /default/user/profile

2011-03-09 Thread DenesL

I did use -I but it did not show any redirects.
Anyway, I still don't know why it gets redirected to profile when it
is not properly defined.


On Mar 8, 5:25 pm, Jonathan Lundell  wrote:
> On Mar 8, 2011, at 2:20 PM, Jonathan Lundell wrote:
>
>
>
> > On Mar 8, 2011, at 2:00 PM, DenesL wrote:
>
> >> I mean curl --trace-ascii
>
> >> On Mar 8, 4:37 pm, DenesL  wrote:
> >>> On Mar 8, 1:06 pm, Jonathan Lundell  wrote:
>
>  Try making the requests with curl -I and see if there's a chain of 
>  redirects that might offer a clue.
>
> >>> Maybe you meant curl -1 (minus one),
> >>> using this option I get the default layout with the two forms, no
> >>> redirection (?).
>
> > Just curl -I should show you any redirects. If curl is following the 
> > redirects (I don't think it does by default) you can use --max-redirs 1.
>
> For example, I have the stock welcome app deployed at GAE. Here's a sample 
> curl request that results in a redirect:
>
> ~ $ curl -Ihttp://jkl-web2py-welcome.appspot.com/welcome/default/user
> HTTP/1.1 303 See Other
> Set-Cookie: session_id_welcome="3002:826f594f-996f-4e22-9026-81b62e34ff57"; 
> Path=/
> Content-Type: text/html; charset=UTF-8
> Location: /welcome/default/user/login
> Date: Tue, 08 Mar 2011 22:22:38 GMT
> Server: Google Frontend
> Cache-Control: private, x-gzip-ok=""
> Transfer-Encoding: chunked
>
> Notice that curl doesn't follow the redirect; I think you have to use 
> --location for that to happen.


[web2py] Re: Update_record and validator conflict.

2011-03-09 Thread DenesL

Or better yet, store the validator object in a variable and use that:

isnotindb=IS_NOT_IN_DB(...)
db.company.CoC_number.requires=isnotindb

and in the action:

isnotindb.set_self_id(company[0].id)

then it does not matter if the field uses more validators, since you
could for example do:

db.company.CoC_number.requires=[IS_NOT_EMPTY(),isnotindb]

and the statement with set_self_id would still work.


On Mar 9, 5:35 am, DenesL  wrote:
> Hi Annet,
>
> the requires for the field is now a list of validators for some
> reason.
> You have to use the set_self_id only on the IS_NOT_IN_DB portion of
> the requires.
>
> Did you change the requires?.
> If not, then it is probably just a one member list so you can do
>
> db.company.CoC_number.requires[0].set_self_id(company[0].id)
>
> On Mar 9, 4:03 am, annet  wrote:
>
> > Hi Denes,
>
> > Thanks for your reply. I tried:
>
> > >           # this is undocumented
> > >           db.company.CoC_number.requires.set_self_id(company[0].id)
>
> > > >         form.vars.name=company[0].name
> > > >         form.vars.CoC_number=company[0].CoC_number
> > > >         form.vars.subdossiernumber=company[0].subdossiernumber
> > > >         ...
> > > >         if form.accepts(request.vars,session):
>
> > ... and got this error ticket:
>
> > Traceback (most recent call last):
> >   File "/Library/Python/2.5/site-packages/web2py_1.87.3/gluon/
> > restricted.py", line 188, in restricted
> >     exec ccode in environment
> >   File "/Library/Python/2.5/site-packages/web2py_1.87.3/applications/
> > cms/controllers/myadmin.py", line 262, in 
> >   File "/Library/Python/2.5/site-packages/web2py_1.87.3/gluon/
> > globals.py", line 96, in 
> >     self._caller = lambda f: f()
> >   File "/Library/Python/2.5/site-packages/web2py_1.87.3/gluon/
> > tools.py", line 2237, in f
> >     return action(*a, **b)
> >   File "/Library/Python/2.5/site-packages/web2py_1.87.3/applications/
> > cms/controllers/myadmin.py", line 180, in update
> >     db.company.CoC_number.requires.set_self_id(company[0].id)
> > AttributeError: 'list' object has no attribute 'set_self_id'
>
> > ... do you know why?
>
> > Kind regards,
>
> > Annet.
>
>


[web2py] Re: python tutorial video

2011-03-09 Thread Massimo Di Pierro
will fix typos, change music and redo it.

On Mar 8, 4:10 pm, Stefaan Himpe  wrote:
>   My suggestion ->  Konstantin Scherbakov, maybe
>
> >> Liszt's transcriptions of Beethoven symphonies for the Piano
>
> His Lyapunov etudes are well worth listening to as well :)


[web2py] Re: Web2py license question

2011-03-09 Thread Massimo Di Pierro
Yes, your license must say that you did so.


On Mar 8, 4:46 pm, kverdecia  wrote:
> Hi,
>
> Can I include the web2py template module in my desktop application
> without affecting the license of my application?


[web2py] Cron not running/starting on windows

2011-03-09 Thread Andrew Buchan
Hello,

I have web2py running as a service on Windows Server 2003 from source
at version 1.93.2.
I'm trying to get cron to work but nothing seems to be happening. I
can't figure out if its running and failing, or not running at all, so
it would be really useful if someone could answer the following for
me:

a) Do I need to restart the service for changes to the cron file to
take effect?
b) Does the crontab file need to be in a specific encoding - could I
have screwed it up with Notepad?
c) Does the cron.master file in the admin application play a role?
d) Do I need to do anything in the options.py file (which I use as I
run web2py as a windows service)?
e) If one line in the crontab file fails, do the subsequent lines
still run?

I've been through all the documentation and searched this group but
can't figure it out. Assuming I'm doing nothing wrong with regards to
the above, if anyone can shed any light on the file contents below I
would be most grateful.

Thanks,

Andrew.

--
Here's the cron file:

#crontab
*/1 *   *   *   *   root 
**applications/HubFormsDev/cron/Script1.py

--
Here's Script1.py:

import datetime

TimeString = datetime.datetime.now().strftime('%d.%m -- %H.%M.%S')
f = open('C:\\Program Files\\Hub Pages\\web2py\\applications\
\HubFormsDev\\cron\\%s.txt' % TimeString, 'w')
f.close()

--
Here's options.py:

import socket
import os

ip = '0.0.0.0'
port = 80
password = 'abuchan'  # ##  means use the previous password
pid_filename = 'httpserver.pid'
log_filename = 'httpserver.log'
profiler_filename = None
ssl_certificate = ''  # ## path to certificate file
ssl_private_key = ''  # ## path to private key file
numthreads = 10
server_name = socket.gethostname()
request_queue_size = 5
timeout = 10
shutdown_timeout = 5
folder = os.getcwd()
extcron = None
nocron = None

--




[web2py] Re: Update_record and validator conflict.

2011-03-09 Thread DenesL
Hi Annet,

the requires for the field is now a list of validators for some
reason.
You have to use the set_self_id only on the IS_NOT_IN_DB portion of
the requires.

Did you change the requires?.
If not, then it is probably just a one member list so you can do

db.company.CoC_number.requires[0].set_self_id(company[0].id)


On Mar 9, 4:03 am, annet  wrote:
> Hi Denes,
>
> Thanks for your reply. I tried:
>
> >           # this is undocumented
> >           db.company.CoC_number.requires.set_self_id(company[0].id)
>
> > >         form.vars.name=company[0].name
> > >         form.vars.CoC_number=company[0].CoC_number
> > >         form.vars.subdossiernumber=company[0].subdossiernumber
> > >         ...
> > >         if form.accepts(request.vars,session):
>
> ... and got this error ticket:
>
> Traceback (most recent call last):
>   File "/Library/Python/2.5/site-packages/web2py_1.87.3/gluon/
> restricted.py", line 188, in restricted
>     exec ccode in environment
>   File "/Library/Python/2.5/site-packages/web2py_1.87.3/applications/
> cms/controllers/myadmin.py", line 262, in 
>   File "/Library/Python/2.5/site-packages/web2py_1.87.3/gluon/
> globals.py", line 96, in 
>     self._caller = lambda f: f()
>   File "/Library/Python/2.5/site-packages/web2py_1.87.3/gluon/
> tools.py", line 2237, in f
>     return action(*a, **b)
>   File "/Library/Python/2.5/site-packages/web2py_1.87.3/applications/
> cms/controllers/myadmin.py", line 180, in update
>     db.company.CoC_number.requires.set_self_id(company[0].id)
> AttributeError: 'list' object has no attribute 'set_self_id'
>
> ... do you know why?
>
> Kind regards,
>
> Annet.


[web2py] Re: Multiple form flash problem.

2011-03-09 Thread annet
Hi David,

> Sorry if anything here is impractical, but here's a couple of
> thoughts...

I very much appreciate you sharing your thoughts with me, they are
helpful and they add to range of possible solutions to implement
things.

The reason I implemented things the way I did is that I am building
this web application for a psychologist and he insisted on
implementing it this way for cognitive ergonomic reasons.


Kind regards,

Annet.


[web2py] Re: Update_record and validator conflict.

2011-03-09 Thread annet
Hi Denes,

Thanks for your reply. I tried:

>           # this is undocumented
>           db.company.CoC_number.requires.set_self_id(company[0].id)
>
> >         form.vars.name=company[0].name
> >         form.vars.CoC_number=company[0].CoC_number
> >         form.vars.subdossiernumber=company[0].subdossiernumber
> >         ...
> >         if form.accepts(request.vars,session):


... and got this error ticket:

Traceback (most recent call last):
  File "/Library/Python/2.5/site-packages/web2py_1.87.3/gluon/
restricted.py", line 188, in restricted
exec ccode in environment
  File "/Library/Python/2.5/site-packages/web2py_1.87.3/applications/
cms/controllers/myadmin.py", line 262, in 
  File "/Library/Python/2.5/site-packages/web2py_1.87.3/gluon/
globals.py", line 96, in 
self._caller = lambda f: f()
  File "/Library/Python/2.5/site-packages/web2py_1.87.3/gluon/
tools.py", line 2237, in f
return action(*a, **b)
  File "/Library/Python/2.5/site-packages/web2py_1.87.3/applications/
cms/controllers/myadmin.py", line 180, in update
db.company.CoC_number.requires.set_self_id(company[0].id)
AttributeError: 'list' object has no attribute 'set_self_id'


... do you know why?


Kind regards,

Annet.


[web2py] Re: No login possible in Firefox, but in chrome

2011-03-09 Thread Norbert Klamann
Javascript works in the firefox in principle . I tried this one 
http://www.javascripter.net/faq/alert.htm and it shows the alert box. 


[web2py] No login possible in Firefox, but in chrome

2011-03-09 Thread Norbert Klamann
Hello all,
i cannot log in or register  to my web2py applications in firefox but in 
chrome it works fine.

In Firefox I get noe feedback whatever about failed or successful login.

I have the webdevolper extensions installed, but javascript is not disabled, 
cookies are allowed too and they are visible and look the same under ff and 
chrome.

Versions :
Ubuntu 10.4
Firefox 3.6.15 
python '2.6.5 (r265:79063, Apr 16 2010, 13:09:56) \n[GCC 4.4.3]'
web2.py 1.93.2, clean install

I presume that I have a trivial misconfiguration on the firefox side , but 
really don't know where to look

Norbert



[web2py] For interest: Regressive enhancement with Modernizr and yepnope.js

2011-03-09 Thread Tom Atkins
how to only load JavaScript as a fall-back when browsers don't support an
HTML5 feature - i.e. *regressive* enhancement:

http://blogs.sitepoint.com/2011/03/08/regressive-enhancement-with-modernizr-and-yepnope/