On 22/04/2008, at 3:37 PM, Robert Gravina wrote:

> Hi All,
>
> Others have experiemented with using the zope component architecture  
> in Django, with great results:
> http://www.stereoplex.com/two-voices/adapters-in-django-and-the-revenge-of-zope
>
> I'd really like to make use of it too, but I'm finding whenever I  
> say one of my Django models implements an interface, various Django  
> internal functions appear to be introspecting the model object and  
> having problems with the interface declaration.
>
> If you're not familiar with what an implements declaration looks  
> like, it looks like this. e.g. for an Article model
>
> from zope.interface import implements
> from django.db import models
>
> class Article(models.Model):
>       implements(IArticle)
>       title = models.CharField(max_length=100, help_text="The title of  
> the article.")
>       ....
>
> And when I try to bring up a page using this model:
>
> Exception Type:       ImproperlyConfigured
> Exception Value:      Error while importing URLconf '<myproject>.urls':  
> '__implements_advice_data__'
> Exception Location:   /Library/Frameworks/Python.framework/Versions/ 
> 2.5/lib/python2.5/site-packages/django/core/urlresolvers.py in  
> _get_urlconf_module, line 255

Turns out this problem was caused by importing my model with an  
interface declaration in urls.py.. not sure why exactly, but it  
appears to work now ;)

Robert


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