I have recently been working on a model and found this problem:

class Image(Model):
    name = CharField(maxlength=255)
    owner = ForeignKey('user')
    file = ImageField(upload_to='Image/%Y-%m/', blank=True, null=True)
    description = TextField()
    datetime = DateTimeField(auto_now_add=True)

    class Admin:
        search_fields = ('description','name')
        list_filter = ('datetime',)

    def __str__(self): return self.name

Add the app to my installed apps list and then any attempt to run
manage.py results in:

Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File "/usr/lib/python2.5/site-packages/django/core/management.py",
line 1725, in execute_manager
    execute_from_command_line(action_mapping, argv)
  File "/usr/lib/python2.5/site-packages/django/core/management.py",
line 1616, in execute_from_command_line
    action_mapping[action](int(options.verbosity),
options.interactive)
  File "/usr/lib/python2.5/site-packages/django/core/management.py",
line 510, in syncdb
    _check_for_validation_errors()
  File "/usr/lib/python2.5/site-packages/django/core/management.py",
line 1195, in _check_for_validation_errors
    num_errors = get_validation_errors(s, app)
  File "/usr/lib/python2.5/site-packages/django/core/management.py",
line 1046, in get_validation_errors
    for r in rel_opts.get_all_related_objects():
  File "/usr/lib/python2.5/site-packages/django/db/models/options.py",
line 146, in get_all_related_objects
    if f.rel and self == f.rel.to._meta:
AttributeError: 'str' object has no attribute '_meta'


Seems to be only a problem with ImageField, FileField still works

Fedora Core 7
Django  (0, 97, 'pre') (SVN)
Python 2.5
MySql 5.0.37



On Aug 5, 8:27 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On 8/4/07, Frank Singleton <[EMAIL PROTECTED]> wrote:
>
>
>
> > AttributeError: 'str' object has no attribute 'strftime'
>
> Hi Frank,
>
> You're the second person in recent history to report this problem -
> however, I've been unable to replicate it. The last user was on
> Windows, and I had mentally put it down as a configuration issue; the
> fact that you're seeing it on Linux suggests that it might be a larger
> problem.
>
> The short version: The database backend (sqlite/pysqlite) should be
> returning datetime objects for records containing date fields, but for
> some reason, it seems to be returning strings for some users.
>
> If you can provide a simple test case that exhibits the problem (e.g.,
> minimal model, set of instructions for generating the error, complete
> set of version details for OS, database, etc), I'll have another look
> and see what I can see.
>
> Yours,
> Russ Magee %-)


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to