[web2py] reading config flat files in from module

2014-04-10 Thread Mark Graves
Hey Everyone,

For various reasons, I import some configuration information from files in 
an application I'm working on (config.json). There are some limitations 
which are forcing me to take this approach.

This configuration information is imported in a web2py module file 
(config.py)

When I change the content of the flat file (verifiable by looking at the 
contents), config.py does not seem to reload the values.  It uses what was 
previously stored in memory.  Is this because the python interpreter has 
already got a copy of config.py imported which contains pointers to the old 
file?

That is: 
config.py is unchanged
config.json changes
importing config.py (which opens config.json) still seems to point to the 
old version of the file.

I am using: 

with open(file) as

which I thought implicitly closed the file, and which I also thought would 
reopen it(with changes) on the next import of that module.

What's the best approach to tackle this? What am I missing?

 I'd appreciate any help or feedback.

Thanks

Mark

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: unique entry or null validation

2014-04-10 Thread Johann Spies
On 9 April 2014 17:45, Claudio Cocciarelli claudiococciare...@gmail.comwrote:


 So I have a db.table.field1.requires=IS_EMPTY_OR(IS_NOT_IN_DB(db,
 'table.field1')) but I have a problem with this:
 when inserting a new record it works flawlessly,
 instead when updating another record field2 in the same table, the
 validators are called again on field1 and I cannot update the record
 because I get the error Value already in database or empty
 of course it's already in the database, I'm updating the same table!!

 It's quite difficult to explain but I hope you got my point. Basically I
 don't want the validator to be called on update() but only on insert()

 Any advice on how to deal with this situation?


If you want the items in field1 to be uinique then you cannot allow update
to put a duplicate value in there.

If you get that message, find the duplicate value in the database and do
something about that.

Regards
Johann

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

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: reading config flat files in from module

2014-04-10 Thread Mark Graves
I ended up fixing my own problem.

I had declared some configuration variables directly within the config.py 
module.

I moved the functions that load the config information into a class and 
instantiate that class, and it all worked.

On Thursday, April 10, 2014 1:02:05 AM UTC-5, Mark Graves wrote:

 Hey Everyone,

 For various reasons, I import some configuration information from files in 
 an application I'm working on (config.json). There are some limitations 
 which are forcing me to take this approach.

 This configuration information is imported in a web2py module file 
 (config.py)

 When I change the content of the flat file (verifiable by looking at the 
 contents), config.py does not seem to reload the values.  It uses what was 
 previously stored in memory.  Is this because the python interpreter has 
 already got a copy of config.py imported which contains pointers to the old 
 file?

 That is: 
 config.py is unchanged
 config.json changes
 importing config.py (which opens config.json) still seems to point to the 
 old version of the file.

 I am using: 

 with open(file) as

 which I thought implicitly closed the file, and which I also thought would 
 reopen it(with changes) on the next import of that module.

 What's the best approach to tackle this? What am I missing?

  I'd appreciate any help or feedback.

 Thanks

 Mark


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] security issue in the OpenSSL

2014-04-10 Thread Annet
I guess you've been notified as well, in case you haven't ...

Yesterday my hosting provider notified me of the following issue:

As you have probably heard a serious security issue (dubbed the heartbleed 
bug) was found in the OpenSSL library yesterday.
This is a very serious issue as this library is used to encrypt a large 
percentage of the Internet's traffic, including web and email.

The security issue could allow anybody to access parts of the encrypted 
traffic as well as the secret keys used to encrypt that traffic. 


Kind regards,

Annet

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: bug when starting external cron job in web2py 2.9.5

2014-04-10 Thread Alex


thanks, Massimo.

I opened a ticket: http://code.google.com/p/web2py/issues/detail?id=1918

Am Mittwoch, 9. April 2014 23:02:16 UTC+2 schrieb Massimo Di Pierro:

 Please open a ticket and I will look at this asap.

 On Tuesday, 8 April 2014 17:39:09 UTC-5, Alex wrote:

 yes, application is recompiled with 2.9.5.

 everything works (so far), only calling the controller function from 
 command line does not.



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Online Manual: Chapter 9: Access Control - Formatting/content issues?

2014-04-10 Thread Seeker
Hi,

Is it just me (and my lack of appropriate knowledge) or is there something 
wrong with chapter 9 of the book?
The text starts off well, but about halfway down the page the formatting 
seems jumbled and there seems to be some info missing as well.

Thanks.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Basic Auth with alternate auth method

2014-04-10 Thread at
Hi Damien,

Have you got the answer of your question? I was also looking for the 
similar stuff.

Thanks,
AT

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Failing importing .py module that imports .c file

2014-04-10 Thread Jaime Sempere
Thanks a lot, Niphlod!

I didn't know that about GAE, my excuses.

You rock, web2py rocks, and this group rocks :)

El miércoles, 9 de abril de 2014 23:12:02 UTC+2, Niphlod escribió:

 simply put, GAE doesn't allow any python package that includes c 
 extensions. 

 usually, there are alternatives for famous packages that solve with pure 
 python what c extensions do in the original package. A simple google 
 search for tweepy gae brought up this 
 https://github.com/firelabi/tweepy-gae

 On Wednesday, April 9, 2014 10:33:04 PM UTC+2, Jaime Sempere wrote:


 Hi,

 I am using Tweepy which uses ssl, and developing on GAE. 

 I donwload Tweepy and put the folder on /modules... then it failed due to 
 I needed ssl module too. I did the same, and then it failed again:

 ImportError: Cannot import module '_ssl2'

 _ssl2 is a .c file that is in /modules/ssl/_ssl2.c


 I think web2py is looking for python module instead of _ssl2.c

 How could I solve this?


 Thanks a lot in advance



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Enter from 0 to 255 characters on grid=SQLFORM How to fix?

2014-04-10 Thread Austin Taylor
Using MySQL and the table definition is just:

db.define_table('newtable',
 Field('Name','string'),
 Field('Comments', string', length=499)'
 migrate=False)

On Wednesday, April 9, 2014 8:09:19 AM UTC-4, Niphlod wrote:

 what's the table definition ? what backend are you using ?

 On Wednesday, April 9, 2014 9:06:12 AM UTC+2, Austin Taylor wrote:

 Wow  thanks for the quick reply! I did try the length=499, but I still 
 get the validator error. Do I need to restart web2py?

 On Wednesday, April 9, 2014 3:00:49 AM UTC-4, Niphlod wrote:

 Field('whatever')

 means really

 Field('whatever', 'string', length=255)

 it gets a default requires that resembles IS_LENGTH(maxsize=255)

 if you need more of that, use length=morethan255

 On Wednesday, April 9, 2014 8:54:40 AM UTC+2, Austin Taylor wrote:

 I'm creating a grid using grid=SQLFORM.smartgrid(db.mydatabase, 
 user_signature=True)

 when I try to update one of the fields using the edit button I get 
 enter from 0 to 255 characters. The field already has over 255 characters 
 in it because its in the database, but I cannot add extra characters to 
 the 
 field. 

 Any help is appreciated. I looked all over for the error enter from 0 
 to 255 characters




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Online Manual: Chapter 9: Access Control - Formatting/content issues?

2014-04-10 Thread DenesL

True, everything after 9.1.5 Renaming Auth tables is corrupted.


On Thursday, April 10, 2014 5:58:58 AM UTC-4, Seeker wrote:

 Hi,

 Is it just me (and my lack of appropriate knowledge) or is there something 
 wrong with chapter 9 of the book?
 The text starts off well, but about halfway down the page the formatting 
 seems jumbled and there seems to be some info missing as well.

 Thanks.



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Change the download text from file to something else?

2014-04-10 Thread António Ramos
hello i want to change the text that appears on downloadable file links

I see file but that is nothing informative especially when users dont
speak english

I want to default it to something else

where do i change that behaviour?

regards

António

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Custom grid based on user profile -- any cool smartgrid examples welcomed!!

2014-04-10 Thread Austin Taylor
Hello,

I'm trying to create a custom grid based on the user who is logged in. In 
other words something that would allow them to select which columns they'd 
like to see in the database, have it save to their profile, and then view 
the grid.

Are there any examples on how I could achieve this? I'm using mysql for the 
database. I was thinking of having some type of menu where they could 
select which fields they want and then somehow save that preference to 
their user id.

Beyond that I'm really not sure where to start and welcome any advice.

Lastly, thank you for everyone who post on these boards and continue to 
make the web2py community great!

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Enter from 0 to 255 characters on grid=SQLFORM How to fix?

2014-04-10 Thread 黄祥
perhaps try to set migrat = True, to take effect for your defined table.

best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Enter from 0 to 255 characters on grid=SQLFORM How to fix?

2014-04-10 Thread Austin Taylor
I only define the table in my db.py though. I don't see it referenced 
anywhere else.

On Thursday, April 10, 2014 10:46:23 AM UTC-4, 黄祥 wrote:

 perhaps try to set migrat = True, to take effect for your defined table.

 best regards,
 stifan


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Custom grid based on user profile -- any cool smartgrid examples welcomed!!

2014-04-10 Thread 黄祥
if you set the access control correctly and set the logical for that it can 
be done, for menu i think you can do something like :
*controllers/install.py*
def index():
if db(db.auth_permission).isempty() and db(db.auth_membership).isempty():
# group
auth.add_group('Finance', 'Finance')
 # user
db.auth_user.bulk_insert([{first_name : Finance, last_name : 
Manager, 
   email : financemana...@a.com, username : financemanager, 
   password : db.auth_user.password.validate(password)[0]}, ])
 
membership (group_id, user_id)

# Finance
auth.add_membership('1', '1')
session.flash = T('Installation Done')
redirect(URL(default, index) )

*models/menu.py*
if auth.has_membership(role = 'Finance'):
response.menu += [
(T('Finance'), False, URL('default', 'index'), [
(T('Master'), False, URL('finance_master', 'index'), [
(T('Bank'), False, URL('finance_master', 'bank'), []),
]),
(T('Transaction'), False, URL('finance_transaction', 'index'), [
(T('Payment'), False, URL('finance_transaction', 'payment_cart'), []),
]),
(T('Report'), False, URL('finance_report', 'index'), [
(T('Payment'), False, URL('finance_report', 'report_payment'), []),
]),
]), 
]

best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Enter from 0 to 255 characters on grid=SQLFORM How to fix?

2014-04-10 Thread 黄祥
i mean set the migrate = True, to take effect for your changes of define 
table field, or are you create it from the scratch?

best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Enter from 0 to 255 characters on grid=SQLFORM How to fix?

2014-04-10 Thread Austin Taylor
I set migrate to True and checked the database logs. You're right... its 
showing as a VARCHAR 255. Even though I have length=499 defined in the 
db.define_table. Is web2py limited to 255 for VARCHARS?

On Thursday, April 10, 2014 10:50:56 AM UTC-4, Austin Taylor wrote:

 I only define the table in my db.py though. I don't see it referenced 
 anywhere else.

 On Thursday, April 10, 2014 10:46:23 AM UTC-4, 黄祥 wrote:

 perhaps try to set migrat = True, to take effect for your defined table.

 best regards,
 stifan



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Enter from 0 to 255 characters on grid=SQLFORM How to fix?

2014-04-10 Thread 黄祥
please try to start from simple, create your new web2py application and 
then put your define table there, after that check your sql.log or test it 
from appadmin.
e.g.
*models/db.py*
db.define_table('newtable',
 Field('Name','string'),
 Field('Comments', string', length=499) )

best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Custom grid based on user profile -- any cool smartgrid examples welcomed!!

2014-04-10 Thread Austin Taylor
Hi Stifan,

I guess I didn't properly phrase my question but I really appreciate your 
response. 

Currently users can access one of our databases using the grid layout. I 
want to give them the option of only seeing select fields through some type 
of checkbox or multiple select. Like this: 
http://dev.s-cubism.com/plugin_multiselect_widget

From there I want to only show select fields in the database on their 
selection and give them the ability to save the view.

I hope this paints a little clearer pictures.

On Thursday, April 10, 2014 10:52:33 AM UTC-4, 黄祥 wrote:

 if you set the access control correctly and set the logical for that it 
 can be done, for menu i think you can do something like :
 *controllers/install.py*
 def index():
 if db(db.auth_permission).isempty() and db(db.auth_membership).isempty():
 # group
 auth.add_group('Finance', 'Finance')
  # user
 db.auth_user.bulk_insert([{first_name : Finance, last_name : 
 Manager, 
email : finance...@a.com javascript:, username : 
 financemanager, 
password : db.auth_user.password.validate(password)[0]}, ])
  
 membership (group_id, user_id)
 
 # Finance
 auth.add_membership('1', '1')
 session.flash = T('Installation Done')
 redirect(URL(default, index) )

 *models/menu.py*
 if auth.has_membership(role = 'Finance'):
 response.menu += [
 (T('Finance'), False, URL('default', 'index'), [
 (T('Master'), False, URL('finance_master', 'index'), [
 (T('Bank'), False, URL('finance_master', 'bank'), []),
 ]),
 (T('Transaction'), False, URL('finance_transaction', 'index'), [
 (T('Payment'), False, URL('finance_transaction', 'payment_cart'), []),
 ]),
 (T('Report'), False, URL('finance_report', 'index'), [
 (T('Payment'), False, URL('finance_report', 'report_payment'), []),
 ]),
 ]), 
 ]

 best regards,
 stifan


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: develop iphone apps with web2py with this plugin

2014-04-10 Thread Rufus
The domain name in the link here expired a month ago  (March 8, 2014). 
Figures.


On Sunday, July 1, 2012 7:27:32 AM UTC-4, samrat kafle wrote:

  I tried this but not worked well I am searching a complete guide for 
 developing iphone apps and i have found one cool articles which i recommend 
 ofr dummies  here's a link developing iphone 
 appshttp://www.speakymagazine.com/iphone-app-development-guide-for-dummies/
  
 if you are really searching for developing iPhone apps with zero coding 
 skills.


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Enter from 0 to 255 characters on grid=SQLFORM How to fix?

2014-04-10 Thread Austin Taylor
Are there any other suggestions? I've tried everything and I really need 
help with this.

When the table is set to Migrate=True the sql log shows VARCHAR(255) even 
though my actual SQLDatabase shows 499 length and my length on the db model 
is set to length=500

On Thursday, April 10, 2014 11:05:29 AM UTC-4, 黄祥 wrote:

 please try to start from simple, create your new web2py application and 
 then put your define table there, after that check your sql.log or test it 
 from appadmin.
 e.g.
 *models/db.py*
 db.define_table('newtable',
  Field('Name','string'),
  Field('Comments', string', length=499) )

 best regards,
 stifan


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Enter from 0 to 255 characters on grid=SQLFORM How to fix?

2014-04-10 Thread Austin Taylor
Fixed it by changing string to text. 

Is there anything that could go wrong by me doing that?

On Thursday, April 10, 2014 12:52:13 PM UTC-4, Austin Taylor wrote:

 Are there any other suggestions? I've tried everything and I really need 
 help with this.

 When the table is set to Migrate=True the sql log shows VARCHAR(255) even 
 though my actual SQLDatabase shows 499 length and my length on the db model 
 is set to length=500

 On Thursday, April 10, 2014 11:05:29 AM UTC-4, 黄祥 wrote:

 please try to start from simple, create your new web2py application and 
 then put your define table there, after that check your sql.log or test it 
 from appadmin.
 e.g.
 *models/db.py*
 db.define_table('newtable',
  Field('Name','string'),
  Field('Comments', string', length=499) )

 best regards,
 stifan



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Does not contain for grid

2014-04-10 Thread LoveWeb2py
Is there a way to search for something that Does not Contain on the grid 
return?

I was trying to put something together with wildcards and such, but haven't 
been able to return results in a certain row that does not contain. For 
example



abcd
abcde
abcde
abcde
1394e
lajskl3
djklsajk3
djfl3fj3jja
blahblah
blah

How can I return only results that do not have a 3?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] unable to install application KPAX

2014-04-10 Thread Rufus
I tried to load the KPAX2 example app from:

https://github.com/mdipierro/web2py-appliances/blob/master/KPax2/web2py.app.KPax2.w2p

and I it kept telling me:

unable to install application KPAX

I don't know where to look for further details about WHY?

Rufus

(I tried loading it to PythonAnywhere as well as a local running web2py.)

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: unable to install application KPAX

2014-04-10 Thread Rufus
Progress...

Remembering a w2p is just a zipped archive, I opened it with 7zip and I 
found out this wasn't an archive.

apparently I downloaded a html page meant to be clicked-through.

Then a view raw let me download the actual repository.

Let's see how that goes...


On Thursday, April 10, 2014 2:30:05 PM UTC-4, Rufus wrote:

 I tried to load the KPAX2 example app from:


 https://github.com/mdipierro/web2py-appliances/blob/master/KPax2/web2py.app.KPax2.w2p

 and I it kept telling me:

 unable to install application KPAX

 I don't know where to look for further details about WHY?

 Rufus

 (I tried loading it to PythonAnywhere as well as a local running web2py.)



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: current trunk using memdb results in crash

2014-04-10 Thread David Manns
I am still seeing this in released version 2.9.5??

On Sunday, March 9, 2014 9:04:49 PM UTC-4, Massimo Di Pierro wrote:

 This is fixed in trunk.

 On Friday, 7 March 2014 21:11:08 UTC-6, Leonardo Pires Felix wrote:

 Looks like that this is happening with the REDIS too, Upgraded from 2.8.3 
 to 2.9.4 And the error persist.

 Traceback (most recent call last):
   File 
 /home/leonardo/domains/cef03.com/arquivos/web2py/gluon/restricted.py, line 
 217, in restricted
 exec ccode in environment
   File 
 /home/leonardo/domains/cef03.com/arquivos/web2py/applications/cef03/models/db.py
  https://cef03.com/admin/default/edit/cef03/models/db.py, line 62, in 
 module
 session.connect(request, response, db = sessiondb)
   File /home/leonardo/domains/cef03.com/arquivos/web2py/gluon/globals.py, 
 line 883, in connect
 row = table(record_id, unique_key=unique_key)
 TypeError: __call__() got an unexpected keyword argument 'unique_key'





 Em terça-feira, 4 de março de 2014 19h37min17s UTC-3, Sebastian Cambeo 
 escreveu:

 I can only provide assistance for the unique key error:
 line 883: https://github.com/web2py/web2py/blame/master/gluon/globals.py
 :
 dee4e6a9https://github.com/web2py/web2py/commit/dee4e6a980713f0a3a5bbd350e4b367c4c410327
  
 »https://github.com/web2py/web2py/blame/dee4e6a980713f0a3a5bbd350e4b367c4c410327/gluon/globals.py
  
 mdipierro https://github.com/mdipierro 
 2013-08-20 new session logic 


 I don't know how the int64 too big error was introduced



 Am Dienstag, 4. März 2014 22:29:56 UTC+1 schrieb Massimo Di Pierro:

 can you provide a patch or a revision number that broke it?

 On Saturday, 1 March 2014 12:25:14 UTC-6, Bas Ti wrote:

 The current trunk does not support using memcache as session store on 
 GAE:
 session.connect calls memdb.Table.__call__(recordid, 
 unique_key=unique_key)

 however unique_key is not supported by memdb.Table, it is only 
 supported by dal.Table



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] security issue in the OpenSSL

2014-04-10 Thread Michele Comitini
Detailed info here: http://heartbleed.com/

really bad stuff.

mic

2014-04-10 9:42 GMT+02:00 Annet anneve...@googlemail.com:
 I guess you've been notified as well, in case you haven't ...

 Yesterday my hosting provider notified me of the following issue:

 As you have probably heard a serious security issue (dubbed the heartbleed
 bug) was found in the OpenSSL library yesterday.
 This is a very serious issue as this library is used to encrypt a large
 percentage of the Internet's traffic, including web and email.

 The security issue could allow anybody to access parts of the encrypted
 traffic as well as the secret keys used to encrypt that traffic.


 Kind regards,

 Annet

 --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google Groups
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: unable to install application KPAX

2014-04-10 Thread Rufus
Well,

Couldn't even open default/index: there was a problem with foreign keys 
right off the bat.   Modified the model to ignore the foreign key 
constraint, for better or worse.

   Then I found out the layout.html does not handle the nested menu created 
in menu.py.

   (All this because I was looking for a chat example in web2py...)




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: current trunk using memdb results in crash

2014-04-10 Thread Sebastian Cambeo
Try deleting memcache and browser cache

Am Donnerstag, 10. April 2014 21:13:39 UTC+2 schrieb David Manns:

 I am still seeing this in released version 2.9.5??

 On Sunday, March 9, 2014 9:04:49 PM UTC-4, Massimo Di Pierro wrote:

 This is fixed in trunk.

 On Friday, 7 March 2014 21:11:08 UTC-6, Leonardo Pires Felix wrote:

 Looks like that this is happening with the REDIS too, Upgraded from 
 2.8.3 to 2.9.4 And the error persist.

 Traceback (most recent call last):
   File 
 /home/leonardo/domains/cef03.com/arquivos/web2py/gluon/restricted.py, 
 line 217, in restricted
 exec ccode in environment
   File 
 /home/leonardo/domains/cef03.com/arquivos/web2py/applications/cef03/models/db.py
  https://cef03.com/admin/default/edit/cef03/models/db.py, line 62, in 
 module
 session.connect(request, response, db = sessiondb)
   File /home/leonardo/domains/cef03.com/arquivos/web2py/gluon/globals.py, 
 line 883, in connect
 row = table(record_id, unique_key=unique_key)
 TypeError: __call__() got an unexpected keyword argument 'unique_key'





 Em terça-feira, 4 de março de 2014 19h37min17s UTC-3, Sebastian Cambeo 
 escreveu:

 I can only provide assistance for the unique key error:
 line 883: 
 https://github.com/web2py/web2py/blame/master/gluon/globals.py:
 dee4e6a9https://github.com/web2py/web2py/commit/dee4e6a980713f0a3a5bbd350e4b367c4c410327
  
 »https://github.com/web2py/web2py/blame/dee4e6a980713f0a3a5bbd350e4b367c4c410327/gluon/globals.py
  
 mdipierro https://github.com/mdipierro 
 2013-08-20 new session logic 


 I don't know how the int64 too big error was introduced



 Am Dienstag, 4. März 2014 22:29:56 UTC+1 schrieb Massimo Di Pierro:

 can you provide a patch or a revision number that broke it?

 On Saturday, 1 March 2014 12:25:14 UTC-6, Bas Ti wrote:

 The current trunk does not support using memcache as session store on 
 GAE:
 session.connect calls memdb.Table.__call__(recordid, 
 unique_key=unique_key)

 however unique_key is not supported by memdb.Table, it is only 
 supported by dal.Table



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] how to determine which foreign key is constraint problem?

2014-04-10 Thread Alex Glaros
how to determine which foreign key is the constraint problem?

class 'sqlite3.IntegrityError' foreign key constraint failed Version  
web2py™ Version 2.9.5-stable+timestamp.2014.03.20.22.57.13  Python Python 
2.7.6: C:\Program Files\web2py\web2py.exe (prefix: C:\Python27)  Traceback 

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

Traceback (most recent call last):
  File /home/mdipierro/make_web2py/web2py/gluon/restricted.py, line 220, in 
restricted
  File C:/Program Files/web2py/applications/ceaA/controllers/default.py 
http://127.0.0.1:8000/admin/default/edit/ceaA/controllers/default.py, line 
1061, in module
  File /home/mdipierro/make_web2py/web2py/gluon/globals.py, line 385, in 
lambda
  File /home/mdipierro/make_web2py/web2py/gluon/tools.py, line 3287, in f
  File C:/Program Files/web2py/applications/ceaA/controllers/default.py 
http://127.0.0.1:8000/admin/default/edit/ceaA/controllers/default.py, line 
408, in add_new_government_organization
partyID = db.Party.insert(**db.Party._filter_fields(form.vars))
  File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line 9114, in insert
  File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line 1360, in insert
IntegrityError: foreign key constraint failed


thanks,


Alex Glaros

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] web2py with Plesk Control Panel ?

2014-04-10 Thread peter


 Just to warn people about nginx and uwsgi with plesk control panel.  I 
 used uwsgi with nginx on centos 5, using the script that comes with web2py 
 (I helped write it). This worked fine, but then suddenly plesk decided to 
 include nginx to run alongside apache. This configuration totally conflicts 
 with my own configuration. So the plesk upgrade crashed my site and it took 
 a long time to work out why. In the short term I had to get my VSP provider 
 to stop updating my plesk. Meanwhile I setup my configuration on a new VSP 
 without plesk. For me plesk only adds complexity that one is much better 
 off without.

 Peter
 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: how to determine which foreign key is constraint problem?

2014-04-10 Thread 黄祥
not sure about the problem because of lack info of your code, perhaps is 
just the define table arrangement.
*e.g. wrong arrangement because the table define the customer first yet it 
can not found the bank table*
db.define_table('customer', 
Field('name'), 
Field('bank', 'reference bank'), 
format = '%(name)s')

db.define_table('bank', 
Field('name'),
format = '%(name)s')

*e.g. correct arrangement*
db.define_table('bank', 
Field('name'),
format = '%(name)s')
db.define_table('customer', 
Field('name'), 
Field('bank', 'reference bank'), 
format = '%(name)s')

best regards.
stofam



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Custom grid based on user profile -- any cool smartgrid examples welcomed!!

2014-04-10 Thread 黄祥
i think it can be achieve it when you store it in database and use the 
query to compare the authorization for the page.
please read the web2py book about access control
ref:
http://web2py.com/books/default/chapter/29/09/access-control

best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: how to determine which foreign key is constraint problem?

2014-04-10 Thread Alex Glaros


 I meant do any error codes tell you what table has the problem?



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: how to determine which foreign key is constraint problem?

2014-04-10 Thread 黄祥
i think the culprit is hiding around here :

File C:/Program Files/web2py/applications/ceaA/controllers/default.py 
http://127.0.0.1:8000/admin/default/edit/ceaA/controllers/default.py, line 
408, in add_new_government_organization


please investigate what lies on the line 408 in your traceback.
as you said, you can comment the requires first if you want.

best regards,
stifan



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: how to determine which foreign key is constraint problem?

2014-04-10 Thread Alex Glaros
the problem was I set a default in the controller that didn't exist in the 
data

was looking for shortcuts to analyze constraints but I guess what you 
provided is as narrow as it gets

thanks

Alex

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Online Manual: Chapter 9: Access Control - Formatting/content issues?

2014-04-10 Thread Tim Richardson
it;s been fixed ... just waiting for caches to clear, I think.

On Friday, 11 April 2014 00:03:39 UTC+10, DenesL wrote:


 True, everything after 9.1.5 Renaming Auth tables is corrupted.


 On Thursday, April 10, 2014 5:58:58 AM UTC-4, Seeker wrote:

 Hi,

 Is it just me (and my lack of appropriate knowledge) or is there 
 something wrong with chapter 9 of the book?
 The text starts off well, but about halfway down the page the formatting 
 seems jumbled and there seems to be some info missing as well.

 Thanks.



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.