I don't understand what could be the problem of this kind of error. I have 4 apps in my Django project. Each app contains multiple models. I am able to retrieve data from all models expect 1 in the python interactive shell.
Also, in my Form, it gets displayed but when i run the same query from the interactive shell it does not display anything. I fail to understand what could be the problem, it does not gives any errors as well...
Any help on this would be great!
Updated:
The model contains the following fields:
class Report(models.Model):
rid = models.CharField(blank=True, null=True)
period = models.CharFiedl(blank=True, null=True)
name = models.CharField(blank=True, null=True)
....
....
I was running the following queries: Report.objects.all() - which returns null Report.objects.count() - which also return 0
I added a few entries with the help of the admin interface...and checked the same via phpMyadmin...and the interactive shell does not display anything...
But I have a form which is working when i display just the name...
forms.py
class ReportForm(forms.ModelForm):
class Meta:
model = Report
views.py
def display(request):
return render_to_response('view.html', {'Report' : Report.objects.all()})
view.html
{% if Report.count > 0 %}
{% for entries in Report %}
<a href = "/Report/{{entries.name}}">{{entries.name}}</a>
{% endfor %}
{% else %}
<p> No Entries </p>
{% endif %}