sijeesh / google-app-engine-django

Automatically exported from code.google.com/p/google-app-engine-django
Apache License 2.0
0 stars 0 forks source link

AttributeError: type object 'RegistrationTestModel' has no attribute '_deferred' #171

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. upgrade django to 1.2.1
2. python manage.py shell

What is the expected output? What do you see instead?
should go into the shell, instead throws and exception:
AttributeError: type object 'RegistrationTestModel' has no attribute '_deferred'

What version of the product are you using? On what operating system?
Revision: 102, on Mac OS 10.6.3

Please provide any additional information below.
Fixed it by defining a member "_deferred = False" in BaseModel in 
appengine_django/models.py
also had to define "auto_created=False" in ModelOptions in the same file

Original issue reported on code.google.com by johnwloc...@gmail.com on 9 Jun 2010 at 8:20

GoogleCodeExporter commented 8 years ago
This is also a problem with Django 1.1.2, as django.db.models.loading.py has 
been updated for the include_deferred models.

Original comment by dherbst on 13 Jun 2010 at 11:45

GoogleCodeExporter commented 8 years ago
I've already signed the CLA.  Included is the patch for Django 1.1.2 and 1.2.1

Index: appengine_django/models.py
===================================================================
--- appengine_django/models.py  (revision 104)
+++ appengine_django/models.py  (working copy)
@@ -168,6 +168,9 @@
   """
   __metaclass__ = PropertiedClassWithDjango

+  _deferred = False
+  # Added for Django 1.1.2 and 1.2.1
+
   def __eq__(self, other):
     if not isinstance(other, self.__class__):
       return False

Original comment by dherbst on 13 Jun 2010 at 12:30

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r105.

Original comment by m...@google.com on 14 Jun 2010 at 9:29

GoogleCodeExporter commented 8 years ago
Still getting the AttributeError: 'ModelOptions' object has no attribute 
'auto_created' error. Had to add "auto_created=False" in ModelOptions as stated 
in the original description of the bug. Note: this is also tracked under Issue 
#173.

Original comment by Dominic....@gmail.com on 17 Jun 2010 at 2:11

GoogleCodeExporter commented 8 years ago
You are right, I only tested with 1.1.2.  Django 1.2.1 has a bunch of other 
changes to support multidb, like the 'using' function.  Can we say this issue 
is for Django 1.1.2 and Issue #173 is for Django 1.2.1, please?  That way we 
can leave this issue fixed.

Original comment by dherbst on 17 Jun 2010 at 11:05