Re: [web2py] Re: Ordering page

2010-07-26 Thread Kenneth Lundström
 Waauu, many thanks Massimo, that was exactly what I was looking for. I 
installed it and it works nicely but after modifying to fit my database 
model I can´t the +1 and -1 buttons to work. Or they work but quantity 
and balance is not updated. If I reload the page numbers are updated and 
show correct figures.


I´m getting document.getElementById(t) is null in Firefox Error Console.
It is the row

jQuery.ajax({type: "POST", url: u, data: query, success: function(msg) { 
document.getElementById(t).innerHTML=msg; } });


that gives this error.

Any ideas where to start looking for the problem?


Kenneth




Re: [web2py] Re: generate CSV file with multiple sheets

2010-08-05 Thread Kenneth Lundström

 Hello Neveen,

could you show us how you use xlwt? I´d be very interested.


Kenneth


Thanks a lot mdipierro i found the module xlwt and it is very useful.

Thanks

On Aug 5, 4:33 pm, mdipierro  wrote:

rows.export_to_csv_filed(stream)

you can write more stuff to the same stream.

On Aug 5, 7:29 am, Neveen Adel  wrote:


Hello,
  I want to generate a csv file with multiple sheets, i used str(rows).
Is there a way to generate multiple sheets in one file?
Thanks in Advance
Neveen






Re: [web2py] looking for work?

2010-08-07 Thread Kenneth Lundström

 Hello,

is the US thing absolut?


Kenneth



Are you in US?
Have you contributed to web2py or developed something I can look at?
Looking for a paid project to work on?

Please contact me confidentially.

DO NOT REPLY to this thread.




Re: [web2py] Re: Error when executing select command

2010-08-09 Thread Kenneth Lundström

Now I´m getting:

Traceback(most recent call last):
  File"gluon/restricted.py",line178,inrestricted
execccodeinenvironment
  File"/data/domains/exp-kal.nudata.fi/applications/init/controllers/troop.py"  
,line2195,in
  File"gluon/globals.py",line96,in
self._caller=lambdaf:f()
  File"gluon/tools.py",line2219,inf
returnaction(*a, **b)
  File"/data/domains/exp-kal.nudata.fi/applications/init/controllers/troop.py"  
,line985,inedit_saleplace
days=db((db.troop_place_day.day() 
==2)&(db.troop_place_day.troop_place==21)).select()
TypeError:'Field'objectis notcallable


But why should I use day(), is day a reserved word, should I use 
something else instead.



Kenneth


change with: db.troop_place_day.day()==2 if I not wrong

On Aug 9, 8:31 am, Kenneth  wrote:
   

I don´t understand what am I doing wrong.

command:
days = db((db.troop_place_day.day ==
2)&(db.troop_place_day.troop_place == 21)).select()

gives this error:

Traceback (most recent call last):
   File "gluon/restricted.py", line 178, in restricted
 exec ccode in environment
   File "/data/domains/exp-kal.nudata.fi/applications/init/controllers/
troop.py", line 2195, in
   File "gluon/globals.py", line 96, in
 self._caller = lambda f: f()
   File "gluon/tools.py", line 2219, in f
 return action(*a, **b)
   File "/data/domains/exp-kal.nudata.fi/applications/init/controllers/
troop.py", line 985, in edit_saleplace
 days = db((db.troop_place_day.day ==
2)&(db.troop_place_day.troop_place == 21)).select()
   File "gluon/sql.py", line 3162, in select
 return self.parse(db,rows,self.colnames,SetClass=Set)
   File "gluon/sql.py", line 3231, in parse
 str(value)[:8].strip().split(':')[:3]]
ValueError: invalid literal for int() with base 10: '1 day, 0'

My model for that table looks like this:

db.define_table('troop_place_day',
 db.Field('troop_place', db.troop_place, required=True),
 db.Field('day', 'integer'),
 db.Field('starts', 'time', requires=IS_TIME()),
 db.Field('ends', 'time', requires=IS_TIME()))

This error just started coming maybe an hour ago. I just deleted all
records from the record and same thing continues.

I really don't understand what is happening.

Kenneth
 




Re: [web2py] Re: New server

2010-08-09 Thread Kenneth Lundström
 I have a clean install of CentOS 5.5, so I´ll try to write down every 
step of installing web2oy and make a slice of it.



Kenneth

That might be why I had so much difficulty with CentOS.

--
Thadeus





On Mon, Aug 9, 2010 at 12:14 PM, mdipierro  wrote:

no

On Aug 9, 11:45 am, Thadeus Burgess  wrote:

Does it have Plesk or a similar control panel installed?

--
Thadeus

On Mon, Aug 9, 2010 at 10:46 AM, mdipierro  wrote:

I have a machine with configuration (somebody set it up for me and it
seesm to work).
On Aug 9, 10:00 am, Thadeus Burgess  wrote:

I guess the key is, no CentOS with apache/mod_wsgi. Can't comment on
other webservers since I never tried them with CentOS... just Apache.
--
Thadeus
On Mon, Aug 9, 2010 at 9:49 AM, Vasile Ermicioi  wrote:

I use CentOS + python2.7 + web2py + gevent.pywsgi
works great, I could help with installation if you need




Re: [web2py] Re: Error when executing select command

2010-08-09 Thread Kenneth Lundström

I finally found what the problem is.

I have defined the table as

db.Field('starts', 'time', requires=IS_TIME()),
db.Field('ends', 'time', requires=IS_TIME()))

and when a user fills the form I have as defaults starts = 0:00:00 and ends = 
24:00:00
the ends value is the problem.

The last row in the error:
ValueError: invalid literal for int() with base 10: '1 day, 0'

if I put ends = 28:00:00 error message is:
ValueError:invalid literalforint()with base10:'1 day, 4'

so when extracing the value 24:00:00 from time column it gets converted to '1 
day' instead of 24:00:00.

Is this a bug or correct behavior?

I would like to use values 0:00:00 and 24:00:00 to mark a whole day.


Kenneth





This is still an option:

On Aug 9, 7:45 am, mdipierro  wrote:
   

You have the problem described here:

http://web2py.com/book/default/chapter/06#Fixing-Broken-Migrations

The first one of them.

On Aug 9, 6:31 am, Kenneth  wrote:

 

I don´t understand what am I doing wrong.
   
 

command:
days = db((db.troop_place_day.day ==
2)&(db.troop_place_day.troop_place == 21)).select()
   
 

gives this error:
   
 

Traceback (most recent call last):
   File "gluon/restricted.py", line 178, in restricted
 exec ccode in environment
   File "/data/domains/exp-kal.nudata.fi/applications/init/controllers/
troop.py", line 2195, in
   File "gluon/globals.py", line 96, in
 self._caller = lambda f: f()
   File "gluon/tools.py", line 2219, in f
 return action(*a, **b)
   File "/data/domains/exp-kal.nudata.fi/applications/init/controllers/
troop.py", line 985, in edit_saleplace
 days = db((db.troop_place_day.day ==
2)&(db.troop_place_day.troop_place == 21)).select()
   File "gluon/sql.py", line 3162, in select
 return self.parse(db,rows,self.colnames,SetClass=Set)
   File "gluon/sql.py", line 3231, in parse
 str(value)[:8].strip().split(':')[:3]]
ValueError: invalid literal for int() with base 10: '1 day, 0'
   
 

My model for that table looks like this:
   
 

db.define_table('troop_place_day',
 db.Field('troop_place', db.troop_place, required=True),
 db.Field('day', 'integer'),
 db.Field('starts', 'time', requires=IS_TIME()),
 db.Field('ends', 'time', requires=IS_TIME()))
   
 

This error just started coming maybe an hour ago. I just deleted all
records from the record and same thing continues.
   
 

I really don't understand what is happening.
   
 

Kenneth
   




Re: [web2py] Re: Translate change password

2010-04-02 Thread Kenneth Lundström
Thank You Yarko,

but in the tools.py file I couldn't find the text string "Change password"
that is show on the second row in the Change password page.

> auth.messages.submit_button = T('Submit')

I didn´t find any auth.messages in the tools.py file. When I tried to but
auth.messages.submit_button = "Testing" it didn´t change the Submit caption.


Kenneth


On Thu, Apr 1, 2010 at 7:02 PM, Yarko Tymciurak  wrote:

> Looking at gluon/tools.py (around line 600:)  I see all the messages,
> labels, and strings that can be customized.
>
> For a start, you could copy this entire list into your db.py (or
> wherever you enable auth), and at a minimum reset each such as this:
>
> auth.messages.submit_button = T('Submit')
>
> I seem to remember something about this not being done in gluon
> because T() is not necessarily known there...
>
> Hope that helps.
>
> - Yarko
>
>
> On Apr 1, 10:08 am, GhostRider  wrote:
> > I have an application in finnish and swedish and everything is
> > translated into the fi.py and se.py files. Only thing that I can´t
> > find how to translate is the Change password page.
> >
> > Ideas?
> >
> > Kenneth
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to
> web2py+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>
>

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



Re: [web2py] Re: Errors with the new version

2010-04-03 Thread Kenneth Lundström
Traceback (most recent call last):
  File "gluon/restricted.py", line 173, in restricted
exec ccode in environment
  File 
"/data/domains/live-kal.nudata.fi/applications/init/views/district/campaign.html",
line 187, in 
{{=A(XML('+ '), T('Add new personal reward'), XML(' »'),
_href=URL(r=request,c='district',f='edit_reward', args=[district.id,
campaign.id]))}}
  File "gluon/globals.py", line 105, in write
self.body.write(xmlescape(data))
  File "gluon/html.py", line 99, in xmlescape
return data.xml()
  File "gluon/sql.py", line 1433, in __getattr__
self.__allocate()
  File "gluon/sql.py", line 1428, in __allocate
raise Exception, "undefined record"
Exception: undefined record





On Sun, Apr 4, 2010 at 4:37 AM, mdipierro  wrote:

> I need the complete traceback.
>
> On Apr 3, 7:44 pm, Kenneth  wrote:
> > Last summer I started on an application that has been in use so far. I
> > havn´t upgraded it because there was no need for it.
> >
> > Last month I started to do some serious updating of the code and the
> > first thing I did was upgrading web2py. Everything has been working
> > great so far, but two days ago I noticed something is wrong. I been
> > pulling my hair out trying to find out why the application is not
> > working. An hour ago i remembered that I indeed did an upgrade.
> >
> > Old version is 1.65.4 and new version is the newest one.
> >
> > Error message is:
> > File "gluon/sql.py", line 1428, in __allocate
> > raise Exception, "undefined record"
> >
> > In paralell I´m still using the old version of the application so I
> > took the whole old application and copied it to an new directory. Made
> > a copy of the database och got the application to work. I tested that
> > it is working and then I applied to the new version Web2py on it (just
> > unzipped it and copied it on the old version). Application stopped
> > working.
> >
> > Any ideas where to continue looking for the problem?
> >
> > Kenneth
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to
> web2py+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>
>

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



Re: [web2py] Re: WikiYou - Showcase

2010-08-16 Thread Kenneth Lundström

Hello David,


 When I try and enter a URL like 
"http://mycommunity.127.0.0.1:8000/mm_beta_1/default/index";  where mycommunity 
is actually a parameter specifying which community


The problem is that the browser does not understand a address like 
subdomain.127.0.0.1, you have to fool the operating system when testing 
subdomains.

On Windows look at the file hosts in c:\windows\system32\drivers\etc or 
/etc/hosts on linux.

Put a new line for every subdomain you want to test:
127.0.0.1   kennethscommunity.community.com
127.0.0.1   davidscommunity.community.com
127.0.0.1   joescommunity.community.com

you can´t use a wildcard, I think.

Now if you try to reach http://davidscommunity.community.com you should arrive 
at your site. I have not done this myself but I´m pretty sure it should work.


Kenneth


to operate o



n, I get page not found errors.

On Aug 14, 6:35 pm, Lasiaf  wrote:
   

No, its not opensource.

On Aug 13, 12:56 pm, Bruno Rocha  wrote:



 

Thats opensource?
   
 

2010/8/13 Lasiaf
   
 

maybe when you tried it, the version I uploaded was the one with
invalid routes(maybe development mode).
I can't think of any reason why would it fail. Also can you answer my
first and 3rd questions?
Thanks
 
 

On Aug 13, 12:55 am, mdipierro  wrote:
 

I fill the registration form and shows me the registration form again.
No message.
   
 

On Aug 12, 7:49 pm, Lasiaf  wrote:
   
 

I actually used rpx first, but I didn't like it much, so I used google
account login but then I didn't like it too much too. hehe so I
decided to use the default one from web2py.
How can you not login? Do you just post and no errors and going back
to same page?
 
 

On Aug 12, 4:14 pm, mdipierro  wrote:
 
 

I cannot login. I suggest you use RPX
   
 

On Aug 12, 1:17 pm, Lasiaf  wrote:
   
 

Hi,
 
 

I would like to share my 2nd app using web2py, its
 

atwww.wikiyou.org.
 

It is like wikipedia about us and you can create your own subdomain
usernames like having your own username.wikiyou.org. I actually
 

have a
 

PHP/MySQL version using Zend Framework before, but I decided to
 

port
 

it to web2py and having more features than before.
Also I have few questions on how to resolve some things.
 
 

First.
Is there a way to add attributes using the MENU() helper in anchor
tags? like I want to add rel="nofollow" in there.
 
 

Second.
This might not be web2py related, but gae, on gae they don't
 

support
 

naked domains so when you go towikiyou.org it will be no page
 

found.
 

I already followed and added some of appengine groups to fix it,
 

but
 

no luck, the domain is in enom. So I added @www.wikiyou.org
URL_REDIRECT type. cause I can't add empty.
 
 

Third.
Is there like a way to know if i'm on a development server and
production? starting from routes.py so I could change settings
depending on my env info? even a single switch somewhere will help.
 
 

Thanks
 
 

--
   
 

http://rochacbruno.com.br
   




Re: [web2py] Re: SQLFORM.factory

2010-08-19 Thread Kenneth Lundström
Of course, thats a very much easier way of doing. But it doesn´t work 
either. It doesn´t get translated.



Kenneth


Hi Kenneth,

if you don't need the custom form then you can just use the label
parameter on the Field,
Field('new_seller', ..., label=T('Add seller'))

Denes.

On Aug 19, 12:28 am, Kenneth  wrote:
   

I create my form with

args = {}
args['submit_button'] = T('Insert person')
form = SQLFORM.factory(Field('new_seller', 'integer',
requires=IS_IN_DB(.), **args)

in my view I show it with
{{=form}}

and it looks like
New Seller: a dropdown list

it works nicely, but then I would like to translate the 'New Seller'
text and per online book it should work like:
{{=form.custom.begin}}
{{=T('Add seller')}}:{{=form.custom.widget.add_seller}}
{{=form.custom.end}}

The text is translated, but instead of the dropdown list I get the
text 'None', no dropdown.

Kenneth
 




Re: [web2py] Re: SQLFORM.factory

2010-08-19 Thread Kenneth Lundström

Intresting, it doesn´t work.

If I use just label=T('Add seller') it doesn´t even translate (doesn´t 
appear in my language file)
when I tried with label=str(T('Add seller')) the string is translate but 
not shown.



Kenneth


Try label=str(T('Add seller'))

On Aug 19, 6:33 am, Kenneth Lundström
wrote:
   

Of course, thats a very much easier way of doing. But it doesn t work
either. It doesn t get translated.

Kenneth

 

Hi Kenneth,
   
 

if you don't need the custom form then you can just use the label
parameter on the Field,
Field('new_seller', ..., label=T('Add seller'))
   
 

Denes.
   
 

On Aug 19, 12:28 am, Kennethwrote:
   
 

I create my form with
 
 

args = {}
args['submit_button'] = T('Insert person')
form = SQLFORM.factory(Field('new_seller', 'integer',
requires=IS_IN_DB(.), **args)
 
 

in my view I show it with
{{=form}}
 
 

and it looks like
New Seller: a dropdown list
 
 

it works nicely, but then I would like to translate the 'New Seller'
text and per online book it should work like:
{{=form.custom.begin}}
{{=T('Add seller')}}:{{=form.custom.widget.add_seller}}
{{=form.custom.end}}
 
 

The text is translated, but instead of the dropdown list I get the
text 'None', no dropdown.
 
 

Kenneth
 




Re: [web2py] Re: SQLFORM.factory

2010-08-19 Thread Kenneth Lundström

My view looks like:
{{extend 'layout.html'}}

{{=T('Sellers in this campaign')}}
{{for person in person_data:}}

  {{=A(str(person.name + " " + person.surname), 
_href=URL(r=request, f='edit_seller', args=[troop.id, person.id, 
person.troop_group]))}}

{{=groups[person.troop_group]['name']}}

{{pass}}

{{=T('Insert old user to this campaign')}}
{{=form}}
{{=form_new_person}}

{{=T('Troop groups')}}
{{for group in group_data:}}
{{=A(group.name, _href=URL(r=request, f='edit_group', 
args=[troop.id, campaign.id, group.id]))}}


{{pass}}


{{=form_new_group}}

Controller:
form = SQLFORM.factory(Field('new_seller', 
requires=IS_IN_SET(['kalle','ville'])), label=str(T('New seller')), **args)

form['_formname'] = 'add_seller'

I changed the IS_IS_DB to IS_IN_SET but that didn´t help either.

What part of the view do I need to look at.


Kenneth





This must work. Can you please post your model and view?

On Aug 19, 5:51 am, Kenneth Lundström
wrote:
   

Intresting, it doesn t work.

If I use just label=T('Add seller') it doesn t even translate (doesn t
appear in my language file)
when I tried with label=str(T('Add seller')) the string is translate but
not shown.

Kenneth

 

Try label=str(T('Add seller'))
   
 

On Aug 19, 6:33 am, Kenneth Lundstr m
wrote:
   
 

Of course, thats a very much easier way of doing. But it doesn t work
either. It doesn t get translated.
 
 

Kenneth
 
 

Hi Kenneth,
   
 

if you don't need the custom form then you can just use the label
parameter on the Field,
Field('new_seller', ..., label=T('Add seller'))
   
 

Denes.
   
 

On Aug 19, 12:28 am, Kenneth  wrote:
   
 

I create my form with
 
 

args = {}
args['submit_button'] = T('Insert person')
form = SQLFORM.factory(Field('new_seller', 'integer',
requires=IS_IN_DB(.), **args)
 
 

in my view I show it with
{{=form}}
 
 

and it looks like
New Seller: a dropdown list
 
 

it works nicely, but then I would like to translate the 'New Seller'
text and per online book it should work like:
{{=form.custom.begin}}
{{=T('Add seller')}}:{{=form.custom.widget.add_seller}}
{{=form.custom.end}}
 
 

The text is translated, but instead of the dropdown list I get the
text 'None', no dropdown.
 
 

Kenneth
 




Re: [web2py] Re: SQLFORM.factory

2010-08-21 Thread Kenneth Lundström
 > The problem is the double closing parenthesis before label, it 
should be:

requires=IS_IN_SET(['kalle','ville']), label=T('New seller')), **args)
otherwise the label is not part of the Field definition.

OK, no I see the problem. Thank you very many.


Kenneth



  form['_formname'] = 'add_seller'


I changed the IS_IS_DB to IS_IN_SET but that didn t help either.

What part of the view do I need to look at.

Kenneth





Re: [web2py] Re: Should we have a feature freeze and stability maintenance period in future?

2010-08-24 Thread Kenneth Lundström

Hello Paul,

I´d be happy helping putting up a Linux box for web2py. I use CentOS as 
my distribution, but if needed it should not be a big problem setting it 
up on Ubuntu either.



Kenneth



Hi all,

Sounds like there's a little momentum in this :-)

Here's what I can contribute to the party:

1. Part of the test management tool I am writing is a 'case
management' facility. It is basic, but it supports multiple case
types. Cases can be issues/incidents/defects, to do/actions, and
notifications to review changes to other entities in the system (in my
case, requirements, stories, tests etc...). There is a messaging/
notifications module, uploads/attachments and a case notes history.
This functionality is part of the system we will will make available
as a free hosted option to Agile Development teams. I'd be delighted
to offer this to "the team" to use. I benefit by getting feedback and
ideas for improvement. I also get a little kudos with the testing
market :O)

