django-walrus


Namedjango-walrus JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryAdd assignment expressions (walrus operator) to Django templates
upload_time2024-03-22 22:04:22
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2020 Baptiste Mispelon Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords assignment expression django walrus
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # django-walrus

![Dr. Walruss K-M](walfreakboy3742.jpg)

## Installation

1) `pip install django-walrus`
2) Add `walrus` to your settings's `INSTALLED_APPS`
3) That's it. Now you can go for a swim in ice-cold water, or maybe hunt a penguin.

## Usage

Once `django-walrus` is installed, you can use the power of the
[walrus operator](https://docs.python.org/3/reference/expressions.html?highlight=walrus#assignment-expressions)
in your template's `{% if %}` statements:

```django
{% if result := my_mode.some_expensive_method %}
    Wow, check out this result: {{ result }}.
{% else %}
    Nothing to see here.
{% endif %}
```

## Is this real?

As real as a two ton polar mammal.

## Optimized

You can activate some optimizations by setting `WALRUS_OPTIMIZED=1` in your shell
environment.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "django-walrus",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "assignment expression, django, walrus",
    "author": null,
    "author_email": "Baptiste Mispelon <bmispelon@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/3e/ea/0d579084e93575800afe1cfab3e122af28543b55df4704f0acfeae777ac7/django_walrus-0.1.0.tar.gz",
    "platform": null,
    "description": "# django-walrus\n\n![Dr. Walruss K-M](walfreakboy3742.jpg)\n\n## Installation\n\n1) `pip install django-walrus`\n2) Add `walrus` to your settings's `INSTALLED_APPS`\n3) That's it. Now you can go for a swim in ice-cold water, or maybe hunt a penguin.\n\n## Usage\n\nOnce `django-walrus` is installed, you can use the power of the\n[walrus operator](https://docs.python.org/3/reference/expressions.html?highlight=walrus#assignment-expressions)\nin your template's `{% if %}` statements:\n\n```django\n{% if result := my_mode.some_expensive_method %}\n    Wow, check out this result: {{ result }}.\n{% else %}\n    Nothing to see here.\n{% endif %}\n```\n\n## Is this real?\n\nAs real as a two ton polar mammal.\n\n## Optimized\n\nYou can activate some optimizations by setting `WALRUS_OPTIMIZED=1` in your shell\nenvironment.\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2020 Baptiste Mispelon\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.",
    "summary": "Add assignment expressions (walrus operator) to Django templates",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/bmispelon/django-walrus",
        "Issues": "https://github.com/bmispelon/django-walrus/issues"
    },
    "split_keywords": [
        "assignment expression",
        " django",
        " walrus"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "722d7f0c74de22dd6365d90bb055b752bd5b4213b2916712168d9c9444867e52",
                "md5": "954166e6989937f1eb2f81e98fa2689a",
                "sha256": "ec7c2052cb1f83d3992ac6bbdf277e9ff2a4246b52b9ce94825f08b5f9b7b966"
            },
            "downloads": -1,
            "filename": "django_walrus-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "954166e6989937f1eb2f81e98fa2689a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 3900,
            "upload_time": "2024-03-22T22:04:24",
            "upload_time_iso_8601": "2024-03-22T22:04:24.068788Z",
            "url": "https://files.pythonhosted.org/packages/72/2d/7f0c74de22dd6365d90bb055b752bd5b4213b2916712168d9c9444867e52/django_walrus-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3eea0d579084e93575800afe1cfab3e122af28543b55df4704f0acfeae777ac7",
                "md5": "9d8ccf0e574ae3d0e570209c589b8963",
                "sha256": "bcaf48f0ce24e8647bab3ddc8fb125d0493555a93a2b44db5e9cae17c82648c1"
            },
            "downloads": -1,
            "filename": "django_walrus-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9d8ccf0e574ae3d0e570209c589b8963",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 3592,
            "upload_time": "2024-03-22T22:04:22",
            "upload_time_iso_8601": "2024-03-22T22:04:22.524160Z",
            "url": "https://files.pythonhosted.org/packages/3e/ea/0d579084e93575800afe1cfab3e122af28543b55df4704f0acfeae777ac7/django_walrus-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-22 22:04:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "bmispelon",
    "github_project": "django-walrus",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "django-walrus"
}
        
Elapsed time: 0.24498s