I saw the former question in stackoverflow "can i use a database view
as a model in django"[http://stackoverflow.com/questions/507795/can-i-
use-a-database-view-as-a-model-in-django] and try it in my app,but
that's not work.I create a view named "vi_topics" manually and it had
"id" column。But I always got the error about "no such column:
vi_topics.id",even I add "id" field explicitly.

here is my view models :

from django.db import models

class Vitopic(models.Model):
    title = models.CharField(max_length=200)
    content = models.TextField()
    author_name = models.CharField(max_length=200)
    author_email = models.CharField(max_length=200)
    view_count = models.IntegerField(default=0)
    replay_count = models.IntegerField(default=0)
    tags = models.CharField(max_length=255)
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)

    class Meta:
        db_table = 'vi_topics'

btw: I use sqlite3.

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