Have been stuck on this one for a couple of days so hoping for some
enlightenment from some more able django users.  Am aware of the
'gotcha' where the model name matches and attribute or one of the Meta
values.

I am getting this when a form is instantiated with an existing object
- no problem if the form is blank.
Have tried renaming the model and renaming most of the fields in case
the model name was used elsewhere or the fields were reserved words.
Not sure what else to try and suspect the real problem is that I don't
understand what the error message is trying to tell me!

Here is the model:

class TweetLog(models.Model):

    tweet = models.TextField()

    content_type = models.ForeignKey(ContentType, blank=True,
null=True)
    object_id = models.PositiveIntegerField(blank=True, null=True)
    content_object = generic.GenericForeignKey('content_type',
'object_id')

    project = models.ForeignKey(Project, blank=True, null=True)
    attached_notes = models.TextField(blank=True, null=True)
    attached_url = models.URLField(blank=True, null=True)
    attached_file = models.FileField(upload_to="uploads/files/",
blank=True, null=True)
    attached_image = models.FileField(upload_to="uploads/images/",
blank=True, null=True)

    owner = models.ForeignKey(Who, related_name='tweeter')
    created = models.DateTimeField(default=datetime.now)

And the traceback - it gets to the template before complaining:

Original Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/template/debug.py", line 71, in
render_node
    result = node.render(context)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/template/debug.py", line 87, in render
    output = force_unicode(self.filter_expression.resolve(context))
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/utils/encoding.py", line 71, in
force_unicode
    s = unicode(s)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/forms/forms.py", line 356, in
__unicode__
    return self.as_widget()
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/forms/forms.py", line 386, in as_widget
    data = self.data
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/forms/forms.py", line 413, in _data
    return self.field.widget.value_from_datadict(self.form.data,
self.form.files, self.html_name)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/forms/widgets.py", line 170, in
value_from_datadict
    return data.get(name, None)
AttributeError: 'TweetLog' object has no attribute 'get'


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to