Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » Django and Oracle XE - Empty models file [RSS Feed]

#1 Jan. 27, 2011 10:53:52

Nathanael D.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Django and Oracle XE - Empty models file


I've only recently started playing with Django to undertake a technology
assessment of the various frameworks available. As part of the assessment it
needs to integrate with a legacy Oracle XE database (I know) which will
contain customer data, with the default database being MySQL and containing
all the project site data.

When running inspectdb on the Oracle XE database it produces an empty models
file except for the import header. When running this against the MySQL
database the models table is created correctly.

Does anyone have any suggestions on resolving this problem?

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Jan. 27, 2011 17:42:09

I.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Django and Oracle XE - Empty models file


On Jan 27, 3:53 am, Nathanael Dyke <nat...@jarvellis.com> wrote:
> I've only recently started playing with Django to undertake a technology
> assessment of the various frameworks available. As part of the assessment it
> needs to integrate with a legacy Oracle XE database (I know) which will
> contain customer data, with the default database being MySQL and containing
> all the project site data.
>
> When running inspectdb on the Oracle XE database it produces an empty models
> file except for the import header. When running this against the MySQL
> database the models table is created correctly.
>
> Does anyone have any suggestions on resolving this problem?

Hi Nathanael,

inspectdb on Oracle will only find tables in the Django user's
schema. It doesn't inspect views or synonyms or tables in other
schemas. I would guess that one of these describes your situation.

Ian

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#3 Jan. 28, 2011 09:45:58

N.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Django and Oracle XE - Empty models file


Cheers for the reply. The database in question is a remote database. I
presume by Django user that you're referring to the local user account?
Otherwise the user credentials in settings should be adequate.

I'm guessing the only resolution to this is to hand craft the models?

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#4 Jan. 28, 2011 10:57:39

Jani T.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Django and Oracle XE - Empty models file


On Friday 28 January 2011 11:45:48 Nathan wrote:
> Cheers for the reply. The database in question is a remote database. I
> presume by Django user that you're referring to the local user account?
> Otherwise the user credentials in settings should be adequate.
>
> I'm guessing the only resolution to this is to hand craft the models?

That is correct.

You just have to remember declare managed = False ni API, and from my
experience (working with legacy Oracle DB for a good while), it's better to
pick only what you need.

One special note: Oracle DATE field stores both - date and time with resolution
of a second.

There is no equivalent field in Django. If you use date.DateTimeField you get
all kind of nasty exceptions when working with this kind of a legacy data
because DateTimeField expects to find TIMESTAMP type (date/time with resolution
of a fractions of a second)

We've worked around this by declaring our own custom field.

--

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 athttp://groups.google.com/group/django-users?hl=en.

Offline

  • Root
  • » Django
  • » Django and Oracle XE - Empty models file [RSS Feed]

Board footer

Moderator control

Enjoy the 11th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support