Hi,
I wonder if there a way to enforce a one to one relationship with Cascade
via web2py DAL API. ???
--
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. ???
>>
>
--
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:
>>
>
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.
>
>- 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
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'))
>> >>
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
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
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
db.define_model('animal',
Field('species'),
Field('genus'),
Field('family'))
I suppose db.define_table.
--
Hi all, I wonder if the text input glow effect on click could be disable.
--
Hi all, I wonder what's the best way to disable html controls default
effects. without modifying bootstrap.min.css.
--
Hi all, I wonder what's the best way to disable html controls effects /
default attributes. without modifying bootstrap.min.css.
--
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
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
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
>
--
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
>
--
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
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
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
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
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
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
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
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
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:
>>
>&
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 >
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
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:
>>
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
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
31 matches
Mail list logo