{ "info": { "author": "Jan Hoehn", "author_email": "jan@anyit.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP" ], "description": "==============\r\nattributes ...\r\n==============\r\n... is a *django app* which aims to provide *arbitrary attributes* for any model without touching it. The *flexibility won* is paid with the *speed lost*, which will become obvious in large scaled applications with dense data.\r\n\r\nChanges in 0.3.1\r\n================\r\n- Added batch processing for (o)bjects if passed as list argument.\r\n- Added batch processing for (n)ames if which will assign (if passed as dict argument) or retreive (list) multiple attributes.\r\n- Added namespace like retreivel of nested dict elements using dots (.).\r\n\r\nInstallation\r\n============\r\n- Just copy the attributes folder to your current django project and include 'attributes' in your settings.\r\n- Or install it using *sudo easy_install anyit.djattributes* and include 'anyit.djattributes.attributes'.\r\n\r\nUsage\r\n=====\r\nA javascript / JQuery like notation is implemented and provided by a simple interface class called *attr*. No capital letter like in usual classnames trying to make it feel like JQuery.\r\n\r\nMind the gap\r\n------------\r\n\r\nI am a bit concerned about this being *not compliant to django philosophy*. Make sure you do not use this for large scale non sparse data stuff. I was just bothered with a tree structure containing arbitrary, path dependent attributes. This is why I did it. If I could have avoided this I had my models more nailed down :)\r\n\r\nType interfaces\r\n---------------\r\n::\r\n\r\n # Creates a type. Look at the __doc__ for further info on types and \r\n # how they are represented. By now the internal_types int, float, \r\n # string, text, unicode, class (any pickleable object) and contenttype, \r\n # using a django gereric key, are supported.\r\n attr.create_type(name, description , type) \r\n\r\n # Careful! The cascade will destroy any values of the given type.\r\n attr.delete_type(name) \r\n\r\nCarrier interfaces\r\n------------------\r\n::\r\n\r\n # returns all attribute objects\r\n attr() \r\n\r\n # returns a list of attributes for the given owner.\r\n attr(owner) \r\n\r\n # returns the owners attribute with a given name or None.\r\n attr(owner, name) \r\n\r\n # ... set its value or raise if the type is not koscher.\r\n attr(owner, name, value) \r\n\r\n # create_attributetype chooses between creating an attributetype \r\n # with the given name, type determined by the given value and the \r\n # description set to the given name if a description is not \r\n # explicitely provided. create_attribute will associate a given \r\n # attribute with a carrier which is not yet attached with an \r\n # attribute type like given or raise a NameError. klass chooses \r\n # to enforce the attribute being attached to a model, even if an \r\n # instance is given. as_attribute will return the attribute, not\r\n # it's value.\r\n #\r\n # special cases:\r\n # o is a list: batch processing for multiple objects\r\n # n is a dict: batch processing setting multiple attributes\r\n # n is a list: batch processing getting multiple attributes\r\n # n (items) contain dots (.): namespace like retreival for subkeys\r\n # o and n are lists, or n a dict: a nested dict will be returned \r\n #\r\n # naming conventions for attribute keys\r\n # try using unicode\r\n # do not use the .\r\n\r\n attr(\r\n owner=None,\r\n name=None,\r\n value=None, \r\n create_attributetype=True, \r\n create_attribute=True, \r\n klass=False,\r\n description=None, \r\n as_attribute=False\r\n ) \r\n\r\n\r\nAttribute interfaces\r\n--------------------\r\n::\r\n\r\n # returns the owner of a given attribute\r\n attr.find(attribute) \r\n\r\n # returns a list of attributes for the attribute type of the given name\r\n attr.find(name) \r\n\r\n # returns a list of attributes for the attribute type of the given name matching the value\r\n attr.find(name, value) \r\n\r\nDestructive interfaces\r\n----------------------\r\n::\r\n\r\n # deletes all attributes\r\n attr.delete() \r\n \r\n # deletes all attributes having the given type.\r\n attr.delete(n=name) \r\n\r\n # deletes all attributes being attached to the given object or class.\r\n attr.delete(o=object) \r\n\r\n # deletes the attribute named n attached to o, the given object or class.\r\n attr.delete(o=object, n=name) \r\n\r\nTests\r\n=====\r\nTo get started you might also want to run the ./manage.py test attributes command and have a look at the second half of the *tests.py* file.\r\n\r\nCredits\r\n=======\r\nThe *PickledObjectField* and their tests (found in the first half of tests.py) taken from http://djangosnippets.org/snippets/1694/ and slightly modified so the __in lookup would work, too. Thanks for the snippet. Later I realized, this one might have worked, too: https://github.com/shrubberysoft/django-picklefield/blob/master/src/picklefield/fields.py.\r\n\r\nHave fun and feel free to contact me if you are having trouble, suggestions, ...", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": "django attributes persistent dict generic", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "anyit.djattributes", "package_url": "https://pypi.org/project/anyit.djattributes/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/anyit.djattributes/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/anyit.djattributes/0.3.1/", "requires_dist": null, "requires_python": null, "summary": "Attributes and a persistend dict type for django models in a JQuery inspired syntax.", "version": "0.3.1" }, "last_serial": 786312, "releases": { "0.2.5": [ { "comment_text": "", "digests": { "md5": "d94abc5c5ddcba5beb0a955bee49b14a", "sha256": "35d5578a4589da29faf38c1dbbd3c190ebb5ff7d659aa4c92ebe3823bdd0aa92" }, "downloads": -1, "filename": "anyit.djattributes-0.2.5-py2.6.egg", "has_sig": false, "md5_digest": "d94abc5c5ddcba5beb0a955bee49b14a", "packagetype": "bdist_egg", "python_version": "2.6", "requires_python": null, "size": 27571, "upload_time": "2011-03-21T23:58:32", "url": "https://files.pythonhosted.org/packages/e6/c4/1a8e6d0f52da27c4f782156b304ada4f577e28840e63f8e332189b7024c7/anyit.djattributes-0.2.5-py2.6.egg" }, { "comment_text": "", "digests": { "md5": "4f36d07c9300d0d619cad48866bdcb84", "sha256": "dd62c3ff2b50d75a3dd3980d2ef5e0c0119328e03e6a1e033b4268033b1146c5" }, "downloads": -1, "filename": "anyit.djattributes-0.2.5.tar.gz", "has_sig": false, "md5_digest": "4f36d07c9300d0d619cad48866bdcb84", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12475, "upload_time": "2011-03-21T23:58:32", "url": "https://files.pythonhosted.org/packages/cf/1d/50778e3aa1a1cc44ab937838c44db4933783c72cad9e2386cd753e374a36/anyit.djattributes-0.2.5.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "dea3f8d4ffa93ecaa167a1fcf07b5f17", "sha256": "490492620239c836986656ceab5e32b8fc52de232146a315d180972abe97c033" }, "downloads": -1, "filename": "anyit.djattributes-0.3.1-py2.6.egg", "has_sig": false, "md5_digest": "dea3f8d4ffa93ecaa167a1fcf07b5f17", "packagetype": "bdist_egg", "python_version": "2.6", "requires_python": null, "size": 31663, "upload_time": "2011-04-18T22:52:13", "url": "https://files.pythonhosted.org/packages/30/5c/64817ba5e6997da0e4717fae426ae4cb4f32bfc9377f63bc89e717e3088d/anyit.djattributes-0.3.1-py2.6.egg" }, { "comment_text": "", "digests": { "md5": "62c4f088c424ede07496745aa85dbaea", "sha256": "cf5c5f88fb0e171c577d11e6ae79e816dde44743c784da53d2207f36cafe408c" }, "downloads": -1, "filename": "anyit.djattributes-0.3.1.tar.gz", "has_sig": false, "md5_digest": "62c4f088c424ede07496745aa85dbaea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14498, "upload_time": "2011-04-18T22:52:12", "url": "https://files.pythonhosted.org/packages/78/c2/1f2e470dca2a93430bc62f69769249c8a9a4c5a632d1e244eaef6ac70915/anyit.djattributes-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dea3f8d4ffa93ecaa167a1fcf07b5f17", "sha256": "490492620239c836986656ceab5e32b8fc52de232146a315d180972abe97c033" }, "downloads": -1, "filename": "anyit.djattributes-0.3.1-py2.6.egg", "has_sig": false, "md5_digest": "dea3f8d4ffa93ecaa167a1fcf07b5f17", "packagetype": "bdist_egg", "python_version": "2.6", "requires_python": null, "size": 31663, "upload_time": "2011-04-18T22:52:13", "url": "https://files.pythonhosted.org/packages/30/5c/64817ba5e6997da0e4717fae426ae4cb4f32bfc9377f63bc89e717e3088d/anyit.djattributes-0.3.1-py2.6.egg" }, { "comment_text": "", "digests": { "md5": "62c4f088c424ede07496745aa85dbaea", "sha256": "cf5c5f88fb0e171c577d11e6ae79e816dde44743c784da53d2207f36cafe408c" }, "downloads": -1, "filename": "anyit.djattributes-0.3.1.tar.gz", "has_sig": false, "md5_digest": "62c4f088c424ede07496745aa85dbaea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14498, "upload_time": "2011-04-18T22:52:12", "url": "https://files.pythonhosted.org/packages/78/c2/1f2e470dca2a93430bc62f69769249c8a9a4c5a632d1e244eaef6ac70915/anyit.djattributes-0.3.1.tar.gz" } ] }