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.1.0.tar.gz (1.2 kB view details)

Uploaded Source

File details

Details for the file attr-0.1.0.tar.gz.

File metadata

  • Download URL: attr-0.1.0.tar.gz
  • Upload date:
  • Size: 1.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for attr-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5031f87ddca9f647dcc0ef38db37f2f2ba4f519c73f1b392f7a87ef47a2f298d
MD5 d59f397a3124da33118daaca4e45b2a8
BLAKE2b-256 628082ed2a433d839e8c28f79ca5ddcabff97bae0af6f7d966cc042412ba7db1

See more details on using hashes here.

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