Simple decorator to set attributes of target function or class in a DRY way.
Project description
Usage example:
# Django proposes: def my_calculated_field(... my_calculated_field.short_description = 'Field' my_calculated_field.admin_order_field = 'real_field' # DRY: @attr(short_description='Field', admin_order_field='real_field') def my_calculated_field(...
Get it:
sudo pip install attr from attr import attr
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
attr-0.2.0.tar.gz
(1.2 kB
view details)
File details
Details for the file attr-0.2.0.tar.gz
.
File metadata
- Download URL: attr-0.2.0.tar.gz
- Upload date:
- Size: 1.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 826135ffdd4d0b4bc8a580ce491c33fd90b55e169217539c34b7bfdbe2086ee3 |
|
MD5 | de69ad11c8872a6dfdbdace7eb81efb4 |
|
BLAKE2b-256 | a1555f4f546436716f8ef0c24fd4ea5e283a215131c70ff11c171d29e9eca2a2 |