Exception Value:
'WSSWSite' object has no attribute 'get'
Exception Location: /Users/ssteiner/.virtualenvs/wssw1/lib/python2.6/
site-packages/django_tables/tables.py in _build_snapshot, line 261
It's pretty much straight out of the docs, WSSWSite is just a simple
model with a couple of simple out-of-the-box attributes.
class WSSWSite(models.Model):
name = models.CharField()
URL = models.URLField()
class WSSWSiteTable(tables.Table):
name = tables.Column(verbose_name="Site Name")
URL = tables.Column(verbose_name="Site URL")
My view is very simple, too:
def show_sites(request):
sites = WSSWSite.objects.all()
sites_table = WSSWSiteTable(sites)
return render_to_response("show_sites.html", {"sites":sites,
"sites_table":sites_table})
The guts of the template (the rest is simple setup stuff that works
fine w/o this middle).
{% for s in sites %}
{{
s.name}} -- {{s.URL}}<br />
{% endfor %}
<table>
{% for column in sites_table.columns %}
{{column}}
{% endfor %}
{% for row in sites_table %}
<tr>
{% for value in row %}
<td>{{ value }}</td>
{% endfor %}
</tr>
{% endfor %}
</table>
The error is:
Request Method: GET
Request URL:
http://127.0.0.1:8000/show_sites/
Exception Type: AttributeError
Exception Value:
'WSSWSite' object has no attribute 'get'
I searched through the code but get() is not explicitly called
anywhere in django-tables anywhere and I'm pretty sure what I'm trying
to do follows the docs.
Any assistance would be greatly appreciated.
Thanks,
S