Skip to main content

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 hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page