/dal.py, line 701, in insert
raise e
IntegrityError: (1452, u'Cannot add or update a child row: a foreign key
constraint fails (`master`.`logistics`, CONSTRAINT `logistics_ibfk_1`
FOREIGN KEY (`vendor`) REFERENCES `name_config` (`company`))')
Thanks
sushanth
thanks thats got fix,if i nesrt any value ,i am getting below error
RACEBACK
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
Traceback (most recent call last):
File /home/sushanth/Desktop/web2py/gluon/restricted.py, line 188, in
restricted
exec ccode in environment
File
/home
Hi Kenneth,
Current web2py using : 1.90.2
Yes,i have tried.
Sorry typo mistake dogs.names is defined.
Sorry typo mistake dogs.teamname is defined.
Found mysql two issues in new dal.py
First issues
mysql VARCHAR length should be 0 to 255,but web2py default varchar value was
set to length = 512,if some forgot to declare varchar length he will get
error message key too long.
Second issue
After creating FK in the model
if we declare
),primarykey=['num','team'],
migrate=False,
)
db.users.name.requires = IS_NOT_EMPTY()
db.users.team.requires = IS_IN_DB(db, 'dogs.teamname', ' dogs_teamname')
error :
Traceback (most recent call last):
File /home/sushanth/Desktop/web2py/gluon/restricted.py, line 188, in
restricted
I have added below lines to gluon/sql.py,but stil getting same error
'reference FK': 'INDEX %(field_name)s__idx (%(field_name)s), FOREIGN KEY
(%(field_name)s) REFERENCES %(foreign_key)s ON DELETE %(on_delete_action)s',
'reference TFK': ' INDEX %(field_name)s__idx (%(field_name)s),
I am using new dal.py file from trunk,but it throws below error
Traceback (most recent call last):
File /home/sushanth/web2py/gluon/restricted.py, line 188, in restricted
exec ccode in environment
File /home/sushanth/web2py/applications/new/models/db.py
http://127.0.0.1:8000/admin
if possible,can you please small mysql example for creating FK for string
field with dal.py.
this example will help me lot in fix key issue.
Thanks in advance
web2py team rocks :)
.
Regards,
sushanth reddy
On ubuntu you can change your defualt browser with below steps
susha...@ubuntu:~$ sudo update-alternatives --config x-www-browser
[sudo] password for sushanth:
There are 2 choices for the alternative x-www-browser (providing
/usr/bin/x-www-browser).
SelectionPath
Hi,
Can any one help on this issue.
https://groups.google.com/forum/#!topic/pymysql-users/vrnKcoE6ZD0
Thanks
sushanth
Thank you for the info, i am doing the same.but only problem i found i
am not able to run
return dict(records=db().select(db.tablename.ALL))
it throws below error
Traceback (most recent call last):
File /home/sushanth/Desktop/web2py/gluon/restricted.py, line 188,
in restricted
exec ccode
Hi,
I already have few tables with data in mysql.i want to fetch that with
out defining in model.py.
can you please help me.
Thanks in advance
Regards,
sushanth
16 matches
Mail list logo