Django-cotton

Latest version: v0.9.11

Safety actively analyzes 641872 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.9.11

What's Changed
- Attribute ordering was not being kept during compilation which was breaking situations when we are using template expressions to govern attributes in HTML tags
* Refactor loader + keep attribute ordering by wrabit in https://github.com/wrabit/django-cotton/pull/27

**Full Changelog**: https://github.com/wrabit/django-cotton/compare/v0.9.10...v0.9.11

0.9.10

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

0.9.4

What's Changed
* formatted title by wrabit in https://github.com/wrabit/django-cotton/pull/2
* Format mobile landing by wrabit in https://github.com/wrabit/django-cotton/pull/3
* Fix template loader path in docs by shakedown-street in https://github.com/wrabit/django-cotton/pull/5
* adds navigation items and remove code wrapping for better mobile expe… by wrabit in https://github.com/wrabit/django-cotton/pull/6
* Boolean attributes by wrabit in https://github.com/wrabit/django-cotton/pull/8

New Contributors
* shakedown-street made their first contribution in https://github.com/wrabit/django-cotton/pull/5

**Full Changelog**: https://github.com/wrabit/django-cotton/compare/v0.9.1...v0.9.4

0.9.1

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.