Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

row styling with get_row_css failing #13

Open
thesunlover opened this issue Oct 13, 2017 · 1 comment
Open

row styling with get_row_css failing #13

thesunlover opened this issue Oct 13, 2017 · 1 comment

Comments

@thesunlover
Copy link

thesunlover commented Oct 13, 2017

I'm using
Django==1.11.5
python2.7
django-liststyle==0.2b
not working with django-liststyle==0.2b0 as well

In My settings:

 INSTALLED_APPS = [
     'liststyle',  # required to be above 'django.contrib.admin'
     # default
     'django.contrib.admin',

In my admin.py file

class MyAdmin(ListStyleAdminMixin, admin.ModelAdmin):
    class Meta:
        model = MyModel
    def get_row_css(self, obj, index):
        1/0 # doesn't break in here
        if obj.status == STATUS_REJECTED:
            return 'red red%d' % index
        elif obj.status == STATUS_WAITING:
            return 'orange orange%d' % index
        return ''

TemplateSyntaxError: 'future' is not a registered tag library. Must be one of:
admin_list
admin_modify
admin_static
admin_urls
cache
highlighting
i18n
indent_text
l10n
liststyle_tags
log
rest_framework
static
staticfiles
syntax_color
thumbnail
truncate_letters
tz
widont

if you need additional information please ask

@AuHau
Copy link

AuHau commented Apr 2, 2018

This is because since Django 1.10 the future library was dropped as it was prepare migration to new behavior of cycle tag. The fix is as easy as removing the future import.

@fabriceb already done it in his fork, but I am not sure why he had not made PR with his fix...

You can use temporarily his fork by installing with pip install git+https://github.com/fabriceb/django-liststyle.git@cac1461939f4d7eedf2b8d144ce89da943791a7e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants