Ian Kelly kirjoitti:
> On May 22, 10:59 am, Christina <bain.christ...@gmail.com> wrote:
>> Hi all,
>>
>> I'm trying to set up a new Django app that will have several models
>> based on existing Oracle tables.  I'm running Django 1.0.2, python
>> 2.5.1 and cxOracle 5.0.1.
>>
>> These tables are in a different schema than the one Django connects
>> with, so based on previous discussion here I created views of the
>> tables in my schema.  I've set db_table to the name of the view in
>> models.py.  When I run syncdb I receive the error:
>> "cx_Oracle.DatabaseError: ORA-00955: name is already used by an
>> existing object."  So it appears to be creating a new table instead of
>> recognizing the existing view.  Any ideas on what I can do to get it
>> to recognize that the view exists and use that for the backend for my
>> model?
> 
> Hi Christina,
> 
> Syncdb doesn't currently recognize views or synonyms correctly.  If
> you have apps with models that need to be created, run manage.py
> sqlall on those apps, and pass the resulting sql into sqlplus or
> manage.py dbshell.  You can also edit the generated sql by hand before
> running it, if you need finer-grain control.

In development version there is also very handy "managed" meta option 
that works very well with legacy apps when set to 'false'.

-- 
Jani Tiainen

--~--~---------~--~----~------------~-------~--~----~
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.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to