[web2py:10408] Re: web2py cookbook anyone?

2008-10-17 Thread noobpythoncoder
Lol! Great to see this discussion degenerate/lighten-up into flash bar fanboyism =P If anyone read my original request to change the flash bar... http://groups.google.com/group/web2py/browse_thread/thread/dbfaf23d9acacc8a/c0a2f8bc493d587d?lnk=gst&q=flash+bar#c0a2f8bc493d587d ... they'd note I:

[web2py:10407] Re: Did your post not show up in this group?

2008-10-17 Thread yarko
Great! Thanks for your patience! On Oct 17, 8:28 pm, justinjas <[EMAIL PROTECTED]> wrote: > Oh yeah I was wondering what happened to it.  I just reposted it, > since I had it send me an email. > > Justin > > On Oct 17, 7:25 pm, yarko <[EMAIL PROTECTED]> wrote: > > > I messed up. > > > I clicked

[web2py:10406] Re: Did your post not show up in this group?

2008-10-17 Thread justinjas
Oh yeah I was wondering what happened to it. I just reposted it, since I had it send me an email. Justin On Oct 17, 7:25 pm, yarko <[EMAIL PROTECTED]> wrote: > I messed up. > > I clicked too quickly, and think I moderated someone's post to block > instead of post > > If you posted a questi

[web2py:10405] Google App Engine with web2py and high cpu cycles / slow response time

2008-10-17 Thread justinjas
I just started playing around with web2py and setup a very basic app that merely displays the ip address of the visitor (ipaddresstoday.com). The problem I'm having is that every request is going over the allotted cpu cycles for an request in app engine. For example in my logs on app engine I al

[web2py:10404] Re: web2py cookbook anyone?

