from django.shortcuts import render,render_to_response
from django.http import HttpResponseRedirect
from django.template import RequestContext
from .models import *
from django.http import HttpResponse,HttpRequest
# Create your views here.
def home(request):
story = Story.object.all()
return render_to_response('show.html',{'story':story})
from django.db import models
from django.forms import ModelForm;
# Create your models here.
class Story(models.Model):
stories = models.CharField(max_length=1024)
class storyform(ModelForm):
class Meta:
model = Story
fields = ['stories']
why i m getting thiserror :-type object 'Story' has no attribute 'object'this is my views.py file:from django.shortcuts import render,render_to_response
from django.http import HttpResponseRedirect
from django.template import RequestContext
from .models import *
from django.http import HttpResponse,HttpRequest
# Create your views here.
def home(request):
story = Story.object.all()
return render_to_response('show.html',{'story':story})
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/711b4bc2-c974-46f7-a88b-d90ad561d92f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.