ATTENTION trunk users!!!!

138 views
Skip to first unread message

Massimo Di Pierro

unread,
May 25, 2011, 2:20:48 PM5/25/11
to web2py-users
There is a new feature in trunk that needs tests and CAN mess up your
database metadata so...

1) remember - user trunk at your own risk
2) it would be great if you could test it but make sure you backup
your metadata (databases/*.table) first
3) if you upgrade to trunk please let me know if you encounter any
problem with existing apps on upgrade

What is the new feature? It changes the format of the databases/
*.table metadata to a more verbose format. Why? Because this will
allow to open a database from a script without having to run the
models. Web2py will be able to discover the metadata and rebuild the
table definitions automatically.

This is half done but needs a little more work and testing.

Massimo

David J.

unread,
May 25, 2011, 2:29:28 PM5/25/11
to web...@googlegroups.com
Thanks Massimo;

Sounds good;

Perhaps you can also let us know when it is safe to pull from Trunk for
those using trunk in production.

Thanks.

David

Bruno Rocha

unread,
May 25, 2011, 2:56:30 PM5/25/11
to web...@googlegroups.com
I would like to have a 'stable' repository to pull from my production servers (it will remove the need to manage the branches)
--
Bruno Rocha

Bruno Rocha

unread,
May 25, 2011, 2:57:39 PM5/25/11
to web...@googlegroups.com
a HG repository of course, but, it would be very nice if some could maintain multiple repositories as git,svn, bazaar and hg for automate scripts on production servers.

--
Bruno Rocha



pbreit

unread,
May 25, 2011, 3:16:16 PM5/25/11
to web...@googlegroups.com
Yeah, since I'm moving into production, I'm getting concerned about bug fixes only going in trunk. I realize managing two branches is tricky but that can't be too far on the horizon.

Massimo Di Pierro

unread,
May 25, 2011, 3:50:58 PM5/25/11
to web2py-users
It is never safe to pull from trunk. ;-) when it is safe I move it to
stable....

by the way I added support for circular references:

db.define_table('a',Field('name'),Field('b','reference b'))
db.define_table('b',Field('name'),Field('a','reference a'))
db.define_table('c',Field('name'),Field('c','reference c'))

at the expense of no check for broken reference

db.define_table('a',Field('name'),Field('b','reference d'))
cannot check if the reference if broken since d may or may not be
defined.

will be in trunk later in the day.

David J.

unread,
May 25, 2011, 4:05:01 PM5/25/11
to web...@googlegroups.com
Yes; Thats True;

if production == True:
'clone stable'
else:
'good luck buster'

Bruno Rocha

unread,
May 25, 2011, 4:34:19 PM5/25/11
to web...@googlegroups.com
On Wed, May 25, 2011 at 5:05 PM, David J. <da...@styleflare.com> wrote:
if production == True:
   'clone stable'

did you mean $hg clone http://code.google....... web2py ? managing heads and branches to get stable form repository? or is there a stable hg repository?  

pbreit

unread,
May 25, 2011, 7:30:43 PM5/25/11
to web...@googlegroups.com
I suspect he meant $hg update R-1.95.1

And, more Pythonic:

if production:
    ...

David J

unread,
May 25, 2011, 7:34:25 PM5/25/11
to web...@googlegroups.com

Hey sorry for the delayed response.  But if was meant as joke.

ron_m

unread,
May 25, 2011, 7:48:44 PM5/25/11
to web...@googlegroups.com
I backed up my database, made a copy of the application databases directory, hg pull and hg update on trunk.

Got this traceback right away

Traceback (most recent call last):
File "/home/camcentral/Dev/web2py-hg/gluon/restricted.py", line 184, in restricted
exec ccode in environment
File "/home/camcentral/Dev/web2py-hg/applications/ccims/models/A_db.py", line 49, in <module>
auth.define_tables(username=True) # creates all needed tables
File "/home/camcentral/Dev/web2py-hg/gluon/tools.py", line 1148, in define_tables
format='%(username)s')
File "/home/camcentral/Dev/web2py-hg/gluon/dal.py", line 4175, in define_table
polymodel=polymodel)
File "/home/camcentral/Dev/web2py-hg/gluon/dal.py", line 633, in create_table
fake_migrate=fake_migrate)
File "/home/camcentral/Dev/web2py-hg/gluon/dal.py", line 716, in migrate_table
if query:
UnboundLocalError: local variable 'query' referenced before assignment

Did I miss a step? In development I default migrate=True fake_migrate=False

Ron

ron_m

unread,
May 25, 2011, 7:52:52 PM5/25/11
to web...@googlegroups.com
query isn't set in the last elif branch before the else

ron_m

unread,
May 25, 2011, 8:09:41 PM5/25/11
to web...@googlegroups.com
I added query = None after line 668 which is the line containing

for key in keys:

just before the line

if not key in sql_fields_old:

and got rid of all the query = None statements in the if elif branches plus got rid of the else branch.

I am happy to report this allowed the application to run completely without error.

I don't use all the features of web2py but then I am sure very few of us do.

Ron

Massimo Di Pierro

unread,
May 25, 2011, 9:32:06 PM5/25/11
to web2py-users
Did anybody try with mysql?

Massimo

mattgorecki

unread,
May 25, 2011, 9:41:47 PM5/25/11
to web2py-users
I'm using MySQL and I just updated. All of the *.table files updated
and the my app seems to be running okay so far.

Matt

On May 25, 7:32 pm, Massimo Di Pierro <massimo.dipie...@gmail.com>
wrote:

Massimo Di Pierro

unread,
May 25, 2011, 9:44:24 PM5/25/11
to web2py-users
:-)

good. If the app starts than your metadata is correct.

Carlos

unread,
Jun 12, 2011, 9:06:10 PM6/12/11
to web...@googlegroups.com
Hi Massimo,

I believe this new feature for circular references is not working properly for postgresql.

Please check my message posted here:


Thanks,

   Carlos

Message has been deleted

Richard Vézina

unread,
Jun 22, 2011, 5:20:07 PM6/22/11
to web...@googlegroups.com
Hello,

Is this is a concern for the 1.96.4??

I not synching my web2py model with database model : migrate=False

I read somewhere recently that changes will occur for default migrate option?

Could I break something by migrating my prod database under 1.96.4?

Thanks

Richard

On Mon, Jun 13, 2011 at 6:57 AM, anil manikyam <anilman...@gmail.com> wrote:


i have a one field i.e) username 
i want to accept only alphabets plz send this code
db.define_table('table1',
    Field('username', 'string')


plz send code for this 


--
@n!l m@n!ky@m

Massimo Di Pierro

unread,
Jun 22, 2011, 5:51:15 PM6/22/11
to web2py-users
If you refer to the issue that started the thread, I think you do not
need to worry. Enough people have tried it without complaints.

On Jun 22, 4:20 pm, Richard Vézina <ml.richard.vez...@gmail.com>
wrote:
> Hello,
>
> Is this is a concern for the 1.96.4??
>
> I not synching my web2py model with database model : migrate=False
>
> I read somewhere recently that changes will occur for default migrate
> option?
>
> Could I break something by migrating my prod database under 1.96.4?
>
> Thanks
>
> Richard
>

Richard Vézina

unread,
Jun 22, 2011, 6:00:18 PM6/22/11
to web...@googlegroups.com
Thanks.

Richard
Reply all
Reply to author
Forward
0 new messages