I hereby claim:
- I am yakky on github.
- I am yakky (https://keybase.io/yakky) on keybase.
- I have a public key ASDMqW3a9lVYExJgJr_JbcDe04hCRO2T-vQPKKn2lMCaDAo
To claim this, I am signing this object:
from django.db import migrations | |
def migrate_to_new_plugin(apps, schema_editor): | |
OldPluginModel = apps.get_model("myapp", "PluginModel") | |
NewPluginModel = apps.get_model("myapp", "PluginModel") | |
for obj in OldPluginModel.objects.all(): | |
# | |
new_obj = NewPluginModel() | |
new_obj.id = obj.id |
I hereby claim:
To claim this, I am signing this object:
Add the discovery of proper ThumbnailOption
model in you app models.py
Create a manual migration like in example_migration.py
In every migration (even existing ones) add:
from custom_plugins.models import thumbnail_model
In every migration (even existing ones) replace 'cmsplugin_filer_image.ThumbnailOption'
with thumbnail_model
like here https://github.com/nephila/djangocms-blog/blob/develop/djangocms_blog/migrations/0001_initial.py#L12 -> https://github.com/nephila/djangocms-blog/blob/develop/djangocms_blog/migrations/0001_initial.py#L108
# Changing field 'Post.main_image_full' | |
db.alter_column(u'djangocms_blog_post', 'main_image_full_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, on_delete=models.SET_NULL, to=orm['filer.ThumbnailOption'])) | |
# Changing field 'Post.main_image_thumbnail' | |
db.alter_column(u'djangocms_blog_post', 'main_image_thumbnail_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, on_delete=models.SET_NULL, to=orm['filer.ThumbnailOption'])) | |
# Changing field 'Post.main_image_full' | |
db.alter_column(u'djangocms_blog_post', 'main_image_full_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['cmsplugin_filer_image.ThumbnailOption'], on_delete=models.SET_NULL)) |
import django | |
DEBUG, ROOT_URLCONF, DATABASES, SECRET_KEY = 1, 'pico', {'default': {}}, 'p' | |
urlpatterns = [django.conf.urls.url(r'^(?P<name>\w+)?$', lambda request, | |
name: django.http.HttpResponse('hello %s!' % (name or 'world')))] |
TypeError at /de/admin/aldryn_categories/category/7/delete/ | |
delete() takes exactly 1 argument (2 given) | |
Request Method: POST | |
Request URL: http://myproject-dev.domain.com/de/admin/aldryn_categories/category/7/delete/ | |
Django Version: 1.6.10 | |
Exception Type: TypeError | |
Exception Value: | |
delete() takes exactly 1 argument (2 given) | |
Exception Location: /home/myproject-dev/app/local/lib/python2.7/site-packages/parler/models.py in delete, line 537 | |
Python Executable: /home/myproject-dev/app/bin/python |
Django==1.7 | |
https://github.com/divio/django-cms/archive/develop.zip | |
django-reversion==1.8.2 | |
https://github.com/divio/djangocms-text-ckeditor/archive/master.zip | |
https://github.com/divio/djangocms-admin-style/archive/master.zip | |
https://github.com/divio/djangocms-column/archive/master.zip | |
https://github.com/divio/djangocms-style/archive/master.zip | |
https://github.com/divio/djangocms-file/archive/master.zip | |
https://github.com/divio/djangocms-flash/archive/master.zip | |
https://github.com/divio/djangocms-googlemap/archive/master.zip |
class ProductAdmin(admin.ModelAdmin): | |
list_display = ('name','thumb') | |
def thumb(self, obj): | |
return render_to_string('thumb.html',{ | |
'image': obj.image | |
}) | |
thumb.allow_tags = True |
def import_wp(language): | |
from django.template.defaultfilters import truncatewords_html | |
from cms.api import add_plugin | |
from wordpress.models import Post as WPost | |
from djangocms_blog.models import Post, BlogCategory | |
from django.contrib.auth.models import User | |
for post in WPost.objects.published(): | |
print post.title |