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

Using non-standard primary keys #35

Open
panchox9103 opened this issue Nov 14, 2012 · 5 comments
Open

Using non-standard primary keys #35

panchox9103 opened this issue Nov 14, 2012 · 5 comments

Comments

@panchox9103
Copy link

Hi everyone.

I have a table that doesn't use the standar in the definition for the primary key.

When try to use will_filter, it generate a "ORDER BY id desc" but this column doesn't exists.

In the model I defined the correst name for the primary key: self.primary_key = 'name_primary_key'

What I need to do for will_filter use this primary key and not the "id" ?

Thanks.

@seuros
Copy link

seuros commented Nov 15, 2012

Can you post the Log output ?

@panchox9103
Copy link
Author

This is the error message:

"ID": invalid identifier: SELECT * FROM (
SELECT raw_sql_., rownum raw_rnum
FROM (SELECT "VMCLIENTES"._ FROM "VMCLIENTES" ORDER BY id desc) raw_sql_
)
WHERE raw_rnum_ between 1 and 30

My primary key for this table, is called "codigocliente".

Thanks.

@ajeetksingh
Copy link

hey @panchox9103 did u find any solution for the error you have mentioned.. I am kinda stuck at it..!

@panchox9103
Copy link
Author

@Seaborg
Copy link

Seaborg commented May 6, 2013

Try:

def default_order
'yourPrimaryKey'
end

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

4 participants