Re: Getting at Oracle ROWID

2012-06-13 Thread rahajiyev
Thanks, here's what I came up with: In the model: class RowidField(models.CharField): def __init__(self, *args, **kwargs): kwargs['name'] = 'rowid' kwargs['max_length'] = 18 kwargs['primary_key'] = True super(RowidField, self

Re: more than 1 level of belongsTo

2012-06-12 Thread rahajiyev
You can keep laughing all you want, but I at least could get CakePHP to work with an existing Oracle database lacking primary keys for a backend app involving role permissions, forms, pagination and other usual web stuff, as opposed to designing a new app and database from scratch. I worked around

more than 1 level of belongsTo

2012-06-08 Thread rahajiyev
Hi, I have a model Foo belongsTo Bar, which in turn belongsTo Xyzzy. When I do $this->Foo->find('all'); sql dump shows that the SQL join is performed only for Foo->Bar, but Xyzzy is never mentioned. I tried all sorts of 'recursive' => 1 it didn't matter. Please help me. CakePHP 1.3.15 -- You re

more than 1 level of belongsTo

2012-06-08 Thread rahajiyev
Hi, I have a model Foo belongsTo Bar, which in turn belongsTo Xyzzy. When I do $this->Foo->find('all'); sql dump shows that the SQL join is performed only for Foo->Bar, but Xyzzy is never mentioned. I tried all sorts of 'recursive' => 1 it didn't matter. Please help me. CakePHP 1.3.15 -- You re

Re: Getting at Oracle ROWID

2012-06-07 Thread rahajiyev
> MyModel.objects.extra(select={'rowid': "rowid || ''"}) > Thanks. I don't think extra() takes primary_key=True, does it? I wouldn't want Django to auto-add column id otherwise. Assuming I have: MyModel.objects.extra(select={'id': "rowid || ''"}) OK, that's fine for fetching the ID itself, suitab

Getting at Oracle ROWID

2012-06-07 Thread rahajiyev
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

Re: Oracle schema not working

2012-06-04 Thread rahajiyev
BTW, simple db_table = 'foo' worked fine. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.co

Re: Oracle schema not working

2012-06-04 Thread rahajiyev
My bad, folks, late in the day I forgot to add the using() clause as I'm using tiny local postgres and huge remote oracle (read mostly) and oracle won't be default. Foo.objects.using('svfe').all().order_by('-udate', '-time')[:5]; can I somehow configure it using the model? Something like in the M

Re: Oracle schema not working

2012-06-04 Thread rahajiyev
Exact error: > DatabaseError at / > > relation "foo" does not exist > LINE 1: ...ty", "foo"."address_country" FROM "foo... > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To

Re: Oracle schema not working

2012-06-04 Thread rahajiyev
Why is Django strangely quoting column and table names? It gives Oracle syntax errors. DatabaseError at / relation "foo" does not exist LINE 1: ...ty", "foo"."address_country" FROM "foo"."... Of course it exists as foo, not as "foo". I already did the CREATE SYNONYM trick to avoid messing with

Oracle schema not working

2012-06-01 Thread rahajiyev
Hello. The user connecting to Oracle is an ordinary user and needs to prefix all tables with the schema name. I've tried crafting Meta.db_table like so: http://cd-docdb.fnal.gov/cgi-bin/RetrieveFile?docid=3156&version=1&filename=DjangoOracle.html But I get error DatabaseError at / schema "foo" d