2008-10-17 Thread Tito Garrido
flash bar rox! On Fri, Oct 17, 2008 at 12:25 PM, Phyo Arkar <[EMAIL PROTECTED]>wrote: > I love massimo's web2py's flashbar too.. > And web2py is not depended on just one ajax effect ., You can switch to any > ajax framework anytime. > > > > > > On Fri, Oct 17, 2008 at 3:18 PM, yarko <[EMAIL PROTE

[web2py:10403] Re: t2 and stamp columns

2008-10-17 Thread mdipierro
I think you are right. On Oct 17, 6:19 pm, billf <[EMAIL PROTECTED]> wrote: > For the "stamp" columns do you not think that the default should be > like the 'id' column - do not expose/display? > > On Oct 18, 12:11 am, mdipierro <[EMAIL PROTECTED]> wrote: > > > for your own tables you should do >

[web2py:10402] Did your post not show up in this group?

2008-10-17 Thread yarko
I messed up. I clicked too quickly, and think I moderated someone's post to block instead of post If you posted a question about GAE, your test app which just echos IP address - and you don't see it here, please email me - I'll fix my mistake. Kind regards, Yarko *sigh* my daughter called

[web2py:10401] Re: t2 and stamp columns

2008-10-17 Thread billf
For the "stamp" columns do you not think that the default should be like the 'id' column - do not expose/display? On Oct 18, 12:11 am, mdipierro <[EMAIL PROTECTED]> wrote: > for your own tables you should do > > db.tablename.esposes=['field1','field2','etc'] > > to list the fields that you want t

[web2py:10400] Re: t2 and stamp columns

2008-10-17 Thread mdipierro
for your own tables you should do db.tablename.esposes=['field1','field2','etc'] to list the fields that you want to appear in forms and exclude those you do not want. db.tablename.displays=['field1','field2','etc'] to list fields that should be displayed by t2.display I will look into the ot

[web2py:10397] Re: t2 and passing arguments

2008-10-17 Thread mdipierro
do not use relative paths. use {{=URL(r=request,c='static',f='filename.gif')}} On Oct 17, 4:59 pm, billf <[EMAIL PROTECTED]> wrote: > When I code the following action: > > def update_lookup(): >     lookup=t2.update(db.lookup) >     search=t2.search(db.lookup) >     return dict(lookup=lookup,sear

[web2py:10399] t2 and stamp columns

2008-10-17 Thread billf
I am trying to test the behaviour of the new t2 "stamped" columns. The T2 manual says of the "Stamp" pattern: "Automatically stamp table records for creation date, author, last modification date and author of the last modification." I thought initially that this meant that those columns would be

[web2py:10398] Re: Question re migrate

2008-10-17 Thread mdipierro
You should look inside the .table files. They are just pickles. On Oct 17, 5:33 pm, billf <[EMAIL PROTECTED]> wrote: > Annet > > I'm guessing here (maybe someone else can confirm this): if when you > install the new application you copied the .table files from the mock > application databases fol

[web2py:10396] Re: t2 and define_table problems

2008-10-17 Thread billf
The basic problem was solved once I understood more about the .table files. Thanks all. On Oct 17, 5:21 pm, mdipierro <[EMAIL PROTECTED]> wrote: > If you comment everything else, does this > >     db=SQLDB('mysql://blah:[EMAIL PROTECTED]:3306/onestepbeyond') >     from applications.plugin_t2.modu

[web2py:10395] messed up on group management task

2008-10-17 Thread yarko
If you recently made a post about gae, and echoing ip addresses - I think I made a mistake, too quickly moderated and clicked the wrong box by mistake. If I'm right, then you will need to send me an email, and I'll correct the situation. Sorry about that! Yarko --~--~-~--~~

[web2py:10394] Re: Question re migrate

2008-10-17 Thread billf
Annet I'm guessing here (maybe someone else can confirm this): if when you install the new application you copied the .table files from the mock application databases folder to the new application then I think web2py would be happy to migrate changes. However, if this is true then I'm not sure w

[web2py:10393] Re: Sessions in MySQL bug?

2008-10-17 Thread billf
I doubt this is related but if I try to step thru code in EasyEclipse I get a problem where the session _formkey[table] is equal to vars_formkey until I step over the self.formname=formname in DIV.accepts() at which point all the session._formkey values change and accepts() returns false This

[web2py:10392] t2 and passing arguments

2008-10-17 Thread billf
When I code the following action: def update_lookup(): lookup=t2.update(db.lookup) search=t2.search(db.lookup) return dict(lookup=lookup,search=search) ...it appears to create a url in the form http://server:port/application/controller/action/id This has the effect that any relativ

[web2py:10391] Re: T2 and a new high level pattern for TAGGABLE

2008-10-17 Thread mdipierro
tags are stored as '[red][green][blue]' so you can search using like db(db.transaction.tags.like('%[red]%')).count() will count all the items tagged red. Do not call your table transaction, it is a SQL keyword. Massimo On Oct 17, 2:36 pm, "Steve Shepherd" <[EMAIL PROTECTED]> wrote: > Ok thats

[web2py:10390] Re: Sessions in MySQL bug?

2008-10-17 Thread mdipierro
not yet. I will take a look during the week-end. On Oct 17, 2:11 pm, ceej <[EMAIL PROTECTED]> wrote: > Hi there, > > If i use session.connect(request,response,tablename='sessions',db=db) > on my production server which uses MySQL It resets the sessions on > every page load, it works fine in my de

[web2py:10389] Re: T2 and a new high level pattern for TAGGABLE

2008-10-17 Thread Steve Shepherd
Ok thats what I mean I have a question though: If you have code like: # Model db.definetable('transaction', db.field('spendamount,'double'), db.field('tags','text')) # Controller Count and Totals #I want some code to create an object that groups by the tags field and provides and total for

[web2py:10388] Sessions in MySQL bug?

2008-10-17 Thread ceej
Hi there, If i use session.connect(request,response,tablename='sessions',db=db) on my production server which uses MySQL It resets the sessions on every page load, it works fine in my development server that uses sqlite. I know i mentioned this before, did you get a chance to have a look at it?

[web2py:10387] Re: Question re migrate

2008-10-17 Thread mdipierro
No. You can change it. You cannot change it only if web2py did not create the model but you created it manually using sql. Massimo On Oct 17, 11:47 am, annet <[EMAIL PROTECTED]> wrote: > I ran into the same problem. I had a mock application in which I > created the model. Later I uninstalled the

[web2py:10386] Re: Question re migrate

2008-10-17 Thread billf
OK - I was misunderstanding the instruction to delete the files under the database folder. I'm sure that will move me on. Many thanks. On Oct 17, 5:44 pm, billf <[EMAIL PROTECTED]> wrote: > I believe that the metadata is available for most if not all db > engines but they don't all follow the I

[web2py:10385] Re: Question re migrate

2008-10-17 Thread annet
I ran into the same problem. I had a mock application in which I created the model. Later I uninstalled the mock application and created a new application in which I use the same model. The problem is that when I want to alter something (let's say the length of a field from 20 to 30) in the model

[web2py:10384] Re: Question re migrate

2008-10-17 Thread billf
I believe that the metadata is available for most if not all db engines but they don't all follow the INFORMATION_SCHEMA standard so I don't blame anyone for side-stepping this issue. However, I have a newsitem.table in my databases folder so why isn't web2py using that? On Oct 17, 5:14 pm,

[web2py:10381] Re: Question re migrate

2008-10-17 Thread Phyo Arkar
have you delete all under databases folder? On Fri, Oct 17, 2008 at 4:18 PM, billf <[EMAIL PROTECTED]> wrote: > > Ok did the following: > 1) delete all tables > 2) select 'data administration': get ticket > File "/usr/local/web2py/gluon/sql.py", line 500, in define_table >raise e > Programmi

[web2py:10383] Re: Question re migrate

2008-10-17 Thread Phyo Arkar
Massimo , how about making Web2py able to analyse table structures via SQLReflections ? That is done with Squlsoup extension of SQLAlchemy., Wont be difficult to implement. On my free time i will check how SQLSoup works and try to implement for web2py. On Fri, Oct 17, 2008 at 4:22 PM, Phyo Arkar

[web2py:10382] Re: Question re migrate

2008-10-17 Thread mdipierro
When you delete (drop) tables you also have to delete the .table files in the databases folder. Did you do that? I think you are using two threads for the same problem. Massimo On Oct 17, 11:18 am, billf <[EMAIL PROTECTED]> wrote: > Ok did the following: > 1) delete all tables > 2) select 'data

