Joshua Kramer
unread,Nov 15, 2009, 6:10:18 PM11/15/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Pinax Users
Howdy Everyone!
After having installed a fresh version of Pinax 0.7.1, I have an
interesting problem with the behavior of Django when I try to install
custom applications.
In my main project directory, I've created an 'apps' directory, and
created some standard django skeleton apps. When I tried to run
'syncdb', I noticed the tables were not created for my models.
After some amount of tracing, I found out that Django is not
registering my apps, with my models. With skeleton models the apps
register fine. When I say 'register', I mean this: I detect if an app
is registered or not by doing this in manage.py:
from django.db import models
myApps = models.get_apps()
I then look through the myApps list to see if my apps are present. I
note that all of the Pinax apps are always present.
Here is an example. This model causes the app to not register:
-------
from django.conf import settings
from django.contrib.gis.db import models
from django.contrib.localflavor.us.models import USStateField
class Zipcode(models.Model):
code = models.CharField(max_length=10)
poly = models.PolygonField()
objects = models.GeoManager()
class Address(models.Model):
addrKey = models.CharField(max_length=32)
num = models.IntegerField()
street = models.CharField(max_length=128)
city = models.CharField(max_length=64)
state = USStateField()
zipcode = models.ForeignKey(Zipcode)
objects = models.GeoManager()
-----
This code allows the app to register:
----
from django.db import models
----
Has anyone seen this before?
Thanks,
-Josh