Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IS_IN_DB; orderby with literal field not works if field has rname #2278

Open
Ayunken opened this issue Nov 28, 2019 · 0 comments
Open

IS_IN_DB; orderby with literal field not works if field has rname #2278

Ayunken opened this issue Nov 28, 2019 · 0 comments

Comments

@Ayunken
Copy link

Ayunken commented Nov 28, 2019

I used requires IS_IN_DB always this way:

db.define_table('tipo',Field('name'))
db.define_table('otra',
Field('um',db.mod_um,label='U.Medida',default=1,requires=IS_IN_DB(db,db.tipo,'%(name)s',orderby='name')))

but if referenced table has name field with rname translation, not works, dal uses directly name as field, ignoring rname translation.

db.define_table('tipo',
Field('name', rname='description'))

db.tipo.name instead of 'name' is needed:

db.define_table('otra',
Field('um',db.mod_um,label='U.Medida',default=1,requires=IS_IN_DB(db,db.tipo,'%(name)s',orderby=db.tipo.name)))

@Ayunken Ayunken changed the title IS_IN_DB; orderby with literal field not works if filed has rname IS_IN_DB; orderby with literal field not works if field has rname Nov 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant