[web2py:10940] Re: How to extend a model

2008-11-01 Thread mdipierro
oops, you are right. Massimo On Nov 2, 1:46 am, billf <[EMAIL PROTECTED]> wrote: > You need a slight amendment to the second example above. I believe > the following: > > from gluon.sql import SQLTable > base_table=SQLTable('base_table',SQLField('myfield')) > db.define_table('derived_table',bas

[web2py:10939] Re: Getting a Warning straight out of the box for web2py + GAE

2008-11-01 Thread mdipierro
These warning are normal. They tell you that you do no have database drivers for sqlite, mysql, postgresql, mssql, firebird, oracle and no access to the filesystem. You an disable those loggings by inserting import logging logging.basicConfig(level=35) on top of gaehandler.py Massimo On Nov 2

[web2py:10938] Re: Problems attaching to either remote or localhost PostgreSql

2008-11-01 Thread mdipierro
Happy to hear that! Massimo On Nov 2, 1:20 am, NoviceSortOf <[EMAIL PROTECTED]> wrote: > >do you have db.define_table() in your models? > > I did not, somehow that got clipped, in my late night coding frenzy. > > After adding db.define_table(...), > reran tests, > got a 'relation already exi

[web2py:10937] Re: How to extend a model

2008-11-01 Thread billf
You need a slight amendment to the second example above. I believe the following: from gluon.sql import SQLTable base_table=SQLTable('base_table',SQLField('myfield')) db.define_table('derived_table',base_table,SQLField('otherfield')) (only derived_table is created) ...should be: from gluon.sq

[web2py:10936] Re: Getting a Warning straight out of the box for web2py + GAE

2008-11-01 Thread Jonathan Benn
When I try running the WELCOME application (http://localhost:8080/ welcome), I get the following warnings: WARNING 2008-11-02 06:18:26,459 portalocker.py] no file locking WARNING 2008-11-02 06:18:26,709 sql.py] no sqlite3 or dbapi2 driver WARNING 2008-11-02 06:18:26,709 sql.py] no MySQLdb driv

[web2py:10935] Re: Problems attaching to either remote or localhost PostgreSql

2008-11-01 Thread NoviceSortOf
>do you have db.define_table() in your models? I did not, somehow that got clipped, in my late night coding frenzy. After adding db.define_table(...), reran tests, got a 'relation already exists' error, using pgAdminIII deleted the table, re-ran test - it passed - recreating the table in th

[web2py:10934] Getting a Warning straight out of the box for web2py + GAE

2008-11-01 Thread Jonathan Benn
Hi, Without making any modifications, I tried running web2py v1.47 using the Google App Engine server v1.1.5. I get the following warning: WARNING 2008-11-02 05:51:05,381 dev_appserver.py] Could not initialize images API; you are likely missing the Python "PIL" module. ImportError: No module n

[web2py:10933] Re: How to extend a model

2008-11-01 Thread mdipierro
Normally you can do db.define_table('base_table',SQLField('myfield')) db.define_table('derived_table',db.base_table,SQLField('otherfield')) (both base_table and derived_table are created) or from gluon.sql import SQLTable base_table=SQLTable('base_table',SQLField('myfield')) db.define_table('d

[web2py:10932] Re: Table relationships - Quick question

2008-11-01 Thread mdipierro
In Django: class Poll(models.Model): question = models.CharField(max_length=200) class Choice(models.Model): poll = models.ForeignKey(Poll) choice = models.CharField(max_length=200) votes = models.IntegerField() p = Poll(question="What's up?") p = Poll.objects.get(pk=1) p.choice

[web2py:10931] How to extend a model

2008-11-01 Thread Oscar
Hi, I was looking for how to extend a model, I mean, I working with T2 and I want to add some more fields to t2_persona table, I tryed defining again the table in my new project but It didn't worked. Some oen knows how I can accomplish this? Regards, Oscar. --~--~-~--~~~

[web2py:10930] Table relationships - Quick question

2008-11-01 Thread kev
Hello, I am checking out web2py after doing a little bit of django and i was wondering how you could do the following line in web2py: p = Poll.objects.get(pk=1) p.choice_set.create(choice='Not much', votes=0) What i need to know is how to go from poll to choice like django does. Thanks. Kev --~

[web2py:10929] Re: newbie question about multi-lines field

2008-11-01 Thread mdipierro
Your questions are always welcome. On Nov 1, 4:47 pm, dme69 <[EMAIL PROTECTED]> wrote: > Massimo, > > I understand. You know i'm coming from php world and it is not the > same ... ;-) > > I tried your solutions and it's ok for me. Thanks again for your help. > > Dominique. > > On 1 nov, 16:09, md

[web2py:10928] Re: Problems attaching to either remote or localhost PostgreSql

2008-11-01 Thread mdipierro
It is odd it takes so much time. do you have db.define_table() in your models? Massimo On Nov 1, 3:42 pm, NoviceSortOf <[EMAIL PROTECTED]> wrote: > O.K. Now the test works with no Errors, I'm running from source, > and using my local Windows workstation PostGreSql. > > Test passes without e

[web2py:10927] Re: autoselect admin password box

2008-11-01 Thread mdipierro
then it would not not do anything and you would have to change it. On Nov 1, 3:12 pm, billf <[EMAIL PROTECTED]> wrote: > I don't know jQuery but does this only work if the first form element > is an 'input'?  What about if the first form element is a 'select' or > a 'textarea'? > > On Nov 1, 4:1

[web2py:10926] Re: newbie question about multi-lines field

2008-11-01 Thread dme69
Massimo, I understand. You know i'm coming from php world and it is not the same ... ;-) I tried your solutions and it's ok for me. Thanks again for your help. Dominique. On 1 nov, 16:09, mdipierro <[EMAIL PROTECTED]> wrote: > It is not hard, it is safe. You cannot allow users to type html and

[web2py:10925] Re: Problems attaching to either remote or localhost PostgreSql

2008-11-01 Thread NoviceSortOf
O.K. Now the test works with no Errors, I'm running from source, and using my local Windows workstation PostGreSql. Test passes without errors now, takes about a minute. I can see the PostGreSql table exists in PgAdminIII, and is now populated with 10,000 records, via a pg_dump/restore from our

[web2py:10924] Re: autoselect admin password box

2008-11-01 Thread billf
I don't know jQuery but does this only work if the first form element is an 'input'? What about if the first form element is a 'select' or a 'textarea'? On Nov 1, 4:18 pm, mdipierro <[EMAIL PROTECTED]> wrote: > Exellent point but there is a much easier solution. > > > $(document).ready(function

[web2py:10923] Re: Drop Down with values from a List

2008-11-01 Thread billf
db.mytable.market.requires=IS_IN_SET(['value1','value2','value3']) On Nov 1, 5:47 pm, lev krasner <[EMAIL PROTECTED]> wrote: > Hi Massimo, > Last week I asked you how to make a drop down, and one of the ways I > did it was from database values. However, i want to create a drop down > of Market va

[web2py:10922] Re: Error in 'admin' application

2008-11-01 Thread Yarko T
I've been running from (it turns out) SVN - I'll have to do a compare, because if it's not updated, it's because of the source control / merges... Perhaps it's time for me to do a "fresh" checkout of web2py? On Sat, Nov 1, 2008 at 11:25 AM, mdipierro <[EMAIL PROTECTED]> wrote: > > I think you an

[web2py:10921] Re: Import db model from existing database

2008-11-01 Thread michal niklas
On 31 Paź, 22:57, yarko <[EMAIL PROTECTED]> wrote: > Looking forward to your tool(s)... > > Perhaps we could include them in web2py admin ? OK. As soon as I create them (PostgreSQL first) they will be available. Regards, Michal --~--~-~--~~~---~--~~ You received

[web2py:10920] Drop Down with values from a List

2008-11-01 Thread lev krasner
Hi Massimo, Last week I asked you how to make a drop down, and one of the ways I did it was from database values. However, i want to create a drop down of Market values that will be derived from a List. How can I make a drop down on a form with the datasource being a list rather then a database?

[web2py:10919] captcha

2008-11-01 Thread mdipierro
we have a new and improved captcha app in appliances. Thanks Mateusz --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubs

[web2py:10918] Re: Error in 'admin' application

2008-11-01 Thread mdipierro
I think you and Michal may not have upgraded the apps (admin, examples, welcome) but only the modules. In fact admin/controllers/ default.py, in cleanup() should not contain the line above but for file in files: try: os.unlink(file) except Exception: session.flash=T("cache is

[web2py:10917] Re: autoselect admin password box

2008-11-01 Thread mdipierro
Exellent point but there is a much easier solution. $(document).ready(function() { $ ("input:visible:enabled:first").focus(); }); This will always focus the first visible field of the first form. I now added it in web2py_ajax.html and will be the default with the next web2py version. Never un

[web2py:10916] Re: newbie question about multi-lines field

2008-11-01 Thread mdipierro
It is not hard, it is safe. You cannot allow users to type html and render the html back in a page. This would constitute a Cross Site Scripting vulnerability. Frameworks that make it any easier are not protecting you against that. Massimo On Nov 1, 4:36 am, dme69 <[EMAIL PROTECTED]> wrote: > Th

[web2py:10915] Re: newbie question about multi-lines field

2008-11-01 Thread dme69
Thank you Massimo. I feel suprise this is so "hard" (not really) to have an html result with a textarea form ? I will try your solutions. Thank you again for your help. Dominique. On 31 oct, 18:22, mdipierro <[EMAIL PROTECTED]> wrote: > This is not a stupid question and thanks for asking! > > l