2. As a sideline we have (currently 4) servers colocated at a data
centre that is a mile away from where I live (Maidenhead UK).
Currently, all are using Windows 2008 and I have my dev web2py set up
on one of them. I would like to deploy on Linux, I use Mysql at the
moment - the only proprietary code I currently use is Windows and I
want to be 100% open source. So I'd be happy to provide a Linux box
for a Linux expert to set up apache/mail/web2py. I'm familiar with
Ubuntu, but if there's a preferred distribution - please advise - I'll
use that. I anticipate this would host the tools required of the team,
plus my own development environment. I would deploy on another server.
I guess there should be a mirror of the web2py team content somewhere
else on the planet. (I could also use my Amazon web services account,
but this is a tad more expensive for me).

3. I'm sure none of us want to be drawn into a bureacratic, committee
based group- but a little organisation is required. I also host three
community stes using Druapl CMS. One is public (www.uktmf.com) and I
have two private ones that are probably a better model for a small
group).I also use Drupal for my own company website.I'd be happy to
host (initially on Windows, but I'd migrate to the Linux box later) a
Drupal site for the group to use. The value of a CMS is we could
define a brief terms of reference for the group, assign roles etc and
make a start. Mailing lists are a bit cumbersome :O)

4. There's also a slight possibility I can corral some professional
testers into helping us. There's an interesting group I know who do
weekend testing for fun - mainly exploratory, but if we released apps
that needed some testing, I can publicise this in my testing network
we might get them on board. Just a thought.

This is what I can contribute.

Paul.

On Aug 23, 10:47 am, Michele Comitini
wrote:
   

Hi all,

I do develomplent with many different things, different languages
architectures and looking for tools for managing software projects is
a must for me

;-)

I think the "problem" here is that web2py has started to receive the
deserved attention by the user and developer community.
Prof. Massimo is  doing his best to keep with the growing volume of
request. The  question is: "design of new features is slowed by
bugfixing?"

Well I red from Massimo 2 alerts similar to the following (Massimo
feel free to correct me if I am wrong!!):
1. "Please remind me of patches to be applied"
2. "I need to keep track of messages, so no IRC"

Due to web2py success things will get worse, then I would suggest to
start focusing on 2 main points to see if we can find some
ideas/solutions.

1) version control

I perfectly understand Massimo position: dealing with mercurial
(git,bzr) is a pain! Anyhow we must help Massimo
delegate some dirty work to others, since we need Massimo to do the
important stuff.
I think that somehow Massimo's web2py problems resemble those that
Linus' Linux faced at the end of '90s.  I just
remind that Linus to end the thing had written the git system!

Please take time to read this 
chapter:http://hgbook.red-bean.com/read/collaborating-with-other-people.html

and 
this:http://hgbook.red-bean.com/read/collaborating-with-other-people.html#...

The model for Linux development IMHO is too much at this time, but
some ideas should be taken into consideration.

2) issue tracking

We *must* setup a ticket system.  Discussion on groups,IRC will
eventually lead to a new ticket, but *only* tickets must be
taken into account for bugfixing. Code snippets, error log, must be
tracked there.

ciao,
mic

2010/8/23 mart:



 

Hi Again,
   
 

So, spending the day with my 3 girls certainly does provide
perspective on requirements and how well attached we can be to them
sometimes ;). That in mind, I certainly do understand your personal
requirements on keeping what you know and what works for you (I
respect old fashion ;) ). We can work with that, while hopefully
bringing something efficient, scala

Re: [web2py] Deploying web2py on linux (Redhat or others) on cpanel or other ways

2010-09-02 Thread Kenneth Lundström

 Hello Rahul,

> Currently we succeeded in running it on test server. When service 
provider tries to deploy it on existing RedHat server, he encounters 
port conflicts.


> 1) How to deploy it on Redhat/other linux without disturbing other 
deployed sites, say on a different server port etc.


No knowing everything about your service providers setup it sounds like 
your trying to run web2py webserver on the same server as other 
webserver is running. You can´t have Apache and web2py webserver working 
of the same 80 (http) port. You should serve your web2py application 
thru Apache, meaning setting up Apache to serve python. Or whatever 
webserver your service provider is using.


> 2) Has anyone deployed it through cpanel? If so what are the detailed 
steps.


With a quick search thru the mailing list archives at 
http://groups.google.com/group/web2py I found this


http://groups.google.com/group/web2py/browse_thread/thread/5aa2e4d43e1776a0/e727f2b5c635346d?lnk=gst&q=cpanel#e727f2b5c635346d

Hopefully this helps.


Kenneth

3) Any other stuff I am missing. I am not at all familiar with
deployment. please help...


Please help.
Thanks, Rahul




Re: [web2py] Re: HTML Helper, INPUT, Javascript

2010-09-04 Thread Kenneth Lundström

 Thank you Massimo again for a very fast reply.


Kenneth

TH(INPUT(_type="checkbox", _name="check_all", _onclick="return
popup(this,'notes')"))

On Sep 4, 8:25 am, Kenneth  wrote:

Hello,

how do I use HTML Helper to get make a th and checkbox tag.





Re: [web2py] split rows object in view.

2010-09-09 Thread Kenneth Lundström



One way of solving this would be like this:



{{counter = 1}}

{{for row in rows:}}

  {{if counter == 1:}}

{{=row.facility}}

{{counter = 2}}

  {{else:}}

{{=row.facility}}

{{counter = 1}}

  {{pass}}

{{pass}}




Kenneth



I have the following code in a view:


   {{for row in rows:}}
 {{=row.facility}}
   {{pass}}


The length of rows varies. I would like to split the list in two list
and display it in two columns instead of one. Is it possible to do
this in the view, or should the function return rows_1 and rows_2?


Kind regards,

Annet.




Re: [web2py] web2py 1.84.1 is out

2010-09-13 Thread Kenneth Lundström

 I upgraded to 1.84.1 and I think I found a bug.

I use the language edit function and before when orginal and translation 
was the same the orginal was in red. Not anymore. Much more harder to 
find texts to translate.


A suggestion about upgrade procedur. To upgrade to newest version is no 
very, very easy.  Why not make it as easy to upgrade to newest version 
in trunk. I know it is very easy already but why not take it the last step.



Kenneth



flash now stays put in the top right corner
improved behavior for URL and T objects
new app level logging with logging.conf (thanks Jonathan)
improved OpenID (thanks Michele)
web2py_ajax handles prepend, append, hide (thanks Juris)
web2py_ajax also handels pre-validation of decimal fields
ru-ru translation (thanks Michele)
sk-sk translation (thanks Julius)
migrations save .table only if changed and after each ALTER TABLE (no more 
mysql inconsistencies)
fixed bugs in SQLCustomField, Field(default=...), IS_IMAGE, IS_DECIMAL_IN_RANGE 
and a few more.
Better validators (IS_DECIMAL_IN_RANGE, IS_INT_IN_RANGE, etc) thanks Jonatham
Polymmodel support on GAE
Experimental ListWidget
scripts/extract_mysql_models.py, thanks Falko Krause and Ron McOuat
scripts/dbsessions2trash.py, thanks Scott
moved DAL and routes to thread.local (thanks Jonathan, again) (***)

I had to post this since not  enough people were testing ***. Please
report any error so that, if any, they can be fixed.

Massimo





Re: [web2py] Re: web2py 1.84.1 is out

2010-09-14 Thread Kenneth Lundström
 I installed Firebug and restarted firefox. Voila yellow color is 
visible. Was it the installation of Firebug, restarting firefox or 
reloading the page that made the color appear again.



Kenneth


It should still work but the color be orange instead of red. Can you
check the source with firebug?
Is there something wrong in css that does not show in your browser?

massimo

On Sep 13, 3:17 pm, Kenneth Lundström
wrote:

   I upgraded to 1.84.1 and I think I found a bug.

I use the language edit function and before when orginal and translation
was the same the orginal was in red. Not anymore. Much more harder to
find texts to translate.

A suggestion about upgrade procedur. To upgrade to newest version is no
very, very easy.  Why not make it as easy to upgrade to newest version
in trunk. I know it is very easy already but why not take it the last step.

Kenneth


flash now stays put in the top right corner
improved behavior for URL and T objects
new app level logging with logging.conf (thanks Jonathan)
improved OpenID (thanks Michele)
web2py_ajax handles prepend, append, hide (thanks Juris)
web2py_ajax also handels pre-validation of decimal fields
ru-ru translation (thanks Michele)
sk-sk translation (thanks Julius)
migrations save .table only if changed and after each ALTER TABLE (no more 
mysql inconsistencies)
fixed bugs in SQLCustomField, Field(default=...), IS_IMAGE, IS_DECIMAL_IN_RANGE 
and a few more.
Better validators (IS_DECIMAL_IN_RANGE, IS_INT_IN_RANGE, etc) thanks Jonatham
Polymmodel support on GAE
Experimental ListWidget
scripts/extract_mysql_models.py, thanks Falko Krause and Ron McOuat
scripts/dbsessions2trash.py, thanks Scott
moved DAL and routes to thread.local (thanks Jonathan, again) (***)

I had to post this since not  enough people were testing ***. Please
report any error so that, if any, they can be fixed.
Massimo






Re: [web2py] how to generate a random string?

2010-09-14 Thread Kenneth Lundström
 I´m just updating my CSV import which generates password so I found 
this line of code:


password = 
base64.b64encode(sha.sha(str(random.random())).hexdigest())[:8]



Kenneth


hi all,
how i can generate a random string of 8 numbers/letters?
i need for generate an automatic password when a user complete
registration in my apps

example:
Aje37Uj0




Re: [web2py] Re: Deployment problem (apache2 mod_wsgi)

2010-09-14 Thread Kenneth Lundström

 Hi Johann,

I might be completly wrong but I think that you can´t have 
example.com/phpsite and example.com/web2py at the same time. You can 
have http://phpsite.example.com and http://web2py.example.com


The reason is that the part after http:// (hostname) decides where to 
go. If you have example.com/phpsite and example.com/web2py your going to 
the same place. The part after / is part of the hostname so 
NameVirtualHost doesn´t use it.



Kenneth


Your answer convinced me that I do not know enough of NameVirtualHost"
and I decided read some documentation about it.

I have it working now but I see I need to define a cname to reach it
from another computer.  Url's like http://example.com/web2py  does not
work.  While web2py is the only enabled site, I can reach it with
http://example.com but what if I have http://example.com/phpsite  and
http://example.com/web2py?

Regards
Johann





Re: [web2py] Re: how to generate a random string?

2010-09-14 Thread Kenneth Lundström

 import sha, random, base64

I have theese imports.


Kenneth


i have an error
NameError: global name 'base64' is not defined

On 14 Set, 10:10, Kenneth Lundström
wrote:

   I m just updating my CSV import which generates password so I found
this line of code:

  password =
base64.b64encode(sha.sha(str(random.random())).hexdigest())[:8]

Kenneth


hi all,
how i can generate a random string of 8 numbers/letters?
i need for generate an automatic password when a user complete
registration in my apps
example:
Aje37Uj0






Re: [web2py] Re: time value of 00:00:00 in MySQL interpreted as None

2010-09-14 Thread Kenneth Lundström
 Would it be possible to look into the fact that when storing 24:00:00 
and read out it will be converted into a value of 1 day instead of 24:00:00.



Kenneth


I will look. If this is a web2py issue it will be fixed.

On Sep 14, 4:14 pm, Fred  wrote:

I've got an application that stores time of day and midnight
(00:00:00) is a valid time that sometimes needs to be stored and
retrieved.  That used to work fine in an old release of web2py but in
a recent release (1.84.4) such values are returned by DAL as None
value rather than datetime.time(0,0) as it should be.  This seems like
a defect to me.  Can it be fixed, or is there some reason for doing it
this way now?

I don't know when the change occurred.  It worked fine on 1.74.2.  It
no longer works the way I expect in 1.84.4.

I've tested with MySQL and sqlite and the problem only occurs when
using MySQL.  The time does display as 00:00:00 when I view it
directly in MySQL.  Something in DAL converts it to None.

Here is a test model:

db.define_table('test1',
 Field('start', 'time')
 )

Here are controller functions to populate and view some test data:

def populate():
 import datetime
 db.test1.insert(start=datetime.time(8, 30))
 db.test1.insert(start=datetime.time(0, 0))

def show():
 import sys
 items = db(db.test1.id>  0).select()
 sys.stderr.write(str(items) + "\n")
 return dict(items=items)

The latter writes the following to stderr:

test1.id,test1.start
1,08:30:00
2,




[web2py] Problems changing database models

2010-09-14 Thread Kenneth Lundström
 I´m trying to change the length of a string from 35 to 50 but I get 
errors.


db.define_table('district',
db.Field('name', 'string', length=35, requires=IS_NOT_EMPTY()),

I´m trying to change it to:
db.define_table('district',
db.Field('name', 'string', length=50, requires=IS_NOT_EMPTY()),


Error traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.



Traceback(most recent call last):
  File"gluon/restricted.py",line188,inrestricted
execccodeinenvironment
  File"/applications/init/models/2_db.py"  
,line145,in
db.Field('cow_id','string',default=''))
  File"gluon/sql.py",line1348,indefine_table
t._create(migrate=migrate,fake_migrate=fake_migrate)
  File"gluon/sql.py",line1839,in_create
fake_migrate=fake_migrate)
  File"gluon/sql.py",line1884,in_migrate
sql_field_current[key] =sql_field[key]
NameError:globalname'sql_field'is notdefined


 Error snapshot

/Detailed traceback description/

   * Exception: (global name 'sql_field'
 is not defined)
 /Exception instance attributes/
 o __setattr__: 
 o __reduce_ex__: 
 o __getslice__: 
 o __getitem__: 
 o __setstate__: 
 o __getattribute__: 
 o __str__: 
 o args: ("global name 'sql_field' is not defined",)
 o __reduce__: 
 o __class__: 
 o __dict__: {}
 o __delattr__: 
 o __repr__: 
 o __hash__: 
 o __doc__: 'Name not found globally.'
 o __init__: 
 o __new__: 
   * Python 2.5.1: /usr/bin/python


   File gluon/restricted.py in restricted at line 188

[ code | arguments | variables ]
/Function argument list: 
(code='\n###... ', 
environment={'A': , 'Auth': 'gluon.tools.Auth'>, 'B': , 'BEAUTIFY': 'gluon.html.BEAUTIFY'>, 'BODY': , 'BR': 'gluon.html.BR'>, 'CENTER': , 'CLEANUP': 
, 'CODE': , 
'CRYPT': , ...}, 
layer='/data/domains/exp-kal.nudata.fi/applications/init/models/2_db.py')/


183.
184.
185.
186.
187.
188.

189.
190.
191.
192.



iftype(code) ==types.CodeType:
ccode=code
else:
ccode=compile2(code,layer)

exec ccode in environment

exceptHTTP:
raise
exceptException:
# XXX Show exceptioninWing IDEifrunningindebugger

   * environment: {'A': , 'Auth': , 'B': , 'BEAUTIFY':
 , 'BODY': ,
 'BR': , 'CENTER': , 'CLEANUP': , 'CODE': ,
 'CRYPT': , ...}
   * ccode:  at 0x2b6c01efd3f0, file
 "/...ta.fi/applications/init/models/2_db.py", line 11>


   File applications/init/models/2_db.py in  at line 145

[ code | arguments | variables ]
/Function argument list: ()/

140.
141.
142.
143.
144.
145.

146.
147.
148.
149.



#db.Field('calenders', 'integer'),
#db.Field('posting_text', 'text'),
db.Field('edited_by',db[user_table],required=True),
db.Field('edited_date','datetime',required=True),
db.Field('hidden','boolean',default=False),
db.Field('cow_id', 'string', default=''))


db.define_table('district_moderator',
db.Field('user',db[user_table],required=True),
db.Field('district',db.district,required=True),

   * db.Field: 
   * default: undefined
   * db: }>}>


   File gluon/sql.py in define_table at line 1348

[ code | arguments | variables ]
/Function argument list: (self=}>}>, 
tablename='district', *fields=(0x2b6c0181a410>, , 
, 0x2b6c0181a550>, ), **args={})/


1343.
1344.
1345.
1346.
1347.
1348.

1349.
1350.
1351.
1352.



t._create_references()

ifmigrate:
try:
sql_locker.acquire()
t._create(migrate=migrate, fake_migrate=fake_migrate)

finally:
sql_locker.release()
else:
t._dbt=None

   * t._create: }>>
   * migrate: True
   * t: }>
   * fake_migrate: False


   File gluon/sql.py in _create at line 1839

[ code | arguments | variables ]
/Function argument list: (self=at 0x2b6...te': }>, 
migrate=True, fake_migrate=False)/


1834.
1835.
1836.
1837.
1838.
1839.

1840.
1841.
1842.
1843.



portalocker.unlock(tfile)
tfile.close()
ifsql_fields!=sql_fields_old:
self._migrate(sql_fields,sql_fields_old,
  sql_fields_aux,logfile,
fake_migrate=fake_migrate)

returnquery

def_migrate(
self,

   * fake_migrate: False


   File gluon/sql.py in _migrate at line 1884

[ code | arguments | variables ]
/Function argument list: (self=at 0x2b6...te': }>, 
sql_fields={'cow_id': 'VARCHAR(512)', 'edited_by': 'INT, INDEX 
edited_by__idx (edited_by), FOREIGN K...ed_by) REFERENCES auth_user(id) 
ON DELETE CASCADE', 'edited_date': 'DATETIME', 'hidden': 'CHAR(1)', 
'id': 'INT AUTO_INCREMENT NOT NULL', 'name': 'VARCHAR(50)'}, 
sql_fields_old={'cow_id': 'VARCHAR(512)', 'edited_by': 'INT, INDEX 
edited_by__idx (edited_by), FOREIGN K...ed_by) REFERENCES auth_

Re: [web2py] Re: Automatic delete of a record after x days

2010-10-07 Thread Kenneth Lundström

 > first question:
> what is this?? */30 * * * *

That */30 * * * * is ordinary linux crontab syntax, look at 
http://adminschoice.com/crontab-quick-reference and the fist picture 
when you scroll down. It should tell you what those * are.


Basically you define when the cron is runned,

first * tells at which minute of the clock the cron is runned
second * tells at what hour teh cron is runned
third * at what day of month cron is runned
forth * which month cron is runned
fifth * tells at which weekday of week cron is runned

That is basic crontab, I have never used web2pys cron so I don´t know 
about all extensions, hopefully somebody else can help you with that.



Kenneth


if i wanna execute every day the function "daytask" in my controller
"automatictask" i neet to do:
1) edit web2py 1.84.4\applications\xxx\cron\crontab
2) add a row (my crontab is empty) -->  @dayly root*automatictask/
daytask

it work ?
if i restart web2py it will be executed when it start? or after 1 day?
there is something strange to write in my controller function or it is
a normal function?

thanks for help


On 7 Ott, 21:00, Bruno Rocha  wrote:

Cron ->http://web2py.com/book/default/chapter/04?search=cron#Cron

2010/10/7 ceriox


Hi all,
it is possible delete a record if it is older than 5 days (without
user operation)?
i have a table with a data field if this field is older than 5 days i
wanna delete it and do other stuff without any "manual" operation

--

http://rochacbruno.com.br




Re: [web2py] please help us test new web site

2010-10-09 Thread Kenneth Lundström

 > http://web2py.com

Looking very nice.

> New demo_admin:
>  http://web2py.com/demo_admin

Whats new in the new admin? Could not see anything new with a fast look.


Kenneth



Re: [web2py] Re: please help us test new web site

2010-10-11 Thread Kenneth Lundström

 Definitely A


Kenneth


P.S. Anyway... everybody should say their opinion now:

A)
http://www.web2py.com/examples/static/img/logo_lb.png
B)
http://www.solieworks.com/images/solie_web2py.png (first)
C)
http://www.solieworks.com/images/solie_web2py.png (second)

a coherent overwhelming response would help (whatever the outcome).

Massimo




On Oct 11, 10:57 pm, mdipierro  wrote:

I am not defending the artistic merits of the latest logo (because I
am partially responsible for it and because My artistic skills are
close to zero) but the problem is that there is no way to way to make
everybody happy about the logo. Each of us sees the world with a
different eye, likes a different color and has a preferred font.

I liked the first logo by Bruno and Jose for example. I showed it to
my 5yrs old son and I asked him "what is it?" he replied "a funny
bat".

Lots of people here pointed us to the Django logo as a good example so
Bruno and I discussed the features we wanted:

- no logo (which is open to too much interpretation) just text
- professional look, not trying to be funny
- bold fonts to represent solidity
- shadow but not glow (better for printing)
- close/overlapping characters to represent tight integration of
web2py components
- a long 2 to give a hint but no more than a hint of a snake

I like the logo by Solie a lot but it is more appropriate to represent
our community than web2py itself because of the smiley face with
glasses (that is what I see in it). And I like it because it kind of
looks like me. I think we should at least use it on the top of the
mailing list.

Perhaps we could use it as sample logo in the welcome app (I do not
think we should use the same logo as the examples page because we want
to avoid confusion). It would work well with the white background of
the new html5 welcome app developed by Martin.

Massimo

On Oct 11, 10:42 pm, weheh  wrote:


Ahhh ... don't you just love getting consensus on logos (not
possible)? Sorry Bruno&  MDP, I know you guys have been busting hump
on the new design. But FWIW, I think the new logo is a bit boring.
There, I've said it. I probably deserve to get kicked for that.
Anyway, I prefer the 2 logos by Solie (the 2nd one (the one on the
bottom) is my preference). But there seems to be enormous
inconsistency in the logo design process -- depending on the day, it
either has to be a stylized-text logo or a logo with a break-away
favicon. So which one is it?
On Oct 11, 11:03 pm, mdipierro  wrote:

Hello Solie,
I am impressed. The first one is very much along the lines of what I
just posted.
Your second design is stunning. I can tell you are a pro!
Here is were we stand... I just posted this:http://www.web2py.com/(makesureyou 
reaload)
after weeks of back and forth between me and Bruno. Yesterday night I
promised him this would be last one and definitive logo and I would
like to stick to that promise.
Yet, I really like your design and I think we should find a use for
it.
Massimo
On Oct 11, 8:40 pm, Solie  wrote:

Just found out about web2py. Trying to contribute. I thought this
would be a good logo to consider. Just text like someone else
suggested.
Sample Logo:http://www.solieworks.com/web2py_logo.php
On Oct 10, 4:55 pm, mdipierro  wrote:

This was discussed long ago... Snakes are a nice reference to the
Python community but are not appealing outside the community. They are
not exactly perceived as friendly animals.
On Oct 10, 3:19 pm, Anthony  wrote:

For what it's worth, I don't think we need a snake in the logo. At
least, it can be difficult to get it right -- snake logos can easily
end up looking either too fierce/scary or too childish/cartoonish.
Most other Python frameworks and libraries don't have snake logos (not
to mention that the language was actually named after Monty Python,
not a snake). The few snake logos that actually look OK are typically
highly stylized and don't really look too "snaky".
Anthony
On Oct 10, 2:24 pm, rochacbruno  wrote:

I did not understand your suggestion, what user icon?
Are you saying to remove "web2py" leaving just the WP or removing the big W 
leaving just the P?
I am working on new ideas for the logo, small changes.
Enviado via iPhone
Em 10/10/2010, às 14:21, Thadeus Burgess  escreveu:

I think the "w" is redundant in the logo. It just looks funny.
What if the logo was just the user icon in the middle?
--
Thadeus
On Sun, Oct 10, 2010 at 8:04 AM, johntynan  wrote:

Great work with the new web2py site!  I like how well the top and
right hand navigation is used and I was glad to discover some
resources about web2py that I didn't realize were available.
I have one question.  Do you think the twitter link should direct
people to the twitter search for web2py, as opposed to the web2py
twitter account?  http://twitter.com/search/web2py
Excellent work!- Hide quoted text -

- Show quoted text -






Re: [web2py] Re: äöå in the address bar....

2010-10-21 Thread Kenneth Lundström

 Isn´t there a special character code for space to, like for åäö?


Kenneth


This gets me pretty close!
I can't put spaces in the field... is there a way to do that?
In the end I will be parsing by space for a search feature I am trying 
to implement.

Best Regards,
Jason Brower

On Thu, 2010-10-21 at 07:42 -0700, Jonathan Lundell wrote:

On Oct 21, 2010, at 1:51 AM, Jason Brower wrote:

It was my understanding that you called it as such...
request.vars.variable_name
So I want it so I can set the variable_name and it would respond 
with it's contents.





request.vars is basically a Python dict, and subject to its rules.


So you might want to make it


http://127.0.0.1:8000/furniture/default/results?foo=sdfsafsdfa%C3%A4%C3%A4%C3%A4


and refer to request.vars.foo






BR,
Jason

On Wed, 2010-10-20 at 22:47 -0700, Jonathan Lundell wrote:

On Oct 20, 2010, at 10:34 PM, Jason Brower wrote:

That works, but how do I load that data?




What do you want to do with it? It should show up in request.vars, 
I think.




On Wed, 2010-10-20 at 19:57 -0700, Jonathan Lundell wrote:

On Oct 20, 2010, at 7:52 PM, Jason Brower wrote:

For example, if I put...
http://127.0.0.1:8000/furniture/default/results/sdfsafsdfa%C3%A4%C3%A4%C3%A4
It will not work and tells me I have an invalid controller.
http://127.0.0.1:8000/furniture/default/results/sdfsafs
Works.
Any solution for this?




Try putting the last part in a query string (vars) and see how 
that goes:



http://127.0.0.1:8000/furniture/default/results?sdfsafsdfa%C3%A4%C3%A4%C3%A4


BR,
Jason Brower
On Wed, 2010-10-20 at 20:52 +0300, Jason Brower wrote:

I can see it in google, I can use cär and it works...
Why or how can I use äöå in that area or is there some other 
way to use it as a parameter when sending data to a page...

BR,
Jason Brower




























Re: [web2py] Newb question: How to handle multiple controller levels?

2010-10-30 Thread Kenneth Lundström
I have a controller for different levels, org, customer, appointment and so on.

When i want to for example edit a customer the address looks like 
/hostname/customer/edit/5/2 where 5 is the org and 2 is the customer.

Appointment would look like /hostname/appointment/5/2/10 where 10 is the id of 
the appontment. 5 and 2 are not exactly neccesary as all appointments have a 
unique id, but often it is good to have them in the address. If nothing else it 
is good to allways use the same syntax.


Kenneth


- Alkuperäinen viesti -
> I have an app that supports multiple organizations.
> Each organization has many customers.
> Each customer has many appointments.
> 
> I think that means organizations, while controllers, employ a customer
> controller, which employes an appointment controller.
> 
> In my head the URL for editing an appointment should therefore look
> like this:
> 
>           /hostname/organization/5/customer/2/appointment/edit/9
> 
> This kind of organization also lets one bookmark an action or record
> easily.
> 
> I am doing multiple things wrong, of course, but I don’t know exactly
> what. Can someone explain at a high level what I should correct,
> ideally some documentation somewhere? I have been reading the 3rd
> edition section 4.2 but am stuck. Thanks!



Re: [web2py] validators order

2010-11-03 Thread Kenneth Lundström
This is a educated guess but I think you can only have one requires, 
when you write two the second is used. So if you put IS_NOT_EMPTY last 
web2py only uses that one, and that alone is not enough for web2py to 
build a dropdown.


IS_IN_DB takes out the need for IS_NOT_EMPTY as the value has to be in 
the database it can´t be empty.



Kenneth


hi

why is order of validators important?
i have

db.tecaj.voditelj.requires=IS_NOT_EMPTY()
db.tecaj.voditelj.requires=IS_IN_DB(db,'person.id','%(name)s')

why does putting the IS_NOT_EMPTY() at the end doesn't produce
dropdown list?
do i need the IS_NOT_EMPTY() if i have IS_IN_DB validator?

andrej




[web2py:31935] Re: Retrieve password function disabled

2009-09-30 Thread Kenneth Lundström
Those settings are correct, I can send mail from my application, but when I
try to go to page /init/default/user/retrieve_password I get the flash
message Function disabled.


Kenneth


On Wed, Sep 30, 2009 at 4:35 PM, mdipierro  wrote:

>
> you have to configure your email smtp server
>
> mail=Mail()
> mail.server='host:port'
> mail.sender=''
> mail.login='username:password'
> auth.settings.mailer=mail
>
> otherwise it does not know how to email you.
>
> On Sep 30, 5:48 am, GhostRider  wrote:
> > Hello list,
> >
> > just started using web2py and now I hit the wall with the retrieve
> > password function.
> >
> > How do I enable that function?
> >
>

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



Re: [web2py] Re: web2py organization - important for consultants !!!

2010-11-12 Thread Kenneth Lundström
Very nice site, the disappearing lightbulb is nice. One bad thing with 
the disappearing lightbulb is if you reload the frontpage and scroll 
down immediately, after a couple of seconds the page shakes like an 
earthquake.


the Experts page looks a little bit odd, you have the texts Filter by 
country and Where are we? but then lots of space so All our experts is 
almost outside of window. Maybe the Google map could be visible all the 
time and before you select a country all experts could be seen on the map.


 If I select a country (in my case Finland) I get a Google map with the 
world but nothing on it. Would it be bether to only have relevant 
Countries in the dropdown list?


When I select an expert all other experts disappears and I have to go 
back to find next expert. Could all experts Expertieses be shown in the 
list with all experts.


The Projects page is empty, one thing I hate about websites is empty 
pages, why have a link in the menu if the page is empty. Maybe remove 
the Projects link until there is something. Or atleast write something 
there.



Kenneth




Not at all. It just happened that I have been monitoring today and I
know the people who filled the form, so I approved them. You
specifically have been a contributing member of this community for
some time. I will not be so prompt and may need to be reminded.

For now I will handle approval. When we reach a critical mass and I
start seeing people I do not recognize, we can together create a more
formal process for approval.

Massimo



On Nov 11, 4:06 pm, GoldenTiger  wrote:

I did login atwww.experts4solutions.comand now I appears at "our
experts", then anyone can be an expert?
Before appearing as expert, I want to make merit :)

On 11 nov, 22:21, José Ignacio Hurtado
wrote:


Sounds interesting.
2010/11/11 Branko Vukelic

On Thu, Nov 11, 2010 at 9:31 PM, VP  wrote:

I truly hope so.  Currently, the book and this mailing list are two
sources for learning about web2py.   I hope this new venture is not
diminishing future improvements of both of these.

Oh, that's just silly. I don't see how experts4solutions could affect
mailing list or book at all.
--
Branko Vukelić
bg.bra...@gmail.com
stu...@brankovukelic.com
Check out my blog:http://www.brankovukelic.com/
Check out my portfolio:http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca:http://identi.ca/foxbunny
Gimp Brushmakers Guild
http://bit.ly/gbg-group

--
Un saludo,
José Ignacio Hurtado López






Re: [web2py] Re: web2py organization - important for consultants !!!

2010-11-12 Thread Kenneth Lundström

One more thing,

I went through all experts but one experts Internal error


http://experts4solutions.com/e4s/default/expert/7


 Internal error

Ticket issued: 
e4s/81.17.193.228.2010-11-12.13-29-46.5651ebc2-31b8-43df-94f0-44b48c2d4647 




Kenneth


Not at all. It just happened that I have been monitoring today and I
know the people who filled the form, so I approved them. You
specifically have been a contributing member of this community for
some time. I will not be so prompt and may need to be reminded.

For now I will handle approval. When we reach a critical mass and I
start seeing people I do not recognize, we can together create a more
formal process for approval.

Massimo



On Nov 11, 4:06 pm, GoldenTiger  wrote:

I did login atwww.experts4solutions.comand now I appears at "our
experts", then anyone can be an expert?
Before appearing as expert, I want to make merit :)

On 11 nov, 22:21, José Ignacio Hurtado
wrote:


Sounds interesting.
2010/11/11 Branko Vukelic

On Thu, Nov 11, 2010 at 9:31 PM, VP  wrote:

I truly hope so.  Currently, the book and this mailing list are two
sources for learning about web2py.   I hope this new venture is not
diminishing future improvements of both of these.

Oh, that's just silly. I don't see how experts4solutions could affect
mailing list or book at all.
--
Branko Vukelić
bg.bra...@gmail.com
stu...@brankovukelic.com
Check out my blog:http://www.brankovukelic.com/
Check out my portfolio:http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca:http://identi.ca/foxbunny
Gimp Brushmakers Guild
http://bit.ly/gbg-group

--
Un saludo,
José Ignacio Hurtado López






[web2py] Error when using new wizard

2010-11-12 Thread Kenneth Lundström
Just installed the newest version of web2py (1.89.1) and tested the 
wizard to create a new appl.


I came to step 6 when I got a error.

Version
web2py™ Version 1.89.1 (2010-11-12 15:14:36)
Python
Traceback

Traceback (most recent call last):
File "/data/domains/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
File "/data/domains/web2py/applications/admin/controllers/wizard.py", 
line 571, in ?

File "/data/domains/web2py/gluon/globals.py", line 96, in 
self._caller = lambda f: f()
File "/data/domains/web2py/applications/admin/controllers/wizard.py", 
line 200, in step6

create(form.vars)
File "/data/domains/web2py/applications/admin/controllers/wizard.py", 
line 488, in create

file=open(meta,'wb')
IOError: [Errno 2] No such file or directory: 
'/data/domains/web2py/applications/admin/../Boatintra/wizard.metadata'


What more info do you need to find the error?


Kenneth



Re: [web2py] Re: Error when using new wizard

2010-11-12 Thread Kenneth Lundström

> Can you check if this folder was created?
>  /data/domains/web2py/applications/Boatintra

No it was not created.

> if not it is a file permission issue. What os? was it a binary 
distribution of web2py?


Linux, source. All files permissions apache:web2py. I tried to change 
file permissions of the applications directory to 777 but no luck.



Kenneth




On Nov 12, 5:30 pm, Kenneth Lundström
wrote:

Just installed the newest version of web2py (1.89.1) and tested the
wizard to create a new appl.

I came to step 6 when I got a error.

Version
web2py Version 1.89.1 (2010-11-12 15:14:36)
Python
Traceback

Traceback (most recent call last):
File "/data/domains/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
File "/data/domains/web2py/applications/admin/controllers/wizard.py",
line 571, in ?
File "/data/domains/web2py/gluon/globals.py", line 96, in
self._caller = lambda f: f()
File "/data/domains/web2py/applications/admin/controllers/wizard.py",
line 200, in step6
create(form.vars)
File "/data/domains/web2py/applications/admin/controllers/wizard.py",
line 488, in create
file=open(meta,'wb')
IOError: [Errno 2] No such file or directory:
'/data/domains/web2py/applications/admin/../Boatintra/wizard.metadata'

What more info do you need to find the error?

Kenneth




Re: [web2py] Re: Error when using new wizard

2010-11-12 Thread Kenneth Lundström

Centos 5.5, Apache 2 and mod_wsgi.

I tried using the "New simple application". I gave it a name och pressed 
create. I get "unable to create application 'testing'".



Kenneth


What is your setup?  apache?mod_wsgi?

On Nov 12, 5:48 pm, Kenneth Lundström
wrote:

  >  Can you check if this folder was created?
  >/data/domains/web2py/applications/Boatintra

No it was not created.

  >  if not it is a file permission issue. What os? was it a binary
distribution of web2py?

Linux, source. All files permissions apache:web2py. I tried to change
file permissions of the applications directory to 777 but no luck.

Kenneth




On Nov 12, 5:30 pm, Kenneth Lundstr m
wrote:

Just installed the newest version of web2py (1.89.1) and tested the
wizard to create a new appl.
I came to step 6 when I got a error.
Version
web2py Version 1.89.1 (2010-11-12 15:14:36)
Python
Traceback
Traceback (most recent call last):
File "/data/domains/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
File "/data/domains/web2py/applications/admin/controllers/wizard.py",
line 571, in ?
File "/data/domains/web2py/gluon/globals.py", line 96, in
self._caller = lambda f: f()
File "/data/domains/web2py/applications/admin/controllers/wizard.py",
line 200, in step6
create(form.vars)
File "/data/domains/web2py/applications/admin/controllers/wizard.py",
line 488, in create
file=open(meta,'wb')
IOError: [Errno 2] No such file or directory:
'/data/domains/web2py/applications/admin/../Boatintra/wizard.metadata'
What more info do you need to find the error?
Kenneth






Re: [web2py] Re: Error when using new wizard

2010-11-13 Thread Kenneth Lundström
Where can I start to look for the problem. Is the problem written in 
some log?



Kenneth


It is a file permission issue.

On Nov 13, 12:33 am, Kenneth Lundström
wrote:

Centos 5.5, Apache 2 and mod_wsgi.

I tried using the "New simple application". I gave it a name och pressed
create. I get "unable to create application 'testing'".

Kenneth


What is your setup?  apache?mod_wsgi?
On Nov 12, 5:48 pm, Kenneth Lundstr m
wrote:

   >Can you check if this folder was created?
   >  /data/domains/web2py/applications/Boatintra
No it was not created.
   >if not it is a file permission issue. What os? was it a binary
distribution of web2py?
Linux, source. All files permissions apache:web2py. I tried to change
file permissions of the applications directory to 777 but no luck.
Kenneth

On Nov 12, 5:30 pm, Kenneth Lundstr m
wrote:

Just installed the newest version of web2py (1.89.1) and tested the
wizard to create a new appl.
I came to step 6 when I got a error.
Version
web2py Version 1.89.1 (2010-11-12 15:14:36)
Python
Traceback
Traceback (most recent call last):
File "/data/domains/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
File "/data/domains/web2py/applications/admin/controllers/wizard.py",
line 571, in ?
File "/data/domains/web2py/gluon/globals.py", line 96, in
self._caller = lambda f: f()
File "/data/domains/web2py/applications/admin/controllers/wizard.py",
line 200, in step6
create(form.vars)
File "/data/domains/web2py/applications/admin/controllers/wizard.py",
line 488, in create
file=open(meta,'wb')
IOError: [Errno 2] No such file or directory:
'/data/domains/web2py/applications/admin/../Boatintra/wizard.metadata'
What more info do you need to find the error?
Kenneth






[web2py] Apache virtualhosts and many domains

2010-11-13 Thread Kenneth Lundström
I´ve read many posts about domains linked to different apps but still I 
don´t know how to do it with Apaches virtual hosts.


I have looked at the web2py slices number 14.

Does anybody have two virtual hosts files or entries that you could send 
that I could look at?



Kenneth



Re: [web2py] Idea on web2py wizard

2010-11-13 Thread Kenneth Lundström

+1

I was thinking the same when I was using the wizard first time. Maybe so 
that you still could do like you do now, write evertything or then you 
could select everything from a dropdown box and checkboxes.



Kenneth


In the table creation step, how about having some columns with all the
available options for each table field such as "unique", "required",
"notnull", "nonempty" as checkboxes. The types could also come from a
dropbox with: "string", integer", ...

I don't know if this kind of thing could be applied elsewhere but it
would be great for those that don't want to know by heart all the
possible options and apply them...

Thank you,
Best regards




[web2py] Any WSGI experts on this list

2010-11-15 Thread Kenneth Lundström
I have a Centos server running web2py with mod_wsgi, apache, MySQL, 
MySQL-Python, python 2.6

As Centos uses python 2.4 I have installed 2.6 parallell with 2.4.

Then I have a new server where I´m trying to get everything to work but 
no luck sofar. First I thought everything was OK until I noticed I (or 
the server) was using Python 2.4, I installed mod_wsgi again to get it 
to use python 2.6.


Now I´m getting RuntimeError: global name 'MySQLdb' is not defined 
(tried 5 times)


If I try import MySQLdb in terminal it works both for python2.4 and 2.6.

I have read everything I could find about the subject on mailing lists 
archive, I tried everything listed in this discussion

http://groups.google.com/group/web2py/browse_thread/thread/344248aa2a8acc2b/dceda24846958053?lnk=gst&q=+MySQLdb+is+not+defined+#dceda24846958053

Last thing I tested was to remove mod_wsgi that I had install via yum 
and tried to install it from source, no luck.



Kenneth




Re: [web2py] Create TRs dinamically in a FORM

2010-11-15 Thread Kenneth Lundström

Doesn´t SQLFORM do this automatically?

One other way to do this would be like this.

In controller:
rows = db(db.data_table.id < 0).select()
return dict(rows=rows)

In view:


{{for row in rows:}}
row.idrow.data
{{pass}}




Kenneth


Hi! I want to create a FORM using TABLE but i need to create TR's

depending of the number of Rows in a query, for example if the query
returned 3 rows i need something like:

FORM(TABLE(
  TR(..)
  TR(..)
  TR(..)
))

I want to do this dinamically... Any thoughts?

Thanks!




Re: [web2py] Re: Error when using new wizard

2010-11-16 Thread Kenneth Lundström
Now that I got the MySQLdb solved I'm trying to solve the problem with the new 
admin.

I did a chmod -R 777 * on all files in my web2py directory and also a chown -R 
apache:web2py * and still I get a Failed to create application testing.

In what file I start to look for the problem?


Kenneth

- Alkuperäinen viesti -
> It is a file permission issue.
> 
> On Nov 13, 12:33 am, Kenneth Lundström 
> wrote:
> > Centos 5.5, Apache 2 and mod_wsgi.
> > 
> > I tried using the "New simple application". I gave it a name och
> > pressed create. I get "unable to create application 'testing'".
> > 
> > Kenneth
> > 
> > > What is your setup?  apache?mod_wsgi?
> > 
> > > On Nov 12, 5:48 pm, Kenneth Lundstr m
> > > wrote:
> > > >   >  Can you check if this folder was created?
> > > >   >    /data/domains/web2py/applications/Boatintra
> > 
> > > > No it was not created.
> > 
> > > >   >  if not it is a file permission issue. What os? was it a binary
> > > > distribution of web2py?
> > 
> > > > Linux, source. All files permissions apache:web2py. I tried to
> > > > change file permissions of the applications directory to 777 but
> > > > no luck.
> > 
> > > > Kenneth
> > 
> > > > > On Nov 12, 5:30 pm, Kenneth Lundstr
> > > > > m wrote:
> > > > > > Just installed the newest version of web2py (1.89.1) and
> > > > > > tested the wizard to create a new appl.
> > > > > > I came to step 6 when I got a error.
> > > > > > Version
> > > > > > web2py Version 1.89.1 (2010-11-12 15:14:36)
> > > > > > Python
> > > > > > Traceback
> > > > > > Traceback (most recent call last):
> > > > > > File "/data/domains/web2py/gluon/restricted.py", line 188, in
> > > > > > restricted exec ccode in environment
> > > > > > File
> > > > > > "/data/domains/web2py/applications/admin/controllers/wizard.py",
> > > > > > line 571, in ? File "/data/domains/web2py/gluon/globals.py",
> > > > > > line 96, in self._caller = lambda f: f()
> > > > > > File
> > > > > > "/data/domains/web2py/applications/admin/controllers/wizard.py",
> > > > > > line 200, in step6 create(form.vars)
> > > > > > File
> > > > > > "/data/domains/web2py/applications/admin/controllers/wizard.py",
> > > > > > line 488, in create file=open(meta,'wb')
> > > > > > IOError: [Errno 2] No such file or directory:
> > > > > > '/data/domains/web2py/applications/admin/../Boatintra/wizard.metadata'
> > > > > > What more info do you need to find the error?
> > > > > > Kenneth
> > 
> > 



[web2py] Upgrade problem

2010-11-17 Thread Kenneth Lundström

I tried to upgrade version 1.89.1 to 1.89.3. I got the following error.

I´m running Linux, Apache and mod_wsgi. Is this too an file permission 
problem. I still can´t create a new application with admin. Don´t know 
where to start looking for the problem.



Kenneth


Version
web2py™ Version 1.89.1 (2010-11-12 15:14:36)
Python Python 2.6.5: /usr/bin/python
Traceback

Traceback (most recent call last):
File "/data/domains/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
File "/data/domains/web2py/applications/admin/controllers/default.py", 
line 1146, in 

File "/data/domains/web2py/gluon/globals.py", line 96, in 
self._caller = lambda f: f()
File "/data/domains/web2py/applications/admin/controllers/default.py", 
line 200, in upgrade_web2py

(success, error) = upgrade(request)
File "/data/domains/web2py/gluon/admin.py", line 427, in upgrade
file.close()
UnboundLocalError: local variable 'file' referenced before assignment

Error snapshot help Detailed traceback description

(local variable 'file' referenced 
before assignment)


Re: [web2py] Re: Upgrade problem

2010-11-18 Thread Kenneth Lundström

What can I do to fix this? What kind of path issue is this?


Kenneth


hmmm. I can make the error go away but this is a path issue

On Nov 17, 3:31 pm, Kenneth Lundström
wrote:

I tried to upgrade version 1.89.1 to 1.89.3. I got the following error.

I m running Linux, Apache and mod_wsgi. Is this too an file permission
problem. I still can t create a new application with admin. Don t know
where to start looking for the problem.

Kenneth

Version
web2py Version 1.89.1 (2010-11-12 15:14:36)
Python Python 2.6.5: /usr/bin/python
Traceback

Traceback (most recent call last):
File "/data/domains/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
File "/data/domains/web2py/applications/admin/controllers/default.py",
line 1146, in
File "/data/domains/web2py/gluon/globals.py", line 96, in
self._caller = lambda f: f()
File "/data/domains/web2py/applications/admin/controllers/default.py",
line 200, in upgrade_web2py
(success, error) = upgrade(request)
File "/data/domains/web2py/gluon/admin.py", line 427, in upgrade
file.close()
UnboundLocalError: local variable 'file' referenced before assignment

Error snapshot help Detailed traceback description

(local variable 'file' referenced
before assignment)




Re: [web2py] Re: Upgrade problem

2010-11-18 Thread Kenneth Lundström
The Upgrade problem I can´t test of course but now I manually upgraded 
to 1.89.3 and still have the problem with creating a new application.



Kenneth


I do not have enough information to debug this. I suggest get 1.89.3
and see if you still have the problem, then I will suggest a test.

Massimo

On Nov 18, 6:06 am, Kenneth Lundström
wrote:

What can I do to fix this? What kind of path issue is this?

Kenneth


hmmm. I can make the error go away but this is a path issue
On Nov 17, 3:31 pm, Kenneth Lundstr m
wrote:

I tried to upgrade version 1.89.1 to 1.89.3. I got the following error.
I m running Linux, Apache and mod_wsgi. Is this too an file permission
problem. I still can t create a new application with admin. Don t know
where to start looking for the problem.
Kenneth
Version
web2py Version 1.89.1 (2010-11-12 15:14:36)
Python Python 2.6.5: /usr/bin/python
Traceback
Traceback (most recent call last):
File "/data/domains/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
File "/data/domains/web2py/applications/admin/controllers/default.py",
line 1146, in
File "/data/domains/web2py/gluon/globals.py", line 96, in
self._caller = lambda f: f()
File "/data/domains/web2py/applications/admin/controllers/default.py",
line 200, in upgrade_web2py
(success, error) = upgrade(request)
File "/data/domains/web2py/gluon/admin.py", line 427, in upgrade
file.close()
UnboundLocalError: local variable 'file' referenced before assignment
Error snapshot help Detailed traceback description
(local variable 'file' referenced
before assignment)






Re: [web2py] Re: Upgrade problem

2010-11-18 Thread Kenneth Lundström

Apache, mod_wsgi, Linux, MySQL, source


Kenneth


what is you configuration (source/binary, apache/rocket)?

On Nov 18, 6:35 am, Kenneth Lundström
wrote:

The Upgrade problem I can t test of course but now I manually upgraded
to 1.89.3 and still have the problem with creating a new application.

Kenneth


I do not have enough information to debug this. I suggest get 1.89.3
and see if you still have the problem, then I will suggest a test.
Massimo
On Nov 18, 6:06 am, Kenneth Lundstr m
wrote:

What can I do to fix this? What kind of path issue is this?
Kenneth

hmmm. I can make the error go away but this is a path issue
On Nov 17, 3:31 pm, Kenneth Lundstr m
wrote:

I tried to upgrade version 1.89.1 to 1.89.3. I got the following error.
I m running Linux, Apache and mod_wsgi. Is this too an file permission
problem. I still can t create a new application with admin. Don t know
where to start looking for the problem.
Kenneth
Version
web2py Version 1.89.1 (2010-11-12 15:14:36)
Python Python 2.6.5: /usr/bin/python
Traceback
Traceback (most recent call last):
File "/data/domains/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
File "/data/domains/web2py/applications/admin/controllers/default.py",
line 1146, in
File "/data/domains/web2py/gluon/globals.py", line 96, in
self._caller = lambda f: f()
File "/data/domains/web2py/applications/admin/controllers/default.py",
line 200, in upgrade_web2py
(success, error) = upgrade(request)
File "/data/domains/web2py/gluon/admin.py", line 427, in upgrade
file.close()
UnboundLocalError: local variable 'file' referenced before assignment
Error snapshot help Detailed traceback description
(local variable 'file' referenced
before assignment)






Re: [web2py] Re: Upgrade problem

2010-11-18 Thread Kenneth Lundström

- unpacked the source package
- did a chown apache:web2py on all files
- login in to admin
- write the name of the new application and press create
- get the unable to create application "test"

Upgrade problem, the same, but
- select upgrade
- press YES
- get the error ticket

I don´t know what else to write.


Kenneth


I see the problem but I do not understand why you have it. This should
manifest itself when you upgrade, not when you create a new app. Can
you list steps to reproduce the problem?

I am close to fixing it...

On Nov 17, 3:31 pm, Kenneth Lundström
wrote:

I tried to upgrade version 1.89.1 to 1.89.3. I got the following error.

I m running Linux, Apache and mod_wsgi. Is this too an file permission
problem. I still can t create a new application with admin. Don t know
where to start looking for the problem.

Kenneth

Version
web2py Version 1.89.1 (2010-11-12 15:14:36)
Python Python 2.6.5: /usr/bin/python
Traceback

Traceback (most recent call last):
File "/data/domains/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
File "/data/domains/web2py/applications/admin/controllers/default.py",
line 1146, in
File "/data/domains/web2py/gluon/globals.py", line 96, in
self._caller = lambda f: f()
File "/data/domains/web2py/applications/admin/controllers/default.py",
line 200, in upgrade_web2py
(success, error) = upgrade(request)
File "/data/domains/web2py/gluon/admin.py", line 427, in upgrade
file.close()
UnboundLocalError: local variable 'file' referenced before assignment

Error snapshot help Detailed traceback description

(local variable 'file' referenced
before assignment)




Re: [web2py] Re: Upgrade problem

2010-11-18 Thread Kenneth Lundström

OK, I have no idea if they are related, it was just a thought on my part.


Kenneth


Thanks Kenneth,

the traceback you posted applies to the second problem and I
understand that. I am scratching my head on why that traceback would
also apply to the first problem.

Massimo

On Nov 18, 7:09 am, Kenneth Lundström
wrote:

- unpacked the source package
- did a chown apache:web2py on all files
- login in to admin
- write the name of the new application and press create
- get the unable to create application "test"

Upgrade problem, the same, but
- select upgrade
- press YES
- get the error ticket

I don t know what else to write.

Kenneth


I see the problem but I do not understand why you have it. This should
manifest itself when you upgrade, not when you create a new app. Can
you list steps to reproduce the problem?
I am close to fixing it...
On Nov 17, 3:31 pm, Kenneth Lundstr m
wrote:

I tried to upgrade version 1.89.1 to 1.89.3. I got the following error.
I m running Linux, Apache and mod_wsgi. Is this too an file permission
problem. I still can t create a new application with admin. Don t know
where to start looking for the problem.
Kenneth
Version
web2py Version 1.89.1 (2010-11-12 15:14:36)
Python Python 2.6.5: /usr/bin/python
Traceback
Traceback (most recent call last):
File "/data/domains/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
File "/data/domains/web2py/applications/admin/controllers/default.py",
line 1146, in
File "/data/domains/web2py/gluon/globals.py", line 96, in
self._caller = lambda f: f()
File "/data/domains/web2py/applications/admin/controllers/default.py",
line 200, in upgrade_web2py
(success, error) = upgrade(request)
File "/data/domains/web2py/gluon/admin.py", line 427, in upgrade
file.close()
UnboundLocalError: local variable 'file' referenced before assignment
Error snapshot help Detailed traceback description
(local variable 'file' referenced
before assignment)






Re: [web2py] Re: experts4solutions.com again

2010-11-18 Thread Kenneth Lundström
I´m too happily employed but doing some web2py development on my spare 
time. You never know when a big,perfect job comes looking for you. If 
your not on the list it might go to somebody else.



Kenneth


A bit off topic question -
I am currently happily employed and developing web2py based open
source applications, but when this changes I might want to have a foot
in the door for finding a job hacking web2py apps.
Should i register at experts4solutions and state that I am currently
not interested in jobs or should I register when I really have the
need for it?

On Nov 18, 3:34 pm, Bruno Rocha  wrote:

humm, I just figure out that I have to click in 'no' to toggle it to yes!

not so clear.

2010/11/18 Bruno Rocha






Endorsement has only 'no' option?
You endorse: no  (your
your/no endorsement is confidential)
Where can I endorse someone?
2010/11/18 mdipierro
I have implemented an endorsement mechanism. Existing members can see

and endorse new applicants. New applications should contact existing
members by email and request an endorsement.
5 endorsements qualify for acceptance as an expert. Endorsements can
be withdrawn. Endorsements are confidential. I can override this and I
will for known web2py contributors.
You apply by simply logging in into the system.
I am happy to say that at least 3 members of the group have already
been contacted with job offers.
Please DO NOT ENDORSE users who did not post a decent picture or
profile, even if you know they are good web2py programmers.
If you have already been approved because you are a web2py contributor
but you have posted no picture, a scary picture (yes you!), or no
profile, please correct it.
Everybody can register a new affiliated company, a new project and/or
a new skill. But they I will have to approve them. I do not want to
make the list of skills too long. Projects must be based on web2py,
tested and deployed. Companies but say in the web site that they
provide web2py support (although not exclusively).
Massimo

--
Bruno Rocha
http://about.me/rochacbruno/bio

--

Bruno Rochahttp://about.me/rochacbruno/bio




Re: [web2py] Re: Migrations questions (help!)

2010-11-18 Thread Kenneth Lundström
Correct, you edit the db.py file and reload a page and the database is 
updated.



Kenneth


They are not set to false.

I'm coming from a slight rails perspective (some experience with it). In rails, 
migrations are sequential. If you want to add a field to a table, you create a 
new migration that only does that.

