Skip to content
New issue

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

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

Already on GitHub? # to your account

Possibility to use class Meta when creating custom column #241

Closed
ekarious opened this issue Apr 12, 2015 · 3 comments · Fixed by rlmv/doc-trips#100
Closed

Possibility to use class Meta when creating custom column #241

ekarious opened this issue Apr 12, 2015 · 3 comments · Fixed by rlmv/doc-trips#100

Comments

@ekarious
Copy link

When creating a custom column, based on tables.Column or another template inherited by this one. It can be nice to have access to class Meta as well for modifying attributes like :

class NewColumn(tables.Column):

    [...]

    class Meta:
        attrs = {
            'th': {'class': 'some_class'},
            'td': {'class': 'some_class'}
        }

Instead of have to input them always in every new column created.
This is just a suggestion :)

@jieter
Copy link
Owner

jieter commented Jan 1, 2016

Nice idea. Are you able to make a patch and open a pull request?

@ekarious
Copy link
Author

ekarious commented Jan 2, 2016

Sorry, I don't think my knowledge of python and Django is this advanced.
This is why i just "push" a suggestion, otherwise i would have made it already :)

@jieter jieter closed this as completed in 0d1b7e2 Nov 22, 2017
@jieter
Copy link
Owner

jieter commented Nov 22, 2017

Now (in master) available like this:

class NewColumn(tables.Column):

    [...]

    attrs = {
        'th': {'class': 'some_class'},
        'td': {'class': 'some_class'}
    }

# for free to join this conversation on GitHub. Already have an account? # to comment