straight55b / app-engine-patch

Automatically exported from code.google.com/p/app-engine-patch
0 stars 0 forks source link

AttributeError: type object 'User' has no attribute 'all' #219

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Install app-engine-patch, pyfacebook and facebook sample application
2.Try to syncdb 
3.

What is the expected output? What do you see instead?
Running on app-engine-patch 1.0.2.2
Traceback (most recent call last):
  File "manage.py", line 18, in <module>
    execute_manager(settings)
  File "/home/gus/fbapps/__init__.py", line 362, in execute_manager

  File "/home/gus/fbapps/__init__.py", line 317, in execute

  File
"/home/gus/fbapps/common/zip-packages/django-1.0.2.zip/django/core/management/ba
se.py",
line 197, in run_from_argv
  File
"/home/gus/fbapps/common/zip-packages/django-1.0.2.zip/django/core/management/ba
se.py",
line 224, in execute
  File
"/home/gus/fbapps/common/zip-packages/django-1.0.2.zip/django/core/management/ba
se.py",
line 353, in handle
  File
"/home/gus/fbapps/common/zip-packages/django-1.0.2.zip/django/core/management/co
mmands/syncdb.py",
line 65, in handle_noargs
AttributeError: type object 'User' has no attribute 'all'

What version of the product are you using? On what operating system?
Linux, python2.5, app-engine-patch-1.1RC and app-engine-patch-1.0.2.3

Please provide any additional information below.

Original issue reported on code.google.com by gustavo....@gmail.com on 16 Sep 2009 at 12:17

GoogleCodeExporter commented 9 years ago
I am trying to use the facebook django example. This is the models.py that i 
think
it's causing the problem,

from django.db import models

# get_facebook_client lets us get the current Facebook object
# from outside of a view, which lets us have cleaner code
from facebook.djangofb import get_facebook_client

class UserManager(models.Manager):
    """Custom manager for a Facebook User."""

    def get_current(self):
        """Gets a User object for the logged-in Facebook user."""
        facebook = get_facebook_client()
        user, created = self.get_or_create(id=int(facebook.uid))
        if created:
            # we could do some custom actions for new users here...
            pass
        return user

class User(models.Model):
    """A simple User model for Facebook users."""

    # We use the user's UID as the primary key in our database.
    id = models.IntegerField(primary_key=True)

    # TODO: The data that you want to store for each user would go here.
    # For this sample, we let users let people know their favorite progamming
    # language, in the spirit of Extended Info.
    language = models.CharField(max_length=64, default='Python')

    # Add the custom manager
    objects = UserManager()

Original comment by gustavo....@gmail.com on 16 Sep 2009 at 4:32

GoogleCodeExporter commented 9 years ago
You have probably solved this long ago, but just in case someone else discovers 
it ..

Appengine does not support the Django ORM, you must use the AppEngine entities 
and models - 
http://code.google.com/appengine/docs/python/datastore/entitiesandmodels.html

Original comment by rossdjo...@gmail.com on 12 Nov 2009 at 6:06