What's Changed
Ensures that the new template expression attributes are also provided in `{{ attrs }}` alongside all normal attributes.
* added expression attributes to {{ attrs }} by wrabit in https://github.com/wrabit/django-cotton/pull/25
**Full Changelog**: https://github.com/wrabit/django-cotton/compare/v.0.9.8...v0.9.10
v.0.9.9
What's Changed
Using template variables in attributes
Cotton now allows you to include template variables inside attributes.
html
<c-weather icon="fa-{{ icon }}"
unit="{{ unit|default:'c' }}"
condition="very {% get_intensity %}"
/>
* Docs fix by wrabit in https://github.com/wrabit/django-cotton/pull/20
* implemented variables and template methods inside attributes by wrabit in https://github.com/wrabit/django-cotton/pull/23
* updated poetry lock by wrabit in https://github.com/wrabit/django-cotton/pull/24
**Full Changelog**: https://github.com/wrabit/django-cotton/compare/v.0.9.7...v.0.9.8
v.0.9.7
What's Changed
Passing Python data types
Using the `:` to prefix an attribute tells Cotton we're passing a dynamic type down. We already know we can use this to send a variable, but you can also send basic python types, namely:
- Integers and Floats
- None
- True and False
- Lists
- Dictionaries
This benefits a number of use-cases, for example if you have a select component that you want to provide some value:
html
<!-- select.cotton.html -->
<select {{ attrs }}>
{% for option in options %}
<option value="{{ option }}">{{ option }}</option>
{% endfor %}
</select>
<c-select name="q1" :options="['yes', 'no', 'maybe']" />
html
<!-- output -->
<select name="q1">
<option value="yes">yes</option>
<option value="no">no</option>
<option value="maybe">maybe</option>
</select>
More
* Literal eval on ":" attrs and vars by wrabit in https://github.com/wrabit/django-cotton/pull/19
* 16
* https://django-cotton.com/docs/components#python-types
**Full Changelog**: https://github.com/wrabit/django-cotton/compare/v.0.9.6...v.0.9.7
v.0.9.6
What's Changed (**Breaking change**)
* Rename c props by wrabit in PR: https://github.com/wrabit/django-cotton/pull/15, all `<c-props />` are now `<c-vars />`, see issue: #14
**Full Changelog**: https://github.com/wrabit/django-cotton/compare/v0.9.4...v.0.9.6