Regarding my question, then, do most people just edit the model (i.e., add a 
field, change a field's type, and so on)?

On Nov 18, 2010, at 14:29 , VP wrote:


Unless you have migration set to False, these things should be
automatic.



On Nov 18, 1:53 pm, Lorin Rivers  wrote:

My database is PostgreSQL

I have tables defined in my ../models/db.py

Now I want to add some fields to one of the tables defined there. The table has 
data in it already.

I tried modifying the original table definition but that didn't actually change 
the table's structure.

Where should I make these changes? I have a model (rounding.py) that creates a 
new table in the database defined in db.py. That worked after some finagling (I 
think I had to drop the table and have the model recreate it, but it didn't 
have data yet).

So what is the best method for making incremental changes to databases?

I'm stuck and need some help.

--
Lorin Rivers
Mosasaur: Killer Technical Marketing

512/203.3198 (m)




Re: [web2py] Re: Upgrade problem

2010-11-18 Thread Kenneth Lundström

Thank you Jonathan,

that solved the upgrade problem.

Problem was that I did the 'chown -R apache:web2py *' command in the 
web2py directory but that doesn't include the directory itself. So when 
Apache tried to download the new version of web2py it could not write it 
to harddisk. Sorry for this beginners mistake.


But the problem with creating a new application stays.


Kenneth


On Nov 18, 2010, at 7:03 AM, Kenneth Lundström wrote:

OK, I have no idea if they are related, it was just a thought on my part.

Kenneth, in gluon/admin.py you'll find this code:

  full_url = url + '/examples/static/web2py_%s.zip' % version_type
  filename = abspath('web2py_%s_downloaded.zip' % version_type)
  try:
  file = open(filename,'wb')
  file.write(urllib.urlopen(full_url).read())
  file.close()
  except Exception,e:
  file.close()
  return False, e
  try:
  unzip(filename, destination, subfolder)

Try removing the second file.close() (the one after 'except'), and then try the 
upgrade again. It won't fix the upgrade, but you should see a more helpful 
error message saying why the file open failed.




Kenneth


Thanks Kenneth,

the traceback you posted applies to the second problem and I
understand that. I am scratching my head on why that traceback would
also apply to the first problem.

Massimo

On Nov 18, 7:09 am, Kenneth Lundström
wrote:

- unpacked the source package
- did a chown apache:web2py on all files
- login in to admin
- write the name of the new application and press create
- get the unable to create application "test"

Upgrade problem, the same, but
- select upgrade
- press YES
- get the error ticket

I don t know what else to write.

Kenneth


I see the problem but I do not understand why you have it. This should
manifest itself when you upgrade, not when you create a new app. Can
you list steps to reproduce the problem?
I am close to fixing it...
On Nov 17, 3:31 pm, Kenneth Lundstr m
wrote:

I tried to upgrade version 1.89.1 to 1.89.3. I got the following error.
I m running Linux, Apache and mod_wsgi. Is this too an file permission
problem. I still can t create a new application with admin. Don t know
where to start looking for the problem.
Kenneth
Version
web2py Version 1.89.1 (2010-11-12 15:14:36)
Python Python 2.6.5: /usr/bin/python
Traceback
Traceback (most recent call last):
File "/data/domains/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
File "/data/domains/web2py/applications/admin/controllers/default.py",
line 1146, in
File "/data/domains/web2py/gluon/globals.py", line 96, in
self._caller = lambda f: f()
File "/data/domains/web2py/applications/admin/controllers/default.py",
line 200, in upgrade_web2py
(success, error) = upgrade(request)
File "/data/domains/web2py/gluon/admin.py", line 427, in upgrade
file.close()
UnboundLocalError: local variable 'file' referenced before assignment
Error snapshot help Detailed traceback description
(local variable 'file' referenced
before assignment)






Re: [web2py] Re: Upgrade problem

2010-11-18 Thread Kenneth Lundström
Now I finally found the problem. It looks like welcome.w2p is missing 
from the source package.


When I copied a welcome.w2p to my web2py root directory I can create 
applications.



Kenneth


On Nov 18, 2010, at 7:03 AM, Kenneth Lundström wrote:

OK, I have no idea if they are related, it was just a thought on my part.

Kenneth, in gluon/admin.py you'll find this code:

  full_url = url + '/examples/static/web2py_%s.zip' % version_type
  filename = abspath('web2py_%s_downloaded.zip' % version_type)
  try:
  file = open(filename,'wb')
  file.write(urllib.urlopen(full_url).read())
  file.close()
  except Exception,e:
  file.close()
  return False, e
  try:
  unzip(filename, destination, subfolder)

Try removing the second file.close() (the one after 'except'), and then try the 
upgrade again. It won't fix the upgrade, but you should see a more helpful 
error message saying why the file open failed.




Kenneth


Thanks Kenneth,

the traceback you posted applies to the second problem and I
understand that. I am scratching my head on why that traceback would
also apply to the first problem.

Massimo

On Nov 18, 7:09 am, Kenneth Lundström
wrote:

- unpacked the source package
- did a chown apache:web2py on all files
- login in to admin
- write the name of the new application and press create
- get the unable to create application "test"

Upgrade problem, the same, but
- select upgrade
- press YES
- get the error ticket

I don t know what else to write.

Kenneth


I see the problem but I do not understand why you have it. This should
manifest itself when you upgrade, not when you create a new app. Can
you list steps to reproduce the problem?
I am close to fixing it...
On Nov 17, 3:31 pm, Kenneth Lundstr m
wrote:

I tried to upgrade version 1.89.1 to 1.89.3. I got the following error.
I m running Linux, Apache and mod_wsgi. Is this too an file permission
problem. I still can t create a new application with admin. Don t know
where to start looking for the problem.
Kenneth
Version
web2py Version 1.89.1 (2010-11-12 15:14:36)
Python Python 2.6.5: /usr/bin/python
Traceback
Traceback (most recent call last):
File "/data/domains/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
File "/data/domains/web2py/applications/admin/controllers/default.py",
line 1146, in
File "/data/domains/web2py/gluon/globals.py", line 96, in
self._caller = lambda f: f()
File "/data/domains/web2py/applications/admin/controllers/default.py",
line 200, in upgrade_web2py
(success, error) = upgrade(request)
File "/data/domains/web2py/gluon/admin.py", line 427, in upgrade
file.close()
UnboundLocalError: local variable 'file' referenced before assignment
Error snapshot help Detailed traceback description
(local variable 'file' referenced
before assignment)






Re: [web2py] Name error, but only if I run it in view..

2010-11-19 Thread Kenneth Lundström

> {{for company in companies:}}
> 
> {{=uuid}}
> {{=address}}
> 
>{{pass}}

Shouldn´t this be like

{{=company.uuid}}
{{=company.address}}

or maybe

{{=companies[company].uuid}}
{{=campanies[company].address}}


Kenneth



[web2py] Error changing admin password

2010-11-19 Thread Kenneth Lundström

Apache, mod_wsgi, linux, MySQL, web2py 1.89.4, source

I tried to change the admin password and got this error ticket.

Error ticket for "admin"
Ticket ID

Version
web2py™ Version 1.89.4 (2010-11-19 02:50:05)
Python Python 2.6.5: /usr/bin/python
Traceback


Traceback (most recent call last):
File "/data/domains/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
File "/data/domains/web2py/applications/admin/controllers/default.py", 
line 1148, in 

File "/data/domains/web2py/gluon/globals.py", line 96, in 
self._caller = lambda f: f()
File "/data/domains/web2py/applications/admin/controllers/default.py", 
line 94, in change_password
path = os.path.join(request.env.applications_path,'parameters_%s.py' % 
request.env.server_port)

File "/usr/lib64/python2.6/posixpath.py", line 67, in join
elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'

Error snapshot help Detailed traceback description

('NoneType' object has no attribute 
'endswith')



Kenneth



[web2py] Minor fixies to admin

2010-11-19 Thread Kenneth Lundström
I created a new application with the wizard in admin. When my 
application was created I got to a page (admin/wizard/generated) where 
the first link says 'Open new app in new window' but for me it doesn´t 
open it a new windows, Windows 7 and Firefox 3.6.12.


In admin there is a help button, it opens a local copy of web2py.com. 
Wouldn´t maybe the book be better and also open it in a new page/tab. 
Because now when you are using the wizard and need help and you press 
help you go to the web2py.com page you loose all settings you just 
written, even if you try to go back.
Perfect would be if the help button would be page sensitive, so when you 
are on say step 3 in the wizard you´d get a step 3 help page.



Kenneth



[web2py] Error when using wizard to create a new application

2010-11-20 Thread Kenneth Lundström
I tried to create a new application with the wizard and when I pressed 
generate I got this error. When looking in the applictions folder all 
subfolders that should be under applications/appliction_name are in the 
applications folder. I created the folder and moved all subfolders into 
it, now that application works. When I tried again I couldn´t get the 
error, so I don´t know why this happened.



Kenneth


Version
web2py™ Version 1.89.4 (2010-11-19 02:50:05)
Python Python 2.6.5: /usr/bin/python
Traceback

Traceback (most recent call last):
File "/data/domains/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
File 
"/data/domains/web2py/applications/admin/views/wizard/generated.html", 
line 61, in 

File "/data/domains/web2py/gluon/html.py", line 228, in _URL
return URL(*args, **kwargs)
File "/data/domains/web2py/gluon/html.py", line 188, in URL
raise SyntaxError, 'not enough information to build the url'
SyntaxError: not enough information to build the url

Error snapshot help Detailed traceback description

(not enough information to build the url)

inspect attributes
Exception instance attributes
__getslice__ object>

text None
__str__ 
__getattribute__ exceptions.SyntaxError object>

__dict__ {}
__sizeof__ 
__init__ 
__setattr__ 
__reduce_ex__ object>

__new__ 
__format__ 
__class__ 
filename None
lineno None
msg 'not enough information to build the url'
__doc__ 'Invalid syntax.'
__getitem__ 
__setstate__ 
__reduce__ 
print_file_and_line None
args ('not enough information to build the url',)
__subclasshook__ 
offset None
__unicode__ 
__delattr__ 
__repr__ 
__hash__ 
Frames

*

File /data/domains/web2py/gluon/restricted.py in restricted at line 188 
code arguments variables

Function argument list

(code='response.write(\'\\n
Code listing


if type(code) == types.CodeType:
ccode = code
else:
ccode = compile2(code,layer)

exec ccode in environment

except HTTP:
raise
except Exception:
# XXX Show exception in Wing IDE if running in debugger

Variables
environment {'A': , 'ALLOW_TOGGLE': 'true', 'B': 
, 'BEAUTIFY': , 
'BODY': , 'BR': , 
'CENTER': , 'CHECK_VERSION': True, 'CLEANUP': 
, 'CODE': , ...}
ccode  at 0x2b9adfe78300, file 
"/...tions/admin/views/wizard/generated.html", line 1>

*

File /data/domains/web2py/applications/admin/views/wizard/generated.html 
in  at line 61 code arguments variables

Function argument list

()
Code listing

52.
53.
54.
55.
56.
57.
58.
59.
60.
61.

62.
63.
64.
65.
66.
67.
68.
69.
70.
71.



response.write('\n ', escape=False)
pass
response.write('\n \n ', escape=False)
pass
response.write('\n \n \n \n 
', escape=False)

response.write(response.flash or '')
response.write('\n ', escape=False)
response.write('\n\n', escape=False)
response.write('\n\nOpen new app in new window\nhref="', escape=False)

response.write(URL('step1'))
response.write('">Back to wizard\n
response.write(URL('default','design',args=app))
response.write('">Admin design page\n', escape=False)
if have_mercurial:
response.write('\nAdmin versioning page\n', escape=False)
pass

Variables
*

File /data/domains/web2py/gluon/html.py in _URL at line 228 code 
arguments variables

Function argument list

(*args=('', 'default', 'index'), **kwargs={})
Code listing

223.
224.
225.
226.
227.
228.

229.
230.
231.
232.



kwargs['f'] = args[0]
args = []
if len(args) == 2 and not 'f' in kwargs and not 'c' in kwargs:
kwargs['c'], kwargs['f'] = args[0], args[1]
args = []
return URL(*args, **kwargs)

_URL.__doc__ = URL.__doc__
return _URL

Variables
global URL 
args ('', 'default', 'index')
kwargs {}
*

File /data/domains/web2py/gluon/html.py in URL at line 188 code 
arguments variables

Function argument list

(a='', c='default', f='index', r=None, args=[], vars={}, anchor='', 
extension=None, env=None)

Code listing




function, extension = f.split('.',1)
else:
function = f

if not (application and controller and function):
raise SyntaxError, 'not enough information to build the url'


other = ''
if args != [] and not isinstance(args, (list, tuple)):
args = [args]

Variables
builtinSyntaxError 



[web2py] Admin comments

2010-11-20 Thread Kenneth Lundström
Admin first page, why is the edit button black when all the others are 
grey? It looks like the edit button is allready pressed.


On page /admin/wizard/step5/0:
Use the markmin syntax syntax to add text to your pages.

maybe one syntax is enough.

Am I doing something wrong when I´m create a new application with the 
wizard and select a layout from the drop down. A small picture of the 
layout is shown. After I have generated the application I go and look at 
it, but the layout I selected is not applied. Something wrong?


It would be nice if you could click on the small picture that show the 
layout to see a bigger picture.



Kenneth



Re: [web2py] Re: Admin comments

2010-11-20 Thread Kenneth Lundström

> because edit is more important. Is it really confusing?

Me first impression when I looked at admin was that Edit is active, but 
I pressed Edit anyhow when I couldn't find any other way to edit it and 
voilá I found the place. Not an big deal.


Any comments about the layout not showing?


Kenneth


Fixed the typo, thanks.

On Nov 20, 2:41 am, Kenneth Lundström
wrote:

Admin first page, why is the edit button black when all the others are
grey? It looks like the edit button is allready pressed.

On page /admin/wizard/step5/0:
Use the markmin syntax syntax to add text to your pages.

maybe one syntax is enough.

Am I doing something wrong when I m create a new application with the
wizard and select a layout from the drop down. A small picture of the
layout is shown. After I have generated the application I go and look at
it, but the layout I selected is not applied. Something wrong?

It would be nice if you could click on the small picture that show the
layout to see a bigger picture.

Kenneth




Re: [web2py] Re: Admin comments

2010-11-21 Thread Kenneth Lundström
I have tried 2 or 3 different layouts, non of them worked. Which files 
are updated?


Is it possible from the Admin to change the layout later on?


Kenneth


Is this for one particular layout?

On Nov 20, 8:53 am, Kenneth Lundström
wrote:

  >  because edit is more important. Is it really confusing?

Me first impression when I looked at admin was that Edit is active, but
I pressed Edit anyhow when I couldn't find any other way to edit it and
voil I found the place. Not an big deal.

Any comments about the layout not showing?

Kenneth


Fixed the typo, thanks.
On Nov 20, 2:41 am, Kenneth Lundstr m
wrote:

Admin first page, why is the edit button black when all the others are
grey? It looks like the edit button is allready pressed.
On page /admin/wizard/step5/0:
Use the markmin syntax syntax to add text to your pages.
maybe one syntax is enough.
Am I doing something wrong when I m create a new application with the
wizard and select a layout from the drop down. A small picture of the
layout is shown. After I have generated the application I go and look at
it, but the layout I selected is not applied. Something wrong?
It would be nice if you could click on the small picture that show the
layout to see a bigger picture.
Kenneth






Re: [web2py] Admin password change 1.88.2

2010-11-21 Thread Kenneth Lundström

I´m getting the exact same error, on 1.89.4 and python 2.6.5

Apache, linux, mod_wsgi, mysql


Kenneth


Can't change admin password in new version. See traceback below..

--
VERSION web2py™ Version 1.88.2 (2010-10-29 23:04:43)
Python  Python 2.5.2: /usr/bin/python
TRACEBACK

Traceback (most recent call last):
   File "/home/www-data/web2py/gluon/restricted.py", line 188, in
restricted
 exec ccode in environment
   File "/home/www-data/web2py/applications/admin/compiled/
controllers_default_change_password.py", line 1148, in
   File "/home/www-data/web2py/gluon/globals.py", line 96, in
 self._caller = lambda f: f()
   File "/home/www-data/web2py/applications/admin/compiled/
controllers_default_change_password.py", line 94, in change_password
   File "/usr/lib/python2.5/posixpath.py", line 62, in join
 elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'




Re: [web2py] web2py 1.89.5 is OUT

2010-11-22 Thread Kenneth Lundström

Problem with change admin password is gone

but problem with layout not being applied is still active. Now I have 
tried 3-4 different layouts, none is applied.
This is a relative fresh installation of web2py, maybe 1.88 something 
this is my test installation. Then I have my main application that 
started two years ago that I have now upgraded to 1.89.5. I just tested 
to create a new application there and applying layout works.



Kenneth



minor bug fixes, addressing some of the recently raised issues, please

check it and report any open issue.




Re: [web2py] Re: web2py 1.89.5 is OUT

2010-11-22 Thread Kenneth Lundström

> Can you clarify what does this mean?

When I select a layout when using the wizard to create a new application 
the layout is not applied. It shows the application without the layout I 
have selected.



Kenneth

This is a relative fresh installation of web2py, maybe 1.88 something
this is my test installation. Then I have my main application that
started two years ago that I have now upgraded to 1.89.5. I just tested
to create a new application there and applying layout works.

Kenneth

minor bug fixes, addressing some of the recently raised issues, please


check it and report any open issue.






Re: [web2py] Re: web2py SSL + Apache + mod_wsgi issues on Ubuntu 8.08 VM machine

2010-11-23 Thread Kenneth Lundström
I´d say that warning messing in your log is not your problem. It should 
work even if you get those warnings. At least for me it does.


Your are receiving that warning because your certifcate is for domain 
pypy.domain.com but in your configuration your are talking about an 
ip-address.


What kind of a problems do you have?


Kenneth


I ran into a problem with setting up SSL too which turned out to be
caused by an ssl.conf file that was overriding the web2py.conf
settings. I had similar messages in error.log, but as the [warn]
indicates, they do not seem to be fatal errors. The errors I found
were more like File does not exist.

On Nov 22, 4:38 pm, Hybride  wrote:

Hi everyone,

I have my head wrapped up with trying to set up SSL for web2py. I
used, at first, the initial one-step deployment available for Ubuntu/
debian servers. The SSL was the issue then, so I went through the
entire step-by-step available on the official book. I still can't seem
to get SSL to work. I use an ubuntu 8.08 virtual machine, apache +
mod_wsgi.

This is the results of uname: pypy.domain.com 2.6.24-21-xen #1 SMP
x86_64 GNU/Linux
I have "Listen 80" and "Listen 443" in my ports.conf

And this is my web2py:

   ServerNamehttp://147.126.65.92/
   #WSGIDaemonProcess web2py user=www-data group=www-data \
 #   display-name=%{GROUP}
   WSGIProcessGroup web2py
   WSGIScriptAlias / /home/www-data/web2py/wsgihandler.py

   
 AllowOverride None
 Order Allow,Deny
 Deny from all
 
   Allow from all
 
   

   AliasMatch ^/([^/]+)/static/(.*) \
/home/www-data/web2py/applications/$1/static/$2
   
 Order Allow,Deny
 Allow from all
   

   
   Deny from all
   

   
   Deny from all
   

   CustomLog /private/var/log/apache2/access.log common
   ErrorLog /private/var/log/apache2/error.log



   ServerNamehttp://147.126.65.92/
   SSLEngine on

   SSLCertificateFile /etc/apache2/ssl/server.crt
   SSLCertificateKeyFile /etc/apache2/ssl/server.key

   SSLProtocol -all +TLSv1 +SSLv3
   SSLCipherSuite HIGH:MEDIUM:!aNULL:+SHA1:+MD5:+HIGH:+MEDIUM

   WSGIProcessGroup web2py

   WSGIScriptAlias / /home/www-data/web2py/wsgihandler.py

   
 AllowOverride None
 Order Allow,Deny
 Deny from all
 
   Allow from all
 
   

   AliasMatch ^/([^/]+)/static/(.*) \
 /home/www-data/web2py/applications/$1/static/$2

   
 Order Allow,Deny
 Allow from all
   

   CustomLog /private/var/log/apache2/access.log common
   ErrorLog /private/var/log/apache2/error.log

   SSLVerifyClient none
   SSLProxyEngine off

   
   AddType application/x-x509-ca-cert  .crt
   AddType application/x-pkcs7-crl .crl
   



The result of my error.log is:

[Mon Nov 22 18:23:25 2010] [warn] RSA server certificate CommonName
(CN) `pypy.domain.com' does NOT match server name!?

Whether this is the common name or the IP name. Any and all help
appreciated.




Re: [web2py] Re: web2py 1.89.5 is OUT

2010-11-23 Thread Kenneth Lundström
Not for me, I just tested to create a new application with the wizard, I 
selected the layout and submitted. I can see on the left that the layout 
has been selected. Then I just to be sure clicked submit on the next two 
steps. After that I selected go! in Generate but no layout is applied.


I found the problem, I had no deposit folder in my web2py root folder. I 
don´t know when it should have been created but I created it now by hand 
and not it works.



Kenneth


2010/11/22 Kenneth Lundström :

Can you clarify what does this mean?

When I select a layout when using the wizard to create a new application the
layout is not applied. It shows the application without the layout I have
selected.

This only happened to me if I skipped the very first step. If I
properly submit the first step, the layout is applied.





[web2py] TOP10 list

2010-11-23 Thread Kenneth Lundström

Hello list,

I´m trying to make a TOP10 list but don´t know how :=(

First I select the partners:
partners = db(db.partners.id > 0).select()

for partner in partners:
sales = db(db.sales.partner == partner).select()

make some calculations and get a value for the customer. Where 
do I store this value and how do I sort the list of partners so I get a 
TOP10 list?


Somehow this doesn´t feel like a big deal to implement but can´t get 
started.



Kenneth


Re: [web2py] Re: TOP10 list

2010-11-23 Thread Kenneth Lundström
Calculation is a lot more complicated then just a sum. I have to select 
data from 3-4 tables and then do the calculations.


Maybe your second suggestion is the solution.  How would you maintain 
the list so ten biggest rows is on the list and the list stays in 
correct order?



Kenneth


Depending on how complicated the calculation is, you can *may* be able
to do the calculation in the DAL.  If it's just a simple sum, you can
use SUM(), then then orderby descending the SUM() amount and
limitby=(0,10).

Otherwise, you could always create a sorted List and as you iterate
through each row, keep track of the top 10 largest rows.  Of course,
the first approach may be much easier :)




Re: [web2py] Re: web2py SSL + Apache + mod_wsgi issues on Ubuntu 8.08 VM machine

2010-11-23 Thread Kenneth Lundström
> It's the standard "You don't have permission to access 
/admin/default/  index on this server." I know it's silly, and I've went 
through most of the files available on how to supposedly fix this, but I 
can't seem to get it to work.


You seem to have two different problems. I tried to access address 
http://147.126.65.92/admin and got the "You don't have permission to 
access /admin/default/index on this server." error message, this sounds 
like the admin application is not installed or your webserver is not 
allowed to read the /applications/admin folder. Look at your file 
permissions on /applications folder.


If webserver could access the applications/admin folder you should get a 
"Admin is disabled because insecure channel" messages.



As admin should be accessed via https I tried to access 
https://147.126.65.92/admin but could not get a response from your 
server. Smells like a firewall issue. Port 443 should be open.



Kenneth


Your are receiving that warning because your certifcate is for domain
pypy.domain.com but in your configuration your are talking about an
ip-address.

This is a university computer, so I actually don't have a real domain
name, it's only IP-based (I can't access the domain name through a
browser, but I can access the IP, which is http://147.126.65.92/).
Even if I put the certificate for pypy.domain.com, I come up with the
certificate error. I thought it might be an issue, that's why I posted
it.

On Nov 23, 2:07 am, Kenneth Lundström
wrote:

I d say that warning messing in your log is not your problem. It should
work even if you get those warnings. At least for me it does.

Your are receiving that warning because your certifcate is for domain
pypy.domain.com but in your configuration your are talking about an
ip-address.

What kind of a problems do you have?

Kenneth


I ran into a problem with setting up SSL too which turned out to be
caused by an ssl.conf file that was overriding the web2py.conf
settings. I had similar messages in error.log, but as the [warn]
indicates, they do not seem to be fatal errors. The errors I found
were more like File does not exist.




Re: [web2py] Re: web2py SSL + Apache + mod_wsgi issues on Ubuntu 8.08 VM machine

2010-11-24 Thread Kenneth Lundström
Are the group and ownership of the files in /applicatios/admin correct. 
Could you send a copy of the error file as I can´t access it from 
outside without a password and not when admin is no working.



Kenneth


Open this file with an editor

/home/www-data/web2py/applications/admin/errors/
76.192.187.2.2010-11-24.10-52-27.f3c370f6-8a25-4dc6-b496-ae1178050333

The traceback is the end of the file.

On Nov 24, 11:06 am, Hybride  wrote:

You seem to have two different problems. I tried to access 
addresshttp://147.126.65.92/adminandgot the "You don't have permission to
access /admin/default/index on this server." error message, this sounds
like the admin application is not installed or your webserver is not
allowed to read the /applications/admin folder. Look at your file
permissions on /applications folder.
If webserver could access the applications/admin folder you should get a
"Admin is disabled because insecure channel" messages.

I received that error when I tried to disable SSL admin access, but
not otherwise. I have 755 permissions on the /applications folder.


As admin should be accessed via https I tried to 
accesshttps://147.126.65.92/adminbutcould not get a response from your
server. Smells like a firewall issue. Port 443 should be open.

I've opened up Port 443, and now I get this issue logging into the
https:/admin:

Internal error
Ticket issued: admin/
76.192.187.2.2010-11-24.10-52-27.f3c370f6-8a25-4dc6-b496-ae1178050333

For some reason, it's just the admin folder now. I tried accessing the
site using https:// and it works normally, it's only the
administration folders I have an issue with now.




Re: [web2py] Re: change in trunk needs testing

2010-11-26 Thread Kenneth Lundström
If you have access to the file system you can find the error ticket in 
the folder /applications/admin/errors



Kenneth


I tried the last version in trunk, and the admin application generates
a ticket... and looking at the ticket generates another ticket! (which
is the reason why I cannot provide a traceback).
But the other applications appear to work fine.

On 25 nov, 17:20, mdipierro  wrote:

Perfect! Thanks Mr Freeze.

On Nov 25, 10:18 am, "mr.freeze"  wrote:


It seems to be working. I open one in IE and another in Firefox about
2 seconds later. After the IE page loads, the Firefox page loads about
2 seconds later. Is that what you're looking for?
On Nov 25, 10:09 am, mdipierro  wrote:

At least we know it is being executed. :-)
I think I fixed this one. Please try again.
Massimo
On Nov 25, 9:53 am, "mr.freeze"  wrote:

Traceback (most recent call last):
   File "C:\eclipse\plugins
\org.python.pydev.debug_1.6.3.2010100513\pysrc\pydevd.py", line 1145,
in
 debugger.run(setup['file'], None, None)
   File "C:\eclipse\plugins
\org.python.pydev.debug_1.6.3.2010100513\pysrc\pydevd.py", line 916,
in run
 execfile(file, globals, locals) #execute the script
   File "C:\web2py\web2py.py", line 23, in
 gluon.widget.start(cron=True)
   File "C:\web2py\gluon\widget.py", line 785, in start
 newcron.hardcron(options.folder).start()
   File "C:\web2py\gluon\newcron.py", line 50, in __init__
 crondance(self.path, 'hard', startup=True)
   File "C:\web2py\gluon\newcron.py", line 234, in crondance
 cronmaster = token.acquire(startup=startup)
   File "C:\web2py\gluon\newcron.py", line 118, in acquire
 portalocker.unlock(self.master)
   File "C:\web2py\gluon\portalocker.py", line 78, in unlock
 msvcrt.locking(file.fileno(), mode,
os.path.getsize(file.filename))
AttributeError: 'file' object has no attribute 'filename'
On Nov 25, 9:31 am, mdipierro  wrote:

can you please try again.
On Nov 24, 11:04 pm, Anthony  wrote:

Is the test supposed to be done without the win32 extensions installed
(I have them installed)?
Anyway, I tried the test. Before updating trunk, it behaves as you say
-- I opened two windows in quick succession -- the first took 10
seconds to load, and then the second took an additional 10 seconds to
load after the first one finished.
I then updated trunk, and now can't start web2py -- getting the
following traceback:
   Traceback (most recent call last):
   File "web2py.py", line 23, in  gluon.widget.start(cron=True)
   File "C:\Users\Anthony\Programming\temp\gluon\widget.py", line 785,
in start newcron.hardcron(options.folder).start()
   File "C:\Users\Anthony\Programming\temp\gluon\newcron.py", line 50,
in __init__ crondance(self.path, 'hard', startup=True)
   File "C:\Users\Anthony\Programming\temp\gluon\newcron.py", line 234,
in crondance cronmaster = token.acquire(startup=startup)
   File "C:\Users\Anthony\Programming\temp\gluon\newcron.py", line 118,
in acquire portalocker.unlock(self.master)
   File "C:\Users\Anthony\Programming\temp\gluon\portalocker.py", line
76, in unlock file.fseek(0)
   AttributeError: 'file' object has no attribute 'fseek'
Anthony
On Nov 24, 11:26 pm, mdipierro  wrote:

I made a change that on windows will provide locking without need for
MH win32 extensions.
Can you help me test it.
Make a log action like
def index():
   import time
   time.sleep(10)
   return dict()
call it twice (on windows) from different browser windows. Will the
second window lock until the former is done? should be locked because
session is locked with file-locking.
test before upgrade to trunk and after.
Massimo






Re: [web2py] Re: change in trunk needs testing

2010-11-26 Thread Kenneth Lundström

Please send it, it´s the only way to find out what the problem is.


Kenneth



Thank you Kenneth!

I must admit the file is difficult to analyze manually -- I'm happy to
send it as an attachement if useful.

On 26 nov, 09:21, Kenneth Lundström
wrote:

If you have access to the file system you can find the error ticket in
the folder /applications/admin/errors

Kenneth


I tried the last version in trunk, and the admin application generates
a ticket... and looking at the ticket generates another ticket! (which
is the reason why I cannot provide a traceback).
But the other applications appear to work fine.
On 25 nov, 17:20, mdipierrowrote:

Perfect! Thanks Mr Freeze.
On Nov 25, 10:18 am, "mr.freeze"wrote:

It seems to be working. I open one in IE and another in Firefox about
2 seconds later. After the IE page loads, the Firefox page loads about
2 seconds later. Is that what you're looking for?
On Nov 25, 10:09 am, mdipierrowrote:

At least we know it is being executed. :-)
I think I fixed this one. Please try again.
Massimo
On Nov 25, 9:53 am, "mr.freeze"wrote:

Traceback (most recent call last):
File "C:\eclipse\plugins
\org.python.pydev.debug_1.6.3.2010100513\pysrc\pydevd.py", line 1145,
in
  debugger.run(setup['file'], None, None)
File "C:\eclipse\plugins
\org.python.pydev.debug_1.6.3.2010100513\pysrc\pydevd.py", line 916,
in run
  execfile(file, globals, locals) #execute the script
File "C:\web2py\web2py.py", line 23, in
  gluon.widget.start(cron=True)
File "C:\web2py\gluon\widget.py", line 785, in start
  newcron.hardcron(options.folder).start()
File "C:\web2py\gluon\newcron.py", line 50, in __init__
  crondance(self.path, 'hard', startup=True)
File "C:\web2py\gluon\newcron.py", line 234, in crondance
  cronmaster = token.acquire(startup=startup)
File "C:\web2py\gluon\newcron.py", line 118, in acquire
  portalocker.unlock(self.master)
File "C:\web2py\gluon\portalocker.py", line 78, in unlock
  msvcrt.locking(file.fileno(), mode,
os.path.getsize(file.filename))
AttributeError: 'file' object has no attribute 'filename'
On Nov 25, 9:31 am, mdipierrowrote:

can you please try again.
On Nov 24, 11:04 pm, Anthonywrote:

Is the test supposed to be done without the win32 extensions installed
(I have them installed)?
Anyway, I tried the test. Before updating trunk, it behaves as you say
-- I opened two windows in quick succession -- the first took 10
seconds to load, and then the second took an additional 10 seconds to
load after the first one finished.
I then updated trunk, and now can't start web2py -- getting the
following traceback:
Traceback (most recent call last):
File "web2py.py", line 23, ingluon.widget.start(cron=True)
File "C:\Users\Anthony\Programming\temp\gluon\widget.py", line 785,
in start newcron.hardcron(options.folder).start()
File "C:\Users\Anthony\Programming\temp\gluon\newcron.py", line 50,
in __init__ crondance(self.path, 'hard', startup=True)
File "C:\Users\Anthony\Programming\temp\gluon\newcron.py", line 234,
in crondance cronmaster = token.acquire(startup=startup)
File "C:\Users\Anthony\Programming\temp\gluon\newcron.py", line 118,
in acquire portalocker.unlock(self.master)
File "C:\Users\Anthony\Programming\temp\gluon\portalocker.py", line
76, in unlock file.fseek(0)
AttributeError: 'file' object has no attribute 'fseek'
Anthony
On Nov 24, 11:26 pm, mdipierrowrote:

I made a change that on windows will provide locking without need for
MH win32 extensions.
Can you help me test it.
Make a log action like
def index():
import time
time.sleep(10)
return dict()
call it twice (on windows) from different browser windows. Will the
second window lock until the former is done? should be locked because
session is locked with file-locking.
test before upgrade to trunk and after.
Massimo






Re: [web2py] Re: LMS experimenting

2010-11-28 Thread Kenneth Lundström
If there is nothing else on the market and it costs enough (it has to be 
good).



Kenneth


Learning Scorm what a crappy protocol:

1) it is a method for zipping lectures and metadata
2) lectures are in html and are vulnerable to XSS
3) mixes content and presentation
4) can contain quizzes (defined in the JS). students can find the
right answers by looking in the page source code.
5) completely unreadable because of many XML files with incomplete
specs.

I cannot believe everybody uses this.

Massimo



On Nov 28, 10:46 am, mdipierro  wrote:

I am taking a second look at SCORM, the de-facto standard for creating
e-learning content, supported by all major LMSes. Looks like there is
only one engine that can parse SCORM files and it is commercial/closed
source.

This cannot be good for education.

Massimo

On Nov 28, 5:03 am, blye  wrote:


I was researching LMS type stuff around the net and found eXe, a very
attractive open source tool for creating Lessons ( standards
compliant ) and generating the result as a sequence of html pages and
resources. exeLearning.orgor  core-ed.net.
I am experimenting to see if the eXe pages can be 'wrapped' in web2py
ie.
Idea
web2py app maintains a table of categories and a table of lesson
titles in these categories. This is fairly standard.
  the user can then select and hopefully start a Lesson
1. is it possible to shell out to the lesson index.html from web2py?
( run the set of html files stored in local folder in separate browser
window).
(( the lesson is obviously Not a web2py app itself.))
Where and how should the Lesson resources be stored and referenced
from web2py field? (All eXe generated lessons begin with index.html)
My trials with redirect and static have not worked. :-(
2. It would also need to upload a zip file and unzip it into folder.
( still researching this  :-/
I suppose the ultimate idea is for the user to be able to upload
lessons created with eXe for other users to download and use.
Any ideas welcome.
strength to the LMS mill!






[web2py] Using swedish special characters åäö

2010-11-28 Thread Kenneth Lundström
I have no problem using åäö when reading and writing these characters 
from database, also no problem displaying them on screen.


But when sending them to a CSV file and opening it in Excel åäö are not 
shown correctly.


Has anybody succeeded in this?


Kenneth



Re: [web2py] Re: Using swedish special characters å äö

2010-11-29 Thread Kenneth Lundström

Hello Mirek,

thank you for your example. In my case it didn´t help. If I look at the 
file in Notepad åäö are shown correctly by when opening the file by 
dubble clicking it opens Excel but åäö aren´t shown correctly, for some 
reason Excel uses "wrong" charset, if I import the file to Excel with 
wizard I can select correct charset adn everything is shown correctly.


But customer want´s to make as easy as possible to open the file. Maybe 
I have to scan all texts and replace åäö with another special character 
that opens correctly in Excel.


I wrote åäö in Excel and saved it as an CSV, when looking at the file in 
notepad I can find out what character to replace with.



Kenneth

def __responseHeaders(fName=None):
 response.headers['Content-Type'] = 'text/csv; charset=utf-8'
 # duplicita s gluon\main.py, ale Expires se tam dělá pomocí time
objektu
 response.headers['Cache-Control'] = 'no-store, no-cache, must-
revalidate, post-check=0, pre-check=0'
 #response.headers['Cache-Control'] = 'no-cache, private, no-store,
must-revalidate, max-stale=0, post-check=0, pre-check=0'
 response.headers['Expires'] =
datetime.datetime.utcnow().strftime('%a, %d %b %Y %H:%M:%S GMT')  #
Tue, 02 Nov 2010 08:15:33 GMT
# nebo lze .Expires = -1
 response.headers['Pragma'] = 'no-cache'
 if fName:
 response.headers['Content-disposition'] = 'attachment;
filename="' + fName + '"'




[web2py] Server slow

2010-12-02 Thread Kenneth Lundström

Hello list,

need some help finding out why my server is so slow.

The server is with a Intel Celeron 2.66 GHz CPU, 4 GB of memory
CentOS 5.5 64-bit, Apache 2.2.3, MySQL 5.0.77, mod_wsgi, Web2py 1.89.5
The server is dedicated to web2py, there is three instances of web2py 
running.


I have migrate=False, sessions on disc.

If I try the following code

def testing():
customers = db(db.customer.id > 0).select()
return customers

takes 39 seconds, 5 times in a row, to return 979 rows.

If I put db.customer < 100 it takes 4,5 seconds to return 87 rows.

Is it just me or are this a bit long times?


Kenneth



[web2py] Re: Server slow

2010-12-02 Thread Kenneth Lundström

Of course I forgot something,

python 2.6.5


Kenneth


Hello list,

need some help finding out why my server is so slow.

The server is with a Intel Celeron 2.66 GHz CPU, 4 GB of memory
CentOS 5.5 64-bit, Apache 2.2.3, MySQL 5.0.77, mod_wsgi, Web2py 1.89.5
The server is dedicated to web2py, there is three instances of web2py 
running.


I have migrate=False, sessions on disc.

If I try the following code

def testing():
customers = db(db.customer.id > 0).select()
return customers

takes 39 seconds, 5 times in a row, to return 979 rows.

If I put db.customer < 100 it takes 4,5 seconds to return 87 rows.

Is it just me or are this a bit long times?


Kenneth





Re: [web2py] Re: Server slow

2010-12-02 Thread Kenneth Lundström
> Please tell us more about the setup. Are the three instances behind 
running on the same server?


Yes.

> why three? What do they do?

One is production, one is testing and last one is development. I had two 
instances running on a virtual server before and it worked fine.


> This is not normal but I suspect the problem is with database.
> Did you set DAL(...,pool_size=10)?

No, but I tried but no change.

If I try to select more rows:
def testing():
orders = db(db.orders.id > 0).select()
return orders

It takes 80 seconds to return 1608 rows.

If I change the return to return len(troops) it only takes 1,5 seconds.

I have no view defined, just trying out the database.


Kenneth




On Dec 2, 5:13 am, Kenneth Lundström
wrote:

Hello list,

need some help finding out why my server is so slow.

The server is with a Intel Celeron 2.66 GHz CPU, 4 GB of memory
CentOS 5.5 64-bit, Apache 2.2.3, MySQL 5.0.77, mod_wsgi, Web2py 1.89.5
The server is dedicated to web2py, there is three instances of web2py
running.

I have migrate=False, sessions on disc.

If I try the following code

def testing():
  customers = db(db.customer.id>  0).select()
  return customers

takes 39 seconds, 5 times in a row, to return 979 rows.

If I put db.customer<  100 it takes 4,5 seconds to return 87 rows.

Is it just me or are this a bit long times?

Kenneth




Re: [web2py] Re: Server slow

2010-12-02 Thread Kenneth Lundström

> When you test is that the only active connection to the db?

I tested it on an application running on the test instance. There could 
have been lite activity one production site.
But when I tested loading the same function five times in about 10 
minutes I allways 39 seconds to load the data.



Kenneth



2010/12/2 Kenneth Lundström:

Please tell us more about the setup. Are the three instances behind
running on the same server?

Yes.


why three? What do they do?

One is production, one is testing and last one is development. I had two
instances running on a virtual server before and it worked fine.


This is not normal but I suspect the problem is with database.
Did you set DAL(...,pool_size=10)?

No, but I tried but no change.

If I try to select more rows:
def testing():
orders = db(db.orders.id>  0).select()
return orders

It takes 80 seconds to return 1608 rows.

If I change the return to return len(troops) it only takes 1,5 seconds.

I have no view defined, just trying out the database.


Kenneth



On Dec 2, 5:13 am, Kenneth Lundström
wrote:

Hello list,

need some help finding out why my server is so slow.

The server is with a Intel Celeron 2.66 GHz CPU, 4 GB of memory
CentOS 5.5 64-bit, Apache 2.2.3, MySQL 5.0.77, mod_wsgi, Web2py 1.89.5
The server is dedicated to web2py, there is three instances of web2py
running.

I have migrate=False, sessions on disc.

If I try the following code

def testing():
  customers = db(db.customer.id>0).select()
  return customers

takes 39 seconds, 5 times in a row, to return 979 rows.

If I put db.customer<100 it takes 4,5 seconds to return 87 rows.

Is it just me or are this a bit long times?

Kenneth






Re: [web2py] Re: Server slow

2010-12-03 Thread Kenneth Lundström

Were is this logged, I could not find anything in any logs?


Kenneth


try

import time, logging

def testing():
 t0=time.time()
 orders = db(db.orders.id>  0).select()
 logging.info('time to fetch %s' % (time.time()-t0))
 return orders

so you can isolate the problem and see if it is in fetching or
somewhere else (for example session locking).


On Dec 2, 4:21 pm, Kenneth Lundström
wrote:

  >  When you test is that the only active connection to the db?

I tested it on an application running on the test instance. There could
have been lite activity one production site.
But when I tested loading the same function five times in about 10
minutes I allways 39 seconds to load the data.

Kenneth




2010/12/2 Kenneth Lundström:

Please tell us more about the setup. Are the three instances behind
running on the same server?

Yes.

why three? What do they do?

One is production, one is testing and last one is development. I had two
instances running on a virtual server before and it worked fine.

This is not normal but I suspect the problem is with database.
Did you set DAL(...,pool_size=10)?

No, but I tried but no change.
If I try to select more rows:
def testing():
 orders = db(db.orders.id>0).select()
 return orders
It takes 80 seconds to return 1608 rows.
If I change the return to return len(troops) it only takes 1,5 seconds.
I have no view defined, just trying out the database.
Kenneth

On Dec 2, 5:13 am, Kenneth Lundström
wrote:

Hello list,
need some help finding out why my server is so slow.
The server is with a Intel Celeron 2.66 GHz CPU, 4 GB of memory
CentOS 5.5 64-bit, Apache 2.2.3, MySQL 5.0.77, mod_wsgi, Web2py 1.89.5
The server is dedicated to web2py, there is three instances of web2py
running.
I have migrate=False, sessions on disc.
If I try the following code
def testing():
   customers = db(db.customer.id>  0).select()
   return customers
takes 39 seconds, 5 times in a row, to return 979 rows.
If I put db.customer<  100 it takes 4,5 seconds to return 87 rows.
Is it just me or are this a bit long times?
Kenneth






Re: [web2py] Deploying a site powered by web2py.

2010-12-04 Thread Kenneth Lundström

Hello,

have you read the web2py book, specifically chapter 11, 
http://web2py.com/book/default/chapter/11 it should tell the most.


If you still have questions will try to answer them.


Kenneth


Now I do understand that I am probably asking a very rudimentary
question but in the end I need a rudimentary answer that I am just not
finding. Or if I am finding I don't know what i am looking at.

A little background: I have experience in Python and in Web Design,
not much in the incorporation of the two which is the main reason I
have looked into Web2py. I am needing to build a website that is rich
in features that HTML and CSS just can not handle and I need to be
able to program it fast. Now I can get Web2py working on my Local
computer just fine, no problem. I am even jumping into the actual
development rather quickly and easily. The framework is really
extremely helpful in the quick implementation of code and I am very
grateful that it exists.

Before I get too far in the programming and development of the site
that is needed I needed to make sure that I can get it hosted on the
internet and that it will work, and this is where it falls down. I
have only ever worked in html, xhtml, css, or javascript when it comes
to the internet and I do not understand the intricacies of apache or
wsgi or CGI at all. I am currently having a mental block on this area
and it is causing me intense frustration.

Simply put, how do I setup web2py coming from my webhost (in this case
www.site5.com) I have setup a virtual enviroment and unzipped the
source of web2py on the website. I can run the script web2py.py and
get it to prompt that it is running a server but I do not know how to
access it and I am under the impression that the web2py.py script is
really made for development not deployment of websites.

It should be noted that one of the main features I need is automated
database evaluation and manipulation.

Any help is extremely welcomed and I would be most grateful. I am
simply running out of time to be stumped by what is most likely a
simple issue.




Re: [web2py] Re: Deploying a site powered by web2py.

2010-12-04 Thread Kenneth Lundström

Hi Ryan,

you can find a fcgihandler.py file in the root web2py folder. I havn't 
used fcgi but the fcgihandler seems to have an example on how webserver 
should be configured.



Kenneth



Thanks for the responses guys. I read all of chapter 11 and I must say
this is why I feel like really am missing something important in the
grand scheme of things. I simply can not understand what it is I need
to do.

I do not have root access so I can't do anything that requires it or
sudo, so I looked on the SITE5 forums like was suggested and looked
for a django setup thread. I found one and feel like I could follow
its steps but honestly I just don't get what needs to be done for a
web2py website to work and therefor I can not figure out the changes
that need to be made.

I need to use FCGI like Brian pointed out but I don't understand the
contexts.

Is there anyway someone could give me a rudimentary check list of what
needs to be done for a website to work, and perhaps examples or
specific links on how to do each step?

What does a fcgi file need to look like for web2py? What files need to
be directly in the www folder (public_html).

-Ryan

On Dec 4, 1:42 pm, Brian M  wrote:

Check the site5 forums for hints, it looks like wsgi isn't available
on the shared hosting plans but fastcgi is. There are some Django how
to threads you may be able to work off of and combine with what's in
chapter 11 of the web2py book.

~Brian

On Dec 3, 11:21 pm, RyaneD  wrote:








Now I do understand that I am probably asking a very rudimentary
question but in the end I need a rudimentary answer that I am just not
finding. Or if I am finding I don't know what i am looking at.
A little background: I have experience in Python and in Web Design,
not much in the incorporation of the two which is the main reason I
have looked into Web2py. I am needing to build a website that is rich
in features that HTML and CSS just can not handle and I need to be
able to program it fast. Now I can get Web2py working on my Local
computer just fine, no problem. I am even jumping into the actual
development rather quickly and easily. The framework is really
extremely helpful in the quick implementation of code and I am very
grateful that it exists.
Before I get too far in the programming and development of the site
that is needed I needed to make sure that I can get it hosted on the
internet and that it will work, and this is where it falls down. I
have only ever worked in html, xhtml, css, or javascript when it comes
to the internet and I do not understand the intricacies of apache or
wsgi or CGI at all. I am currently having a mental block on this area
and it is causing me intense frustration.
Simply put, how do I setup web2py coming from my webhost (in this 
casewww.site5.com) I have setup a virtual enviroment and unzipped the
source of web2py on the website. I can run the script web2py.py and
get it to prompt that it is running a server but I do not know how to
access it and I am under the impression that the web2py.py script is
really made for development not deployment of websites.
It should be noted that one of the main features I need is automated
database evaluation and manipulation.
Any help is extremely welcomed and I would be most grateful. I am
simply running out of time to be stumped by what is most likely a
simple issue.




Re: [web2py] Display XML as HTML web2py

2010-12-05 Thread Kenneth Lundström
This just a crazy idea but would it be better to move the XML() into the 
view so return would look like:

return dict(results=urllib2.urlopen(req).read())

and view:

{{=XML(results)}}


Kenneth


I am trying to display some XML that has been screen scraped I want to 
display it as HTML in my code but for some reason its not working. It 
appears in the HTML source code but not being displayed any ideas


Controller
-

def guildRoster():
url = 'http://www.wowarmory.com/guild-info.xml?r=Moon+Guard&gn=Zen 
'
header = { 'User-Agent' : 'Mozilla/5.0 Gecko/20070219 
Firefox/2.0.0.2 '}

req = urllib2.Request(url, '', header)
return dict(results=XML(urllib2.urlopen(req).read()))

View
-
{{extend 'site_template.html'}}

Guild Roster
{{=results}}




Cheers ty






Re: [web2py] Re: partial csv import

2010-12-07 Thread Kenneth Lundström
Just curious but are you sure that column 3 on rows 1-15 and 32 onward 
are empty. When just tested to make a CSV file with Excel 2010 and if 
column 3 is empty Excel doesn´t put any closing characters on column 2.



Kenneth


Weird, looks like an Excel'97 bug.  It stopped putting the closing
comma after the second column after the 16th row (then starts back up
again after the 32nd).  Here's a test CSV:

key,value,description
key1,value1,
key2,value2,
key3,value3,
key4,value4,
key5,value5,
key6,value6,
key7,value7,
key8,value8,
key9,value9,
key10,value10,
key11,value11,
key12,value12,
key13,value13,
key14,value14,
key15,value15,
key16,value16
key17,value17
key18,value18
key19,value19
key20,value20
key21,value21
key22,value22
key23,value23
key24,value24
key25,value25
key26,value26
key27,value27
key28,value28
key29,value29
key30,value30
key31,value31
key32,value32,
key33,value33,
key34,value34,
key35,value35,
key36,value36,
key37,value37,
key38,value38,
key39,value39,
key40,value40,
key41,value41,1

I'll just have to make sure the last column has something in it.
Thanks.

On Dec 7, 2:00 pm, mdipierro  wrote:

That is not the problem. The problem is that you have a row that does
not contain enough columns.
Try open with excel, then export it again.

On Dec 7, 1:10 pm, pftpft  wrote:


Using the 'database administration', I am trying to import an Excel
generated CSV file (with lots of rows) into a table but it only
imports in 15 rows at a time then gives the following flash message:
unable to parse csv file
list index out of range
If I try to do a file with only 20 rows it works fine.  Is there a
limit to the number of rows you can import?






Re: [web2py] Help with Database

2010-12-10 Thread Kenneth Lundström
One way of doing this is to export all data while connected to Postgres 
and then import to MySQL. And doing the import and export via web2py.



Kenneth


Hi, i wanto to know if there is a way to change from Postgres to MySQL
and keep all the information in the db. How can i do that?

Thanks a lot!

Cesar B.




Re: [web2py] Re: Help with Database

2010-12-10 Thread Kenneth Lundström

http://web2py.com/book/default/chapter/06?search=csv#Exporting-and-Importing-Data


Kenneth


Thaks Kenneth, do you know where can i find some examples or
documentation about this?

On Dec 10, 4:16 am, Kenneth Lundström
wrote:

One way of doing this is to export all data while connected to Postgres
and then import to MySQL. And doing the import and export via web2py.

Kenneth








Hi, i wanto to know if there is a way to change from Postgres to MySQL
and keep all the information in the db. How can i do that?
Thanks a lot!
Cesar B.




Re: [web2py] Re: How to fetch already exiting table data with out defining new table

2010-12-17 Thread Kenneth Lundström

> return dict(records=db().select(db.tablename.ALL))

You can´t use the word tablename if you don´t have a table named 
tablename. If you wan´t to have everything from a table named customers use

return dict(records=db().select(db.customers.ALL))


Kenneth


it throws below error

Traceback (most recent call last):
   File "/home/sushanth/Desktop/web2py/gluon/restricted.py", line 188,
in restricted
 exec ccode in environment
   File "/home/sushanth/Desktop/web2py/applications/welcome/controllers/
default.py", line 104, in
   File "/home/sushanth/Desktop/web2py/gluon/globals.py", line 96, in

 self._caller = lambda f: f()
   File "/home/sushanth/Desktop/web2py/applications/welcome/controllers/
default.py", line 66, in contacts
 return dict(records=db().select(db.gtmaster.ALL))
   File "/home/sushanth/Desktop/web2py/gluon/sql.py", line 1400, in
__getattr__
 return dict.__getitem__(self,key)
KeyError: 'tablename'

On Dec 16, 11:47 pm, pbreit  wrote:

Here's one:https://groups.google.com/d/topic/web2py/mH5Toup0vwk/discussion




Re: [web2py] Re: Run Web2py as a Service? on Ubuntu Lucid?

2010-12-18 Thread Kenneth Lundström

Try to move the web2py.pid file and try again.


Kenneth


Thanks for the tip! Removed --quiet from the two lines. The service
still doesn't appear to start on startup (after reboot). When I
manually start with /etc/init.d/web2py (root user) I get this: No
process in pidfile '/var/run/web2py/web2py.pid' found running; none
killed. And the service doesn't seem to work.

What can be a wise next step?

On Dec 18, 10:33 am, jeff  wrote:

When I had this kind of problem, I removed the --quiet and --
background in the /etc/init.d/web2py file (line 65 and 67 of your 3rd
file).
I was then able to get some error messages when doing /etc/init.d/
web2py start

In my case, it helped me to find a stupid error I did.

Good luck.

On Dec 18, 5:59 am, ghoulmann  wrote:


Thanks so much for the reply. I did try both; retried them when I saw
your response. Both commands start web2py.py listening on :8000. SO,
it does work in these cases. Is there something I can try next?
On Dec 17, 6:34 pm, mdipierro  wrote:

did you try start it simply with
python web2py.py -a password
or
nohup python web2py.py -a password&
Does it work fine in these cases?
On Dec 17, 4:59 pm, ghoulmann  wrote:

I'm thankful this community is here. I'm working on a project for the
Sahana-Eden team [1]. It calls for running web2py as a service. I was
thankful to find documentation in the 3rd edition Official Web2py Book
[2]. Sadly, when I follow the docs I can't get the service running. /
etc/init.d/web2py start returns no errors; restart returns no errors,
and status returns nothing. Netstat tells me the interface isn't
listening on port 8000.
I did use the scripts/web2py.ubuntu.sh script, and did as instructed
in the documentation. I made changes to some of the paramaters near
the top of the script; I've made it available as a pastebin [3].
I've double-checked the daemon directory, and believe it to be
correct. I have created web2py user with no password (using useradd);
as web2py is new to me, I'm not sure that's necessary, but it has been
done. Web2py has precisely the same mode as a working service (webmin
in this case) and is owned root:root. Mode is rwxr-xr-x.
I would be very grateful for any guidance, suggestions, improvements,
encouragement you can offer.
Ultimately, it's the high school students that have committed to the
project that will benefit - I'm in unfamiliar territory and learning
along with them.
Rik
[1]http://eden.sahanafoundation.org/wiki/BluePrintlivecdinstaller
[2]http://web2py.com/book/default/chapter/11#Start-as-Linux-Daemon
[3]http://pastebin.com/9Uz45k3G






Re: [web2py] Need help

2010-12-19 Thread Kenneth Lundström

Have you tried to upgrade to 1.90.2 that uses the new DAL interface?

Kenneth


https://groups.google.com/forum/#!topic/pymysql-users/vrnKcoE6ZD0



[web2py] Members database

2010-12-22 Thread Kenneth Lundström

Hello,

a small design question.

I´m planing a intranet which contains a members database. Their postal 
address and some other info.


Would you use the auth_user table to store all members or make a 
different table for it.


- If I use auth_user what to do with members not intresered in login?

- If I choose to make a different table, some of the members will be 
using the intranet so they their e-mailaddress would be in two places



Kenneth



Re: [web2py] Re: The stability of web2py releases

2010-12-24 Thread Kenneth Lundström

Merry christmas to the whole list.

I think this has been suggested earlier but thought I´d bring it up again.

I have two instances of web2py via wsgi and Apache running on my server. 
One reason is the possibility to upgrade my development side everytime I 
log in to admin, that way getting all new features and testing at the 
same time.


Would it be possible to get two upgrade buttons in admin, one for 
"stable" and one for the latest release. Lot of the time there their the 
same. Maybe a third button for trunk, if that is possible.


Is there instructions how to use the hg stuff to use the trunk. Could 
not find the hg command in the book?



Kenneth


+1

On Fri, Dec 24, 2010 at 8:20 AM, Luis Díaz  wrote:

+1

2010/12/24 ron_m

I for one am happy with the current release cycle. It is a good balance
between new features and the ultimate stability of release 1.XX.N  where N
is the last version before XX+1 for example. The nightly build is a bit of a
misnomer, many projects (C or C++ mostly) have some automated process that
takes trunk and compiles it to produce a .tar.gz labelled nightly which
"might" work. For web2py we should just hg pull; hg update to achieve that
result. The nightly for web2py is more like a beta because Massimo hand
picks code from trunk that will or will not be in the nightly which could
really be a weekly.

I am currently developing the application I am working on and testing is
easy enough that I test trunk at least daily. The web2py server is quite
easy to use but the code in some places is complicated and has many possible
use cases. It is only through exposure out to the user base that a large
number of use cases of the code get tested. I have even seen problems
reported where something was fixed but used by maybe one person in a way
that should not have worked resulting in the dreaded bug that worked and
became a useful feature for someone.

Once I go to production I will probably move the releases a lot slower
through the installed base. In fact I have 2 beta production systems up now
and only push a new web2py when I push a new version of the application to
the stakeholders to look at.

Massimo provides a fantastic service with the web2py project and I would
not like to see him stifled by a load of process. Anyone that has time to
test will definitely help the quality, if you don't have time, that is okay
too. I personally don't mind doing some release management between where
Massimo is burning the midnight oil and what I let out into the production
systems I have/will manage. The product is alive with new features and bug
fixes sometimes occur in minutes once reported. That is worth a lot.

Ron





--
Díaz Luis
TSU Analisis de Sistemas
Universidad de Carabobo
http://web2pyfacil.blogspot.com/
Facultad de Odontología








Re: [web2py] Re: The stability of web2py releases

2010-12-24 Thread Kenneth Lundström

+1 for a changelog view.

The idea behind a two button upgrade is just as Branco explained, on my 
production instance I´d only upgrade to stable but on my development I´d 
upgrade to newest release just for helping out with testing.


This way maybe not everyone upgrades their production server to a not 
stable release candidate.



Kenneth


On Fri, Dec 24, 2010 at 10:18 PM, VP  wrote:

For one thing, I don't think the 2-button suggestion is a good idea;
it's just another indirect layer of information that might not be
meaningful if the underlying mechanism is meaningful.  Conversely, if
the underlying mechanism is meaningful, there's no need for the 2-
button solution.   For example, if the release mechanism follows
strictly Massimo's rule that 1.x.0 is likely a feature-introducing
"big release" with potential big bugs, where as 1.x.9 is likely a bug-
fixing release, then users can make intelligent decision to upgrade or
not; so there's no need for 2 buttons.  If this rule is not adhered as
intended, however, then 2 buttons do not help.

2-button solution doesn't solve the issue of making informed
decisions. It solves the issue of having an option between upgrading
to the next stable release, versus upgrading to the next release
candidate. The use-case is valid, and was outlined by Kenneth.
Inclusion of changelog is a good idea as well. The best place would be
the confirmation page for the upgrade action. It may also be
worthwhile to consider a single-button upgrade with a drop-down on the
confirmation page.






Re: [web2py] Re: Server slow

2010-12-24 Thread Kenneth Lundström

I finally had time to find out a little about loggin.conf.

In my logs/web2py.log I get this line:
2010-12-25 01:42:30,097 - root - INFO - time to fetch 1.81220602989

So it takes under 2 seconds to fetch the data and the rest 37 to show 
it? How come?



Kenneth


Were is this logged, I could not find anything in any logs?


Kenneth


try

import time, logging

def testing():
 t0=time.time()
 orders = db(db.orders.id>  0).select()
 logging.info('time to fetch %s' % (time.time()-t0))
 return orders

so you can isolate the problem and see if it is in fetching or
somewhere else (for example session locking).


On Dec 2, 4:21 pm, Kenneth Lundström
wrote:

>  When you test is that the only active connection to the db?

I tested it on an application running on the test instance. There could
have been lite activity one production site.
But when I tested loading the same function five times in about 10
minutes I allways 39 seconds to load the data.

Kenneth




2010/12/2 Kenneth Lundström:

Please tell us more about the setup. Are the three instances behind
running on the same server?

Yes.

why three? What do they do?
One is production, one is testing and last one is development. I 
had two

instances running on a virtual server before and it worked fine.

This is not normal but I suspect the problem is with database.
Did you set DAL(...,pool_size=10)?

No, but I tried but no change.
If I try to select more rows:
def testing():
 orders = db(db.orders.id>0).select()
 return orders
It takes 80 seconds to return 1608 rows.
If I change the return to return len(troops) it only takes 1,5 
seconds.

I have no view defined, just trying out the database.
Kenneth

On Dec 2, 5:13 am, Kenneth Lundström
wrote:

Hello list,
need some help finding out why my server is so slow.
The server is with a Intel Celeron 2.66 GHz CPU, 4 GB of memory
CentOS 5.5 64-bit, Apache 2.2.3, MySQL 5.0.77, mod_wsgi, Web2py 
1.89.5
The server is dedicated to web2py, there is three instances of 
web2py

running.
I have migrate=False, sessions on disc.
If I try the following code
def testing():
   customers = db(db.customer.id>  0).select()
   return customers
takes 39 seconds, 5 times in a row, to return 979 rows.
If I put db.customer<  100 it takes 4,5 seconds to return 87 
rows.

Is it just me or are this a bit long times?
Kenneth








[web2py] Occasionally getting this error

2010-12-25 Thread Kenneth Lundström

Apache 2, wsgi, MySQL, Python 2.6.5, web2py 1.90.6

After upgrading to the new DAL I occasionally get this error. Sometimes 
I have to reload the page 1-4 times to get it working.


Should I upgrade to 1.91.4 or do you need some more info?


Kenneth


Error ticket for "init"
Ticket ID

xxx.xxx.xxx.xxx.2010-12-25.09-54-54.a54a74d6-70ac-4b4d-b943-5edbf0ac6d23
Version
web2py™ Version 1.90.6 (2010-12-20 17:36:54)
Python Python 2.6.5: /usr/bin/python
Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.



Traceback (most recent call last):
File "ggg/gluon/main.py", line 446, in wsgibase
BaseAdapter.close_all_instances(BaseAdapter.commit)
File "ggg/gluon/dal.py", line 271, in close_all_instances
action(instance)
File "ggg/gluon/dal.py", line 1027, in commit
return self.connection.commit()
File "ggg/gluon/contrib/pymysql/connections.py", line 549, in commit
self.errorhandler(None, exc, value)
File "ggg/gluon/contrib/pymysql/connections.py", line 545, in commit
self._execute_command(COM_QUERY, "COMMIT")
File "ggg/gluon/contrib/pymysql/connections.py", line 686, in 
_execute_command

self._send_command(command, sql)
File "ggg/gluon/contrib/pymysql/connections.py", line 681, in 
_send_command

sock.send(send_data)
error: [Errno 32] Broken pipe

Error snapshot help Detailed traceback description

([Errno 32] Broken pipe)

inspect attributes
Exception instance attributes
__module__ 'socket'
__getslice__ 
__str__ 
__getattribute__ 
__dict__ {}
__sizeof__ 
__weakref__ None
__init__ 
__setattr__ 
__reduce_ex__ 
__new__ 
errno 32
__format__ 
__class__ 
filename None
__doc__ None
__getitem__ 
__setstate__ 
__reduce__ 
args (32, 'Broken pipe')
__subclasshook__ 
__unicode__ 
strerror 'Broken pipe'
__delattr__ 
__repr__ 
__hash__ 
Frames

*

File ggg/gluon/main.py in wsgibase at line 446 code arguments 
variables

Function argument list

(environ={'DOCUMENT_ROOT': 'ggg/', 'GATEWAY_INTERFACE': 
'CGI/1.1', 'HTTPS': '1', 'HTTP_ACCEPT': 
'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 
'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 
'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 
'en-gb,en;q=0.5', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_COOKIE': 
'__utma=12350507.1333234958.1291477692.1291477692...1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none)', 
'HTTP_HOST': '', ...}, responder=mod_wsgi.Adapter object>)

Code listing

441.
442.
443.
444.
445.
446.

447.
448.
449.
450.



# ##

if response._custom_commit:
response._custom_commit()
else:
BaseAdapter.close_all_instances(BaseAdapter.commit)


# ##
# if session not in db try store session on filesystem
# this must be done after trying to commit database!

Variables
BaseAdapter.close_all_instances 
BaseAdapter.commit 
global BaseAdapter 
*

File ggg/gluon/dal.py in close_all_instances at line 271 code 
arguments variables

Function argument list

(action=)
Code listing

266.
267.
268.
269.
270.
271.

272.
273.
274.
275.



""" to close cleanly databases in a multithreaded environment """
if not hasattr(thread,'instances'):
return
while thread.instances:
instance = thread.instances.pop()
action(instance)

# ## if you want pools, recycle this connection
really = True
if instance.pool_size:
sql_locker.acquire()

Variables
action 
instance 
*

File ggg/gluon/dal.py in commit at line 1027 code arguments 
variables

Function argument list

(self=)
Code listing

1022.
1023.
1024.
1025.
1026.
1027.

1028.
1029.
1030.
1031.



if query.second!=None:
tables = tables.union(self.tables(query.second))
return list(tables)

def commit(self):
return self.connection.commit()


def rollback(self):
return self.connection.rollback()

Variables
self 
self.connection 
self.connection.commit >

*

File ggg/gluon/contrib/pymysql/connections.py in commit at line 
549 code arguments variables

Function argument list

(self=)
Code listing

544.
545.
546.
547.
548.
549.

550.
551.
552.
553.



try:
self._execute_command(COM_QUERY, "COMMIT")
self.read_packet()
except:
exc,value,tb = sys.exc_info()
self.errorhandler(None, exc, value)


def rollback(self):
''' Roll back the current transaction '''
try:

Variables
builtinNone None
self 
exc 
value error(32, 'Broken pipe')
self.errorhandler ...n.contrib.pymysql.connections.Connection object>>

*

File ggg/gluon/contrib/pymysql/connections.py in commit at line 
545 code arguments variables

Function argument list

(self=)
Code listing

540.
541.
542.
543.
544.
545.

546.
547.
548.
549.



self.errorhandler(None, exc, value)

def commit(self):
''' Commit changes to stable storage '''
try:
self._execute_command(COM_QUERY, "COMMIT")

self.read_packet()
except:
exc,value,tb = sys.exc_info()
self.errorhandler(None, exc, value)

Variables
self 
global COM_QUERY '\x03'
self._execute_command >

*

File ggg/

Re: [web2py] Re: Server slow

2010-12-25 Thread Kenneth Lundström

980 rows, 10 columns of data,
38 sec.

MySQL server is on the same server, Apache server is not local, but the 
delay is allways 38-39 seconds.



Kenneth


No idea. How much data.
What db? is it local? Probably something is wrong anyway.

On Dec 24, 5:55 pm, Kenneth Lundström
wrote:

I finally had time to find out a little about loggin.conf.

In my logs/web2py.log I get this line:
2010-12-25 01:42:30,097 - root - INFO - time to fetch 1.81220602989

So it takes under 2 seconds to fetch the data and the rest 37 to show
it? How come?

Kenneth


Were is this logged, I could not find anything in any logs?
Kenneth

try
import time, logging
def testing():
  t0=time.time()
  orders = db(db.orders.id>0).select()
  logging.info('time to fetch %s' % (time.time()-t0))
  return orders
so you can isolate the problem and see if it is in fetching or
somewhere else (for example session locking).
On Dec 2, 4:21 pm, Kenneth Lundstr m
wrote:

  When you test is that the only active connection to the db?

I tested it on an application running on the test instance. There could
have been lite activity one production site.
But when I tested loading the same function five times in about 10
minutes I allways 39 seconds to load the data.
Kenneth

2010/12/2 Kenneth Lundstr m:

Please tell us more about the setup. Are the three instances behind
running on the same server?

Yes.

why three? What do they do?

One is production, one is testing and last one is development. I
had two
instances running on a virtual server before and it worked fine.

This is not normal but I suspect the problem is with database.
Did you set DAL(...,pool_size=10)?

No, but I tried but no change.
If I try to select more rows:
def testing():
  orders = db(db.orders.id>  0).select()
  return orders
It takes 80 seconds to return 1608 rows.
If I change the return to return len(troops) it only takes 1,5
seconds.
I have no view defined, just trying out the database.
Kenneth

On Dec 2, 5:13 am, Kenneth Lundstr m
wrote:

Hello list,
need some help finding out why my server is so slow.
The server is with a Intel Celeron 2.66 GHz CPU, 4 GB of memory
CentOS 5.5 64-bit, Apache 2.2.3, MySQL 5.0.77, mod_wsgi, Web2py
1.89.5
The server is dedicated to web2py, there is three instances of
web2py
running.
I have migrate=False, sessions on disc.
If I try the following code
def testing():
customers = db(db.customer.id>0).select()
return customers
takes 39 seconds, 5 times in a row, to return 979 rows.
If I put db.customer<100 it takes 4,5 seconds to return 87
rows.
Is it just me or are this a bit long times?
Kenneth






[web2py] Sanitized error report

2010-12-25 Thread Kenneth Lundström

Hello,

usually when you get an error report you read it and fix the problem, 
but occasionally you get a error report that you want to send to the 
mailing list, either because you think it´s a bug in the system or you 
want to ask for advice. At that time I think it would be nice to have 
sanitized error report without IP-addresses, folders and so on that you 
can just copy&paste to the list. I don´t know if I´m paranoid but I 
don´t like to put everything on an open list. Maybe a link at top of the 
page to a sanitized error report.


What do you think?


Kenneth


Re: [web2py] Re: Server slow

2010-12-25 Thread Kenneth Lundström

 Is this reproducible?


This happens all the time, if I do it ten times in a row every time it takes 
38-39 seconds. Even with lynx on the server itself it takes about 40 seconds.

If I use:
t0=time.time()
orders = db(db.orders.id>  0).select()
logging.info('time to fetch %s' % (time.time()-t0))

The time is 1.75 - 1.90 seconds to fetch the data from database


I change the controller to this

sql = db(db.orders.id>  0)._select()
t0=time.time()
db.executesql(sql)
logging.info('time to fetch %s' % (time.time()-t0))
orders=[]

now I get times like 0.38 - 0.39 seconds

If I instead of db.orders.id<  490) to get half the rows all times drops to 
half, even 40 seconds is now 20 seconds.

Just testing I tried with:
t0=time.time()
orders = db(db.orders.id>  0).select()
orders1 = db(db.orders.id>  0).select()
orders2 = db(db.orders.id>  0).select()
orders3 = db(db.orders.id>  0).select()
orders4 = db(db.orders.id>  0).select()
logging.info('time to fetch %s' % (time.time()-t0))
return orders

This takes about, 5x1,8s (to fetch data) + 35 seconds = 45 seconds

I tried with a different table that contains about 1250 rows, 6 columns. It 
takes 1.2-1.3 seconds to fetch the data, but then over 60 seconds to display it.


Kenneth




Re: [web2py] Re: Occasionally getting this error

2010-12-25 Thread Kenneth Lundström
I have never seen this before I upgraded to a version with the new DAL 
and it show any very occasionally. Today I got it a lot, so I upgraded 
to 1.91.4 and so far havn´t got it.



Kenneth


I cannot tell. The traceback is in pymysql so I would post there too.
Can you tell us more?

On Dec 25, 4:02 am, Kenneth Lundström
wrote:

Apache 2, wsgi, MySQL, Python 2.6.5, web2py 1.90.6

After upgrading to the new DAL I occasionally get this error. Sometimes
I have to reload the page 1-4 times to get it working.

Should I upgrade to 1.91.4 or do you need some more info?

Kenneth

Error ticket for "init"
Ticket ID

xxx.xxx.xxx.xxx.2010-12-25.09-54-54.a54a74d6-70ac-4b4d-b943-5edbf0ac6d23
Version
web2py Version 1.90.6 (2010-12-20 17:36:54)
Python Python 2.6.5: /usr/bin/python
Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.

Traceback (most recent call last):
File "ggg/gluon/main.py", line 446, in wsgibase
BaseAdapter.close_all_instances(BaseAdapter.commit)
File "ggg/gluon/dal.py", line 271, in close_all_instances
action(instance)
File "ggg/gluon/dal.py", line 1027, in commit
return self.connection.commit()
File "ggg/gluon/contrib/pymysql/connections.py", line 549, in commit
self.errorhandler(None, exc, value)
File "ggg/gluon/contrib/pymysql/connections.py", line 545, in commit
self._execute_command(COM_QUERY, "COMMIT")
File "ggg/gluon/contrib/pymysql/connections.py", line 686, in
_execute_command
self._send_command(command, sql)
File "ggg/gluon/contrib/pymysql/connections.py", line 681, in
_send_command
sock.send(send_data)
error: [Errno 32] Broken pipe

Error snapshot help Detailed traceback description

([Errno 32] Broken pipe)

inspect attributes
Exception instance attributes
__module__ 'socket'
__getslice__
__str__
__getattribute__
__dict__ {}
__sizeof__
__weakref__ None
__init__
__setattr__
__reduce_ex__
__new__
errno 32
__format__
__class__
filename None
__doc__ None
__getitem__
__setstate__
__reduce__
args (32, 'Broken pipe')
__subclasshook__
__unicode__
strerror 'Broken pipe'
__delattr__
__repr__
__hash__
Frames

*

File ggg/gluon/main.py in wsgibase at line 446 code arguments
variables
Function argument list

(environ={'DOCUMENT_ROOT': 'ggg/', 'GATEWAY_INTERFACE':
'CGI/1.1', 'HTTPS': '1', 'HTTP_ACCEPT':
'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE':
'en-gb,en;q=0.5', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_COOKIE':
'__utma=12350507.1333234958.1291477692.1291477692...1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none)',
'HTTP_HOST': '', ...}, responder=)
Code listing

441.
442.
443.
444.
445.
446.

447.
448.
449.
450.

# ##

if response._custom_commit:
response._custom_commit()
else:
BaseAdapter.close_all_instances(BaseAdapter.commit)

# ##
# if session not in db try store session on filesystem
# this must be done after trying to commit database!

Variables
BaseAdapter.close_all_instances
BaseAdapter.commit
global BaseAdapter
*

File ggg/gluon/dal.py in close_all_instances at line 271 code
arguments variables
Function argument list

(action=)
Code listing

266.
267.
268.
269.
270.
271.

272.
273.
274.
275.

""" to close cleanly databases in a multithreaded environment """
if not hasattr(thread,'instances'):
return
while thread.instances:
instance = thread.instances.pop()
action(instance)

# ## if you want pools, recycle this connection
really = True
if instance.pool_size:
sql_locker.acquire()

Variables
action
instance
*

File ggg/gluon/dal.py in commit at line 1027 code arguments
variables
Function argument list

(self=)
Code listing

1022.
1023.
1024.
1025.
1026.
1027.

1028.
1029.
1030.
1031.

if query.second!=None:
tables = tables.union(self.tables(query.second))
return list(tables)

def commit(self):
return self.connection.commit()

def rollback(self):
return self.connection.rollback()

Variables
self
self.connection
self.connection.commit>
*

File ggg/gluon/contrib/pymysql/connections.py in commit at line
549 code arguments variables
Function argument list

(self=)
Code listing

544.
545.
546.
547.
548.
549.

550.
551.
552.
553.

try:
self._execute_command(COM_QUERY, "COMMIT")
self.read_packet()
except:
exc,value,tb = sys.exc_info()
self.errorhandler(None, exc, value)

def rollback(self):
''' Roll back the current transaction '''
try:

Variables
builtin

[web2py] A bug or am I doing something wrong

2010-12-26 Thread Kenneth Lundström

Aapche 2, wsgi, MySQL 5.0, web2py 1.91.4, python 2.6.5

I have defined in my model:
Field('f_total_sum_all', type='decimal',
label=T('Total Sum')),

Even floeat gives the same error. Only integer works.



Version
web2py™ Version 1.91.4 (2010-12-22 17:31:23)
Python Python 2.6.5: /usr/bin/python

Traceback (most recent call last):
File "/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
File "/web2py/applications/kenneths/models/db_wizard.py", line 70, in 


migrate=settings.migrate)
File "/web2py/gluon/dal.py", line 3321, in define_table
polymodel=polymodel)
File "/web2py/gluon/dal.py", line 444, in create_table
precision, scale = [int(x) for x in field.type[8:-1].split(',')]
ValueError: invalid literal for int() with base 10: ''

Error snapshot help Detailed traceback description

(invalid literal for int() with base 10: '')

inspect attributes
Exception instance attributes
__setattr__ 
__reduce_ex__ object>

__getslice__ 
__getitem__ 
__setstate__ 
__getattribute__ exceptions.ValueError object>

__str__ 
args ("invalid literal for int() with base 10: ''",)
__reduce__ 
__format__ 
__class__ 
__dict__ {}
__delattr__ 
__subclasshook__ 
__repr__ 
__init__ 
__hash__ 
__sizeof__ 
__doc__ 'Inappropriate argument value (of correct type).'
__unicode__ 
__new__ 
Frames

File /web2py/gluon/restricted.py in restricted at line 188 code 
arguments variables

Function argument list

(code="### we prepend t_ to tablenames and f_ to 
fieldn...Field('current_record','reference t_bill_item'))\n", 
environment={'A': , 'Auth': 'gluon.tools.Auth'>, 'B': , 'BEAUTIFY': 'gluon.html.BEAUTIFY'>, 'BODY': , 'BR': 'gluon.html.BR'>, 'CENTER': , 'CLEANUP': 
, 'CODE': , 
'CRYPT': , ...}, 
layer='/web2py/applications/kenneths/models/db_wizard.py')

Code listing

if type(code) == types.CodeType:
ccode = code
else:
ccode = compile2(code,layer)

exec ccode in environment

except HTTP:
raise
except Exception:
# XXX Show exception in Wing IDE if running in debugger

Variables
environment {'A': , 'Auth': 'gluon.tools.Auth'>, 'B': , 'BEAUTIFY': 'gluon.html.BEAUTIFY'>, 'BODY': , 'BR': 'gluon.html.BR'>, 'CENTER': , 'CLEANUP': 
, 'CODE': , 
'CRYPT': , ...}
ccode  at 0x2aaab001f6c0, file 
"/...plications/kenneths/models/db_wizard.py", line 5>

*

File /web2py/applications/kenneths/models/db_wizard.py in  at 
line 70 code arguments variables

Function argument list

()
Code listing


label=T('Created By'),writable=False,readable=False),
Field('modified_by',db.auth_user,default=auth.user_id,
label=T('Modified By'),writable=False,readable=False,
update=auth.user_id),
format='%(f_name)s',
migrate=settings.migrate)


db.define_table('t_receipt_archive',db.t_receipt,Field('current_record','reference 
t_receipt'))




Variables
migrate undefined
settings.migrate True
settings 'localhost', 'login_method': 'local'}>

*

File /web2py/gluon/dal.py in define_table at line 3321 code arguments 
variables

Function argument list

(self=}>, 
'_migrate': True, '_pool_size': 0}>, tablename='t_receipt', 
*fields=(, , 
, , object>, , , 
, , object>, , ), 
**args={'format': '%(f_name)s', 'migrate': True})

Code listing


if migrate or self._uri=='gae':
try:
sql_locker.acquire()
self._adapter.create_table(t,migrate=migrate,
fake_migrate=fake_migrate,
polymodel=polymodel)

finally:
sql_locker.release()
else:
t._dbt = None

Variables
polymodel None
*

File /web2py/gluon/dal.py in create_table at line 444 code arguments 
variables

Function argument list

(self=, table=0x2aaab0039690>}>, migrate=True, fake_migrate=False, polymodel=None)

Code listing

foreign_key=referenced + ('(%s)' % table._db[referenced].fields[0]),
on_delete_action=field.ondelete)
elif field.type.startswith('list:reference'):
ftype = self.types[field.type[:14]]
elif field.type.startswith('decimal'):
precision, scale = [int(x) for x in field.type[8:-1].split(',')]

ftype = self.types[field.type[:7]] % \
dict(precision=precision,scale=scale)
elif not field.type in self.types:
raise SyntaxError, 'Field: unknown field type: %s for %s' % \

Variables
scale undefined
field.type 'decimal'
precision undefined
field 
x ''
builtinint 
].split 

Context

locals request session response
locals
TFK :
{}
constraint_name :
't_receipt_f_purchased_by__constraint'
fake_migrate :
False
field :

fields :
['id INT AUTO_INCREMENT NOT NULL', 'f_name VARCHAR(255)', 
'f_purchased_by INT, INDEX f_purchased_by__idx (f...ed_by) REFERENCES 
auth_user(id) ON DELETE CASCADE', 'f_purchased DATETIME', 'f_paid 
DATETIME', 'to_be_paid CHAR(1)']

ftype :
'CHAR(1)'
k :
'f_total_sum_all'
migrate :
True
not_null :
"NOT NULL DEFAULT 'F'"
polymodel :
None
referenced :
'auth_user'
self :

sql_fields :
{'f_name': 'VARCHAR(255)', 'f_paid': 'DATETIME', 'f_purchased': 
'DATETIME', 'f_purchased_by': 'INT, INDEX f_purchased_by__idx 
(f_purchased_by),...ed_by) REFERENCES auth_user(id) ON DELETE CASCADE', 
'id': 'INT AUTO_INCREMENT NOT NULL', 'to_be_paid': 'CHAR(1)'}

sql_fields_aux

Re: [web2py] Re: Server slow

2010-12-26 Thread Kenneth Lundström

What part of the model would you like to see?

This?

db.define_table('orders',
db.Field('name', 'string', length=40, requires=IS_NOT_EMPTY()),
db.Field('district', db.district, required=True),
db.Field('edited_by', db[user_table], required=True),
db.Field('edited_date', 'datetime', required=True),
db.Field('reward_selected', 'integer', default=0),
db.Field('members', 'integer', default=0),
db.Field('memb_no', 'string', default=0),
db.Field('locked', 'integer', default=False, required=True),
db.Field('cow_id', 'string', default=''),
migrate=settings.migrate)


So far there was no view defined for this controller. If I define a 
empty one it takes like 2-3 seconds to show a empty page, controller 
changed to dict(orders=orders).


If I define the view to be {{=orders}} it takes again 40 seconds to show.

The strange thing is if I change the view to
{{
for order in orders:
=XML(order)
pass
}}

it only takes about 2-3 seconds to show all orders. Not as nice as 
=orders but very strange anyhow.



Kenneth




I have never seen this before. Can I see the model?

massimo

On Dec 25, 3:51 pm, Kenneth Lundström
wrote:

  Is this reproducible?

This happens all the time, if I do it ten times in a row every time it takes 
38-39 seconds. Even with lynx on the server itself it takes about 40 seconds.

If I use:
  t0=time.time()
  orders = db(db.orders.id>0).select()
  logging.info('time to fetch %s' % (time.time()-t0))

The time is 1.75 - 1.90 seconds to fetch the data from database

I change the controller to this

  sql = db(db.orders.id>0)._select()
  t0=time.time()
  db.executesql(sql)
  logging.info('time to fetch %s' % (time.time()-t0))
  orders=[]

now I get times like 0.38 - 0.39 seconds

If I instead of db.orders.id<490) to get half the rows all times drops to 
half, even 40 seconds is now 20 seconds.

Just testing I tried with:
  t0=time.time()
  orders = db(db.orders.id>0).select()
  orders1 = db(db.orders.id>0).select()
  orders2 = db(db.orders.id>0).select()
  orders3 = db(db.orders.id>0).select()
  orders4 = db(db.orders.id>0).select()
  logging.info('time to fetch %s' % (time.time()-t0))
  return orders

This takes about, 5x1,8s (to fetch data) + 35 seconds = 45 seconds

I tried with a different table that contains about 1250 rows, 6 columns. It 
takes 1.2-1.3 seconds to fetch the data, but then over 60 seconds to display it.

Kenneth




Re: [web2py] Re: Server slow

2010-12-26 Thread Kenneth Lundström

So it rather fast not slow :=)

But the edited_by column is not showing a name, it shows a number.

But that is not very intresting as I don´t need a list like that, it was 
just a test. I´m trying to optimize some reporting functions. I´ll have 
to start from an other angle.



Kenneth



Now I understand.

The problem is here:

  Field('edited_by', db[user_table], required=True),

When you do {{=orders}} is uses a default representation for
edited_by. The field contains a user id and the default representation
is the user name. So for each record it has to do a database lookup
(980 of them).

If you want to represent users by name, you should either cache them.
Something like this:

db.orders.edited_by.represent = lambda id: cache.ram('user:
%i'%id,lambda:db.auth_user(id).first_name,3600)

or turn your query into a join.

Massimo

On Dec 26, 11:37 pm, Kenneth Lundström
wrote:

What part of the model would you like to see?

This?

db.define_table('orders',
  db.Field('name', 'string', length=40, requires=IS_NOT_EMPTY()),
  db.Field('district', db.district, required=True),
  db.Field('edited_by', db[user_table], required=True),
  db.Field('edited_date', 'datetime', required=True),
  db.Field('reward_selected', 'integer', default=0),
  db.Field('members', 'integer', default=0),
  db.Field('memb_no', 'string', default=0),
  db.Field('locked', 'integer', default=False, required=True),
  db.Field('cow_id', 'string', default=''),
  migrate=settings.migrate)

So far there was no view defined for this controller. If I define a
empty one it takes like 2-3 seconds to show a empty page, controller
changed to dict(orders=orders).

If I define the view to be {{=orders}} it takes again 40 seconds to show.

The strange thing is if I change the view to
{{
for order in orders:
  =XML(order)
  pass

}}

it only takes about 2-3 seconds to show all orders. Not as nice as
=orders but very strange anyhow.

Kenneth


I have never seen this before. Can I see the model?
massimo
On Dec 25, 3:51 pm, Kenneth Lundstr�m
wrote:

   Is this reproducible?

This happens all the time, if I do it ten times in a row every time it takes 
38-39 seconds. Even with lynx on the server itself it takes about 40 seconds.
If I use:
   t0=time.time()
   orders = db(db.orders.id>  0).select()
   logging.info('time to fetch %s' % (time.time()-t0))
The time is 1.75 - 1.90 seconds to fetch the data from database
I change the controller to this
   sql = db(db.orders.id>  0)._select()
   t0=time.time()
   db.executesql(sql)
   logging.info('time to fetch %s' % (time.time()-t0))
   orders=[]
now I get times like 0.38 - 0.39 seconds
If I instead of db.orders.id<  490) to get half the rows all times drops to 
half, even 40 seconds is now 20 seconds.
Just testing I tried with:
   t0=time.time()
   orders = db(db.orders.id>  0).select()
   orders1 = db(db.orders.id>  0).select()
   orders2 = db(db.orders.id>  0).select()
   orders3 = db(db.orders.id>  0).select()
   orders4 = db(db.orders.id>  0).select()
   logging.info('time to fetch %s' % (time.time()-t0))
   return orders
This takes about, 5x1,8s (to fetch data) + 35 seconds = 45 seconds
I tried with a different table that contains about 1250 rows, 6 columns. It 
takes 1.2-1.3 seconds to fetch the data, but then over 60 seconds to display it.
Kenneth






[web2py] Getting Apache error on a web2py.com page

2010-12-27 Thread Kenneth Lundström
I was looking for making a page into a popup and found this page in 
Google groups:

http://groups.google.com/group/web2py/browse_thread/thread/a753c07af1e396bc/56f7ed4ca7a62fb1?lnk=gst&q=popup+login#56f7ed4ca7a62fb1

There is a link to page:
http://www.web2py.com/events/default/index

which returns:


 OK

The server encountered an internal error or misconfiguration and was 
unable to complete your request.


Please contact the server administrator, [no address given] and inform 
them of the time the error occurred, and anything you might have done 
that may have caused the error.


More information about this error may be available in the server error log.


Kenneth




  1   2   3   4   5   >