On Mon, Mar 9, 2009 at 3:06 PM, Brandon Taylor <btaylordes...@gmail.com>wrote:

>
> Hi Alex, thanks for the response.
>
> I see that Django is trying to select a property that doesn't exist
> from this view...
>
> SELECT "LU_CSU_CODE"."ID", "LU_CSU_CODE"."DEPARTMENT",
> "LU_CSU_CODE"."TITLE" FROM "LU_CSU_CODE" ORDER BY
> "LU_CSU_CODE"."DEPARTMENT" ASC
>
> There is no field LU_CSU_CODE.ID
>
> Here is my model:
>
> from django.db import models
>
> class CSUCode(models.Model):
>    department = models.CharField(max_length=10,
> db_column='DEPARTMENT')
>    title = models.CharField(max_length=255, db_column='TITLE')
>
>    class Meta:
>        verbose_name = 'CSU Code'
>        verbose_name_plural = 'CSU Codes'
>        ordering = ['department']
>        managed = False
>        db_table = 'LU_CSU_CODE'
>
>    def __unicode__(self):
>        return self.title
>
> Thoughts?
>
> Brandon
>
> On Mar 9, 2:40 pm, Alex Gaynor <alex.gay...@gmail.com> wrote:
> > On Mon, Mar 9, 2009 at 2:38 PM, Brandon Taylor <btaylordes...@gmail.com
> >wrote:
> >
> >
> >
> > > Hi everyone,
> >
> > > Is there something special I need to know in order to select records
> > > from a view in Oracle? My user has select permissions on the schema in
> > > question.
> >
> > > When I output the SQL from the connection, everything looks in order.
> > > I'm using Django trunk, Python 2.6.1 and cx_Oracle-5.0.1
> >
> > > TIA,
> > > Brandon
> >
> > Nope, it should just work.  What happens when you try to do the query, do
> > you get an exception?
> >
> > ALex
> >
> > --
> > "I disapprove of what you say, but I will defend to the death your right
> to
> > say it." --Voltaire
> > "The people's good is the highest law."--Cicero
> >
>
If no other primary key is specified Django creates(and assumes there is a)
auto increment primary key by the name id.
http://docs.djangoproject.com/en/dev/ref/models/fields/#primary-key

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~---------~--~----~------------~-------~--~----~
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