grafted fields

A place for users and developers of the Xataface to discuss and receive support.

grafted fields

Postby Jean » Thu Sep 15, 2011 5:49 am

Hi Steve,

I have some difficulties to find documentation about the grafted fields.
I added the __sql__ statement at the beginning of my fields.ini. Then I checked up my query to be sure, it is OK.
But the field is not displayed. Did I forget an operation ?

Thank you

Jean
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France

Re: grafted fields

Postby shannah » Thu Sep 15, 2011 11:01 am

Hi Jean,

A couple of things to check for:
1. If you have set blanket default permissions for your fields using the __field__permissions() method you could be disallowing access to the field.
2. If you have set default field visibility in the fields.ini file via the [__global__] section....
3. Check to make sure that your __sql__ directive is at the beginning of the file and that it is __sql__ and not _sql_
4. Try to enter an obviously invalid SQL query for the __sql__ directive to see if you get an error (to confirm that it is picking up the __sql__ directive at all).


-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: grafted fields

Postby Jean » Fri Sep 16, 2011 12:51 am

Thank you Steve.

I checked up all your suggestions. Syntax is right but yes the __sql__ is not taken into account although the statement is at the beginning of the fields.ini.

Code: Select all
__sql__ = "select p.*, d.total from programmation p left join devis d on p.id_proposition_artistique=d.id_proposition_artistique"

:(
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France

Re: grafted fields

Postby Jean » Fri Sep 16, 2011 1:45 am

Well Steve, it works with the function __sql__ in the delegate class. I don't understand why it did not work in the fields.ini.
Jean
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France

Re: grafted fields

Postby shannah » Fri Sep 16, 2011 9:40 am

This is a long shot, but try putting something else (not a section) before __sql__

e.g.

Code: Select all
foo=bar
__sql__="...."
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 18 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved