Comments (7)
This sounds like django_cms
is doing some interesting black magic here. The two variables (self
and options
) are global variables when creating the models used to store metadata. Each model class creates a closure over these variables, so I have no idea why they would be appearing again.
I'll have a look at what django_cms
is doing, I assume it takes over class creation, but I'll have another look. The developers were probably working on the assumption that django models haven't been created this way.
Are you able to send some more information (ie, your seo.py file)?
from django-seo.
Thanks for fast response.
I'll also make some investigation on django_cms magic in the morning and let you know if I'll find anything interesting.
My seo.py file is quite simple, here it goes:
from rollyourown import seo
class SEOMetadata(seo.Metadata):
title = seo.Tag(head=True, max_length=68)
description = seo.MetaTag(max_length=155)
keywords = seo.KeywordTag()
class Meta:
use_cache = True
backends = ('path', 'modelinstance', 'model', 'view')
verbose_name = "Dane SEO"
verbose_name_plural = "SEO"
It is also interesting why this happens only when I use debugger...
from django-seo.
That is a very simple file (note that backends
is not required, the value you have used is the default), I have no idea what's going on. Perhaps someone is monkey patching or maybe there is something amis with the debugger.
Are you able to see the value of attrs
when it reaches c:\python25\lib\site-packages\django_cms-2.1.0.rc1-py2.5.egg\publisher\base.py
at line 50?
from django-seo.
I made further investigation and I disabled django-cms and suprisingly problem remains. Looks like django-cms is innocent in this case.
End of traceback without cms looks like this:
File "build\bdist.win32\egg\rollyourown\seo\backends.py", line 161, in get_model
File "C:\Python25\lib\site-packages\django\db\models\base.py", line 53, in __new__
new_class.add_to_class('_meta', Options(meta, **kwargs))
File "C:\Python25\lib\site-packages\django\db\models\base.py", line 213, in add_to_class
value.contribute_to_class(cls, name)
File "C:\Python25\lib\site-packages\django\db\models\options.py", line 93, in contribute_to_class
raise TypeError("'class Meta' got invalid attribute(s): %s" % ','.join(meta_attrs.keys()))
from django-seo.
Ok, I went and installed pydev --- not particularly enjoyable for a non IDE person such as me :-( and run it in debug. I noticed that it tried to launch psyco, which might be the actual cause of your problems.
Are you able to disable psyco? Is the exception gone?
from django-seo.
Thanks for checking it out.
I've managed to disable psyco but the problem remains.
from django-seo.
As I'm still not able to reproduce this, I'll close this ticket. Let me know if it's a problem for you, there might be ways around it, but I'd rather use a class as a closure than artificially create it using type().
from django-seo.
Related Issues (20)
- It's hard to migrate an existing Metadata model
- get_inline() should return multiple inlines when Meta.use_sites or Meta.use_i18n are True HOT 1
- Flatpages per page SEO data editing HOT 4
- When using i18n_patterns, every path is prefixed with the current language so it can have several versions HOT 1
- Unable to use namespacing in view names
- TemplateSyntaxError: {% get_metadata %} needs some path information SHOW When set Debug=False,but set to True, no error out. HOT 4
- seo_models is not able to detect GIS model properties
- Multiple MetaModel and Inheritance
- cannot import rollyourown HOT 1
- external data (e.g. {{ product }}) won't be rendered and just stays as {{ product }}. So, dynamic values such as {{ product }} cannot be used in, for example, title field.
- Django 1.7 : ImportError cannot import name get_verbose_name HOT 1
- Is there any flask SEO?
- Does not work in django v1.8.0 HOT 11
- IntegrityError at /admin/seo/mymetadatamodelinstance/add/ HOT 2
- django-seo2 has been released HOT 1
- ImportError: cannot import name SortedDict (With Django 1.9) HOT 2
- value too long for type character varying(68)
- File "/usr/local/python3.4/lib/python3.3/site-packages/Django-1.8.11-py3.3.egg/django/db/backends/mysql/base.py", line 27, in <module> raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named 'MySQLdb'
- AttributeError: type object 'MyMetadata' has no attribute '_meta'
- ImportError: cannot import name 'SortedDict' HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-seo.