On Thursday, June 7, 2012 3:55:37 AM UTC-6, rahajiyev wrote:
>
> There's an existing Oracle database I want to hook Django up with. The 
> problem is, the table I need lacks single-key primary keys. Oracle 
> does provide its unique table-wide ROWID which can normally be used as 
> a PK with a few restrictions. But it's a LOB, so a cast to string is 
> normally required to fetch it: SELECT ROWID || '' 
> Writing this expression a piece of cake for CakePHP and its 
> virtualFields. Can Django do the same?


MyModel.objects.extra(select={'rowid': "rowid || ''"})

Cheers,
Ian

 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/XXV9rBzhhwwJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to