[web2py:10380] Re: t2 and define_table problems

2008-10-17 Thread mdipierro
If you comment everything else, does this db=SQLDB('mysql://blah:[EMAIL PROTECTED]:3306/onestepbeyond') from applications.plugin_t2.modules.t2 import T2 t2=T2(request,response,session,cache,T,db) work? Did you try sqlite first? Nothing to do with your error but change author_id wit

[web2py:10379] Re: Question re migrate

2008-10-17 Thread billf
Ok did the following: 1) delete all tables 2) select 'data administration': get ticket File "/usr/local/web2py/gluon/sql.py", line 500, in define_table raise e ProgrammingError: (1146, "Table 'onestepbeyond.newsitem' doesn't exist") 3) sql.log contains: timestamp: 2008-10-17T17:13:59.772235

[web2py:10378] Re: Question re migrate

2008-10-17 Thread mdipierro
web2py cannot query the data the database for the table structures. Hence it can do migrations if and only if web2py created the tables in the first place. In this case it maintains a local representation of the table structure in the .table files. You cannot do a migration on a table that was pr

[web2py:10377] t2 and define_table problems

2008-10-17 Thread billf
I installed t2 and got some basic examples up and running ok using a MySQL database. I want to test out some of the in-built columns, e.g. created_on and modified_on so I added these to my tables and got the "person table already exists" raised in my previous post. So I deleted all the tables an

[web2py:10367] Re: Python Related Question- string's replace function

2008-10-17 Thread Timothy Farrell
Regular Expressions would probably be more robust...but doing such a large replace seems odd to me. If it were my code I would look for a way around not having so much that needed replacing. Or perhaps you should use string slicing. Anyway, here's how you would do it with regexps: import re

[web2py:10376] Re: Question re migrate

2008-10-17 Thread Phyo Arkar
This usually happens to me too (only on MySQL, ok with SQLlite) If that happens what i have to do is Delete all database files under Databases folder and Drop the table. And retry again.. How to make it work under web2py? On Fri, Oct 17, 2008 at 3:25 PM, yarko <[EMAIL PROTECTED]> wrote: > > wh

[web2py:10375] Re: Python Related Question- string's replace function

2008-10-17 Thread Phyo Arkar
Nice Tim! thanks Alot for taking time at analyzing C source code of Python! So here it checks for preventing overflows, I C . Good work, We are glad to have you on the Web2py group Tim. Regards, Phyo. Star-Nix Solutions On Fri, Oct 17, 2008 at 3:17 PM, Timothy Farrell <[EMAIL PROTECTED]> wro

[web2py:10374] Re: Question re migrate

2008-10-17 Thread yarko
what does your sql.log show? On Oct 17, 10:08 am, billf <[EMAIL PROTECTED]> wrote: > I'm a bit confused re migrate. > > I thought that if changes had been made to a table in the model and > migrate=True, whether specific or by default, then web2py would > magically alter the table.  And I could h

[web2py:10373] Re: web2py cookbook anyone?

2008-10-17 Thread Phyo Arkar
I love massimo's web2py's flashbar too.. And web2py is not depended on just one ajax effect ., You can switch to any ajax framework anytime. On Fri, Oct 17, 2008 at 3:18 PM, yarko <[EMAIL PROTECTED]> wrote: > > +1frankly, (as a user experiencing forms) I love the flashbar > too! :-) > > On

[web2py:10372] Re: web2py cookbook anyone?

2008-10-17 Thread yarko
+1frankly, (as a user experiencing forms) I love the flashbar too! :-) On Oct 17, 9:46 am, mdipierro <[EMAIL PROTECTED]> wrote: > Hi Noob, > > There are benefits of having a documentation project started from the > community. The main benefit is that is shows skeptics this is no > longer a on

[web2py:10371] Re: Python Related Question- string's replace function

2008-10-17 Thread Timothy Farrell
I see. Looking at the *replace_interleave *function at http://svn.python.org/view/python/branches/release25-maint/Objects/stringobject.c?rev=66121&view=auto , you can see where it checks for an overflow error (about 20 lines down). It appears to be an architectural limitation based on the im

[web2py:10369] Re: Python Related Question- string's replace function

2008-10-17 Thread Phyo Arkar
Dear Tim; Thanks for quick response all the time. I am thinking about using re , but i would like to know and confirm if str.replace() have limitations on size of string. Which dosen't seem to be documented.. Regards, Phyo. On Fri, Oct 17, 2008 at 3:02 PM, Timothy Farrell <[EMAIL PROTECTED]> w

[web2py:10368] Re: Python Related Question- string's replace function

2008-10-17 Thread Timothy Farrell
Correction... re.subn(r'.{1,502}' ,'replacewiththis', srcString) Timothy Farrell wrote: > Regular Expressions would probably be more robust...but doing such a > large replace seems odd to me. If it were my code I would look for a > way around not having so much that needed replacing. Or perh

[web2py:10370] Question re migrate

2008-10-17 Thread billf
I'm a bit confused re migrate. I thought that if changes had been made to a table in the model and migrate=True, whether specific or by default, then web2py would magically alter the table. And I could have sworn that this is what had happened when I made some changes in the past(?) However, ha

[web2py:10366] Python Related Question- string's replace function

2008-10-17 Thread Phyo Arkar
Dear All; If anyone knows ?I would like to know if there Size Limitation on str.replace() function. Because from what i have tested , it no-longer replace anything after 502 length of string. I want to replace a huge block of string and that , i am having problem. Regards, Phyo. --~--~--

[web2py:10365] Re: web2py cookbook anyone?

2008-10-17 Thread mdipierro
Hi Noob, There are benefits of having a documentation project started from the community. The main benefit is that is shows skeptics this is no longer a one man project. I get a lot of emails from companies who are interested in using web2py but are skeptical about long term development. This lis

[web2py:10364] Re: Python 2.6 anyone?

2008-10-17 Thread mdipierro
Yes, in the latsest version there should not be the as=None argument any more. On Oct 17, 8:50 am, Timothy Farrell <[EMAIL PROTECTED]> wrote: > Scott, > > Are you running the latest version of web2py? I submitted a patch to > Massimo that covered this particular problem monday of last week. I c

[web2py:10363] Re: T2 and a new high level pattern for TAGGABLE

2008-10-17 Thread mdipierro
add to your_table a record tags then do db.your_table.tags.widget=t2.tag_widget(['tag1','tag2','tag3']) Is this what you are suggesting? Perhaps we can have more customization of the widget. Massimo On Oct 17, 4:34 am, "Steve Shepherd" <[EMAIL PROTECTED]> wrote: > This is an idea for a new pa

[web2py:10362] Re: Database table from SQL query

