Gerard Petersen wrote:
> Hi All,
> 
> I'm trying to import a function. When adding this statement I get a Model 
> import error in a completely different place, not even related. I've added 
> the files from my app directory and their import statements below. 
> 
> Are there any unauthorized imports being done?
> Do I need to specify more exact since it's a deviating filename?
> Do I need to add the deviating filenames (myforms.py, myfunctions.py) to 
> settings.py or _init__.py?
> 
> I'm completely lost. Thanx a lot!
> 
> Regards,
> 
> Gerard.
> 
> 
> ## __init__.py
> empty!
> 
> ## urls.py
> from django.conf.urls.defaults import *
> from django.contrib import admin
> from django.conf import settings
> 
> ## views.py
> from django.shortcuts import render_to_response, get_object_or_404
> from django.conf.urls.defaults import *
> from django.http import Http404, HttpResponseRedirect, HttpResponse
> from django.core.urlresolvers import reverse
> from models import *
> from myforms import *
> from myfunctions import *
> from datetime import datetime
> 
> ## models.py
> from django.db import models
> from django.contrib import admin
> from statemachine import Machine
> import datetime
> 
> ## myforms.py
> from models import *
> from django.forms import *
> 
> ## statemachine.py
> from django.db import models
> from django.utils.functional import curry
> from myfunctions import current_date  << Adding this one
> 
> ## myfunctions.py
> from django.db import models
> from models import MetaData           << Breaks this one
> from datetime import datetime, timedelta
> from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_DOWN
> 
> With this >> ImportError: cannot import name MetaData
> 
> Full trace: http://paste.pocoo.org/show/85970/
> 
> 
> Thanx again!
> 
> 
It looks like you have made a circular import:

   statemachine imports myfunctions which imports models which imports 
statemachine == doh!

Don't do that.


-- 
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___________________________________________________________________________
Get off the sidelines and huddle up with the Statesman all season long
for complete high school, college and pro coverage in print and online!

--~--~---------~--~----~------------~-------~--~----~
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