Hello all,
I'm getting an attribute error when I try running the dumpdata command
on any of my apps.
news = app name
NewsEntry = model
Output:
=========
C:\someproject>manage.py dumpdata news
Traceback (most recent call last):
File "C:\someproject\manage.py", line 11, in <module>
execute_manager(settings)
File "C:\Python25\lib\site-packages\django\core\management
\__init__.py", line 277, in execute_manager
utility.execute()
File "C:\Python25\lib\site-packages\django\core\management
\__init__.py", line 225, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python25\lib\site-packages\django\core\management\base.py",
line 70, in run_from_argv
self.execute(*args, **options.__dict__)
File "C:\Python25\lib\site-packages\django\core\management\base.py",
line 84, in execute
output = self.handle(*args, **options)
File "C:\Python25\lib\site-packages\django\core\management\commands
\dumpdata.py", line 37, in handle
objects.extend(model.objects.all())
AttributeError: type object 'NewsEntry' has no attribute 'objects'
==============
I suspect this is related somehow my models setup. However, after
searching, I couldn't find any one with a similar issue.
Model class:
========
from django.db import models
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.contrib.sites.managers import CurrentSiteManager
class NewsEntry(models.Model):
site = models.ForeignKey(Site)
on_site = CurrentSiteManager()
...
===========
So I use, for example: NewsEntry.on_site.all() INSTEAD OF
NewsEntry.objects.all()
This is all based off of the Django "Sites Framework" documentation
(
http://snipr.com/1uvnz).
Any insight would be appreciated.
Thanks much in advance,
ttk