2008-10-17 Thread mdipierro
db.define_table('tableE',SQLField('name')) db.define_table('tableA',SQLField('tableE',db.tableE),SQLField('name')) condition=db.tableE.name.like('%o') ## records where name ends in 'o' db.tableA.tableE.requires=IS_IN_DB(db(condition),'tableE.id','% (name)s') On Oct 17, 3:47 am, morningovermidn

[web2py:10361] Re: Testing in web2py

2008-10-17 Thread Timothy Farrell
Massimo, I implied in my previous post, that I don't use web2py's built-in testing. This brings me to a question...what is the "test" directory for under the application root? Since the admin interface only runs doctests, what would be a good way of running a unittest that I place in /applic

[web2py:10360] Re: Python 2.6 anyone?

2008-10-17 Thread Timothy Farrell
Scott, Are you running the latest version of web2py? I submitted a patch to Massimo that covered this particular problem monday of last week. I can see that he's already committed it to trunk, it just hasn't made it out to a release I guess. If you want to keep going with 2.6, it's safe to

[web2py:10359] Re: Python 2.6 anyone?

2008-10-17 Thread Scott Hunter
When trying to run web2py off of Python 2.6, we got the following error from code that works fine under Python 2.5.x (note that the error trace never ventures out of the web2py code). Our immediate solution is to use the older Python, but thought I'd point it out (this is run on a Windows 2000 SP

[web2py:10358] Re: Testing in web2py

2008-10-17 Thread Timothy Farrell
An excellent question. Testing in web2py is somewhat of a misnomer since you use web2py to create web applications but you can only truly test the models or controllers, not the product of all three MVC components. However, there isn't really a better way unless Massimo wants to include anoth

[web2py:10357] Re: web2py cookbook anyone?

2008-10-17 Thread Phyo Arkar
Dear Pystar and noobypythoncode. Nice comments , Nice license consideration pystar. Thats what i would like to see. Noobypythoncoder , CookBook is not a tutorial or teaching book. That goes for Massimo's Book. CookBook is a collection of Useful code Snippet , usually less then 1 page of code

[web2py:10356] Re: Seeing changes made to a module in app/modules without restarting web2py

2008-10-17 Thread Jose de Oliveira Filho
Hi, reload(module) You might want to take that out once you go into production. (I just asked the same question this week, there's a small thread on that.) Deodoro Filho Em 17/10/2008, às 06:47, cjparsons escreveu: > > I have some helper functions in applications/[application]/modules/ > he

[web2py:10355] Re: web2py cookbook anyone?

2008-10-17 Thread Pystar
Thank you all for your suggestions, i have to make a point clear here, this web2py cookbook that i am compiling is in no way trying to rival any official book or documentation by Massimo, it is being compiled along the line of the "Python Cookbook" by Orielly, where users of web2py submit useful t

[web2py:10354] T2 and a new high level pattern for TAGGABLE

2008-10-17 Thread Steve Shepherd
This is an idea for a new pattern in T2. The idea is to allow a user to tag this records with tags or labels. The user may select one or many and params can be set for wether it is required or whether more than one tag can be selected. I may be over thinking this as there may be a solution already.

[web2py:10353] Re: web2py cookbook anyone?

2008-10-17 Thread noobpythoncoder
At this point - the license-type is IRRELEVANT. The REAL issue is: Will ANOTHER '''cookbook''' benefit web2py??? WHY NOT first ask Massimo if you can open the existing cookbook? Or CONTRIBUTE the free content of this group to it, and improve the cookbook for everyone? Undoubtedly, phyo,

[web2py:10351] Seeing changes made to a module in app/modules without restarting web2py

2008-10-17 Thread cjparsons
I have some helper functions in applications/[application]/modules/ helperFunctions.py. I import that in my controller using the full path applications/ [application]/modules/helperFunctions I find that if I make changes to helperFunctions.py web2py doesn't see them until I restart web2py. Is th

[web2py:10352] Database table from SQL query

2008-10-17 Thread morningovermidnight
Ok, here goes. I would like to add another table to my database and link it to an already exsisting table in my database. Lets say the existing table is table-E, and the table to add is table-A. Usually, adding a table with a foreign key reference to another table is no problem. But for this situa

[web2py:10350] Testing in web2py

2008-10-17 Thread morningovermidnight
I've been reading earlier posts on unittests and using doctests in web2py. I have tried and run some successful doctests in web2py. However, it seems that the doctest is testing the value that my function returns, as it should, but is there a way to write a test to check an intermediate value in m