[web2py] web2py DAL one-to-one relation

2012-09-10 Thread martzi
Hi, I wonder if there a way to enforce a one to one relationship with Cascade via web2py DAL API. ??? --

[web2py] Re: web2py DAL one-to-one relation

2012-09-11 Thread martzi
Field('','reference other_table',ondelete='CASCADE') > > this is actually the default. Is this what you are asking? > > On Monday, 10 September 2012 05:45:28 UTC-5, martzi wrote: >> >> Hi, >> I wonder if there a way to enforce a one to one relationship with Cascade >> via web2py DAL API. ??? >> > --

[web2py] Re: web2py DAL one-to-one relation

2012-09-11 Thread martzi
2012 1:37:59 PM UTC+2, villas wrote: > > I may be wrong, but I do not think Cascade could assist you with > enforcing a 1-1 relationship. > Maybe making the foreign key field unique would help? > > > On Monday, September 10, 2012 11:45:28 AM UTC+1, martzi wrote: >> >

[web2py] Re: web2py DAL one-to-one relation

2012-09-11 Thread martzi
already had duplicated field contents. > > In any case, even if unique=True is not working for the moment, then a > work-around would be to make a unique index on the field yourself. You'll > have to handle exceptions when the insert/update fails due to duplicate > keys.

[web2py] Re: web2py DAL one-to-one relation

2012-09-11 Thread martzi
> >- If using commandline, try with db.commit() after. >- Try with a new table. >- Look in databases/sql.log and see whether the field was created with >UNIQUE. >- Use a DB management tool to inspect your DB. > > > > On Tuesday, September 11, 20

[web2py] Re: web2py DAL one-to-one relation

2012-09-11 Thread martzi
tember 11, 2012 9:23:16 AM UTC-4, martzi wrote: >> >> Unique = True, has probably no effect. see below. >> ... >> >>> db = DAL('sqlite://storage.db') >> >>> person = db.define_table('person', Field('name')) >> >>

[web2py] Re: web2py DAL one-to-one relation

2012-09-11 Thread martzi
Thanks for the reply. But db.executesql('create unique index idx_owner on bodypart(owner)') returned the below error, and still didn't solve the problem. Traceback (most recent call last): File "", line 1, in File "/home/martin/Documents/web2py2/gluon/dal.py", line 7234, in executesql a

[web2py] Re: web2py DAL one-to-one relation

2012-09-12 Thread martzi
Thanks to all members that shared their ideas with me: I was able to the solve my problem after setting foreign_keys attribute to on : sqlite> PRAGMA foreign_keys; 0 sqlite> PRAGMA foreign_keys = ON; sqlite> PRAGMA foreign_keys; 1 On Monday, September 10, 2012 12:45:28 PM UTC+2, mar

[web2py] logic bug in web2py manual (p. 340) ?

2012-09-14 Thread martzi
Hi all : The below code snippet in web2py manual (p. 340), isn't resulting to the expected output. def list_records(): table = request.args(0) #returns db query = request.vars.query #db.dog.owner == 1 records = db(query).select(db[table].ALL) # db("...") requires "owner==1" as parameter

[web2py] Typo error web2py manual (p. 434) ?

2012-09-14 Thread martzi
db.define_model('animal', Field('species'), Field('genus'), Field('family')) I suppose db.define_table. --

[web2py] Disabling text input onclick glow effect.

2012-09-16 Thread martzi
Hi all, I wonder if the text input glow effect on click could be disable. --

[web2py] Display control effects.

2012-09-16 Thread martzi
Hi all, I wonder what's the best way to disable html controls default effects. without modifying bootstrap.min.css. --

[web2py] Disabling Html control effects and default attributes.

2012-09-16 Thread martzi
Hi all, I wonder what's the best way to disable html controls effects / default attributes. without modifying bootstrap.min.css. --

[web2py] Data not inserting via ajax after login. web2py 2.3.2

2013-01-28 Thread martzi
Hi all, I wonder is am doing something wrong. creating a user (normal user), i tried inserting into a database from a custom form, But the values aren't inserting, and not errors is generated. But when i leave the field empty, i get an error message. please could anyone help! controller: def aja

[web2py] Re: pagination with web2py

2012-10-08 Thread martzi
I suggest you download a copy of the web2py manual (http://web2py.com/book). Read and run the snippet on pagination. with a some tweaks you could as well achieve an infinite scroll pagination. On Thursday, October 4, 2012 4:16:00 PM UTC+2, Paulo Donizeti Gardinalli Filho wrote: > > hi, I am sta

[web2py] Re: extend with an if condition

2012-10-14 Thread martzi
On Sunday, October 14, 2012 2:52:03 PM UTC+2, qwer qwer wrote: > > is it not possible? > {{if condition:}} > {{extends 'layout1.html'}} > {{else:}} > {{extends 'layout2.html'}} thanks > --

[web2py] Re: extend with an if condition

2012-10-14 Thread martzi
Yes it is. nothing prevents you from testing it out. On Sunday, October 14, 2012 2:52:03 PM UTC+2, qwer qwer wrote: > > is it not possible? > {{if condition:}} > {{extends 'layout1.html'}} > {{else:}} > {{extends 'layout2.html'}} thanks > --

[web2py] Re: Quickest way to learn web2py

2012-10-14 Thread martzi
First, you have to program a fair bit in python. There are many online tutorials easy to grasp. Choose anyone that suits your reading. Personally the online book, http://web2py.com/book is the best resource so far, read the chapters on the Core. (I like response / request ) After all what you w

[web2py] Re: web2py 2.1.1 is OUT!

2012-10-15 Thread martzi
Many thanks Massimo web2py is here to stay ! On Monday, October 15, 2012 1:55:39 PM UTC+2, Massimo Di Pierro wrote: > > Changelog: > > - overall faster web2py > - when apps are deleted, a w2p copy left in deposit folder > - change in cron (it is now disabled by default). removed -N option and > i

[web2py] Web2py 2.1.1 csv import bug or ?

2012-10-17 Thread martzi
Hello all, I have being trying to import a csv data to a DAL database and this is what i get: Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Traceback (most recent call last): File "/home/xxx/Documents/web2py211/gluon/restricted.py", line 209, in restricted exec ccode in environment Fi

[web2py] Auto-completion and the ajax function bug web2py manual (p. 472 )

2012-10-22 Thread martzi
Hi all, following the example on auto-completion in web2py manual, there seems to be a "bug" using the ajax function with parameterized url. accessing the page normally in my case with (http://127.0.0.1:8000/AjaxApp/default/month_input) works fine. but accessing the page with args say 1, like

[web2py] Re: Auto-completion and the ajax function bug web2py manual (p. 472 )

2012-10-22 Thread martzi
y page where it's used with parameterized url.* * On Monday, October 22, 2012 4:51:47 PM UTC+2, martzi wrote: > > Hi all, > following the example on auto-completion in web2py manual, there seems to > be a "bug" using the ajax function with parameterized url. > accessi

[web2py] Re: Pulling data every 30s for a ticker with web2py

2014-03-21 Thread martzi
Thank all for your replies... PN i like you solution, I am going to try it and let you know if it worked... Thanks to all for yo help! On Thursday, March 20, 2014 11:25:47 PM UTC+2, PN wrote: > > You can also use web2py components (see the chapter titled 'Components and > Plugins' in the web2py

Re: [web2py] Re: Pulling data every 30s for a ticker with web2py

2014-03-21 Thread martzi
ution > use websockets (tornado) and this way you can publish data every 30 s to > the webpage from the server to the client connectect. > > > > > > 2014-03-21 10:08 GMT+00:00 martzi >: > >> Thank all for your replies... >> PN i like you solution, I am going to try

Re: [web2py] Re: Pulling data every 30s for a ticker with web2py

2014-03-21 Thread martzi
Thanks a lot i am going though and will let you know! On Friday, March 21, 2014 12:47:18 PM UTC+2, Ramos wrote: > > see this video from Bruno Rocha > https://www.youtube.com/watch?v=MUWy-NSrvNQ > > Saved my life once... > > > 2014-03-21 10:35 GMT+00:00 martzi >: > &g

Re: [web2py] Re: Pulling data every 30s for a ticker with web2py

2014-03-21 Thread martzi
Ramos, is there an English version of the videos ? I don't understand Portuguese ... On Friday, March 21, 2014 12:56:14 PM UTC+2, martzi wrote: > > Thanks a lot i am going though and will let you know! > > On Friday, March 21, 2014 12:47:18 PM UTC+2, Ramos wrote: >> >&

Re: [web2py] Re: Pulling data every 30s for a ticker with web2py

2014-03-21 Thread martzi
tornado as a separate process > inside web2py\gluon\contrib > > then, in your webpage add a websocket connection and a callback to process > the incomming data from server. > > You can see this very clearly in the video > > > > > 2014-03-21 11:32 GMT+00:00 martzi >

Re: [web2py] Re: Pulling data every 30s for a ticker with web2py

2014-03-21 Thread martzi
OK thanks for the advice :) On Friday, March 21, 2014 2:27:21 PM UTC+2, Ramos wrote: > > in the end you will understand the idea. Be patient... > > > 2014-03-21 12:20 GMT+00:00 martzi >: > >> Well then I will have to watch it to the end i was a bit worried fo

Re: [web2py] Re: Pulling data every 30s for a ticker with web2py

2014-03-21 Thread martzi
I went through thev video... seems easy, unfortunately i cannot see the command for starting tornado... poor video quality ! On Friday, March 21, 2014 2:33:32 PM UTC+2, martzi wrote: > > OK thanks for the advice :) > > On Friday, March 21, 2014 2:27:21 PM UTC+2, Ramos wrote: >>

Re: [web2py] Re: Pulling data every 30s for a ticker with web2py

2014-03-21 Thread martzi
Ok thanks!!! On Friday, March 21, 2014 4:59:08 PM UTC+2, Ramos wrote: > > Inside web2py/gluon/contrib do > Python websocket_messaging.py -k mykey -p > Em 21/03/2014 14:27, "martzi" > escreveu: > >> I went through thev video... seems easy, unfortunatel

Re: [web2py][Javascript] Massimo here searching for some javascript devs ready to port web2py in JS

2014-04-02 Thread martzi
Nice one! Have a web2py-like (w2y) on that! On Tuesday, April 1, 2014 7:44:01 PM UTC+2, Richard wrote: > > Hello, > > I want to get rid of python entirely. As you probably know, I don't see > great future in Python 3000 and since we can't fighting the Javascript > dominance in webapp development