oceanho-dj-share-lib


Nameoceanho-dj-share-lib JSON
Version 0.6 PyPI version JSON
download
home_pagehttps://github.com/oceanho/mydj/tree/master/contrib/oceanho/dj/share
SummaryA extension abstract Model from django.db.models.Model
upload_time2020-07-01 01:33:06
maintainer
docs_urlNone
authorOcean Ho
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ====================
oceanho-dj-share-lib
====================

oceanho-dj-share-lib 是个人(OceanHo)的 django 通用 library, 包括 model, utils, middleware, validators 等等.

Quick start
-----------

1. Define your models like this::

    import django.db.models
    from oceanho.dj.share.models import BigIntPKAbstractModel
    from oceanho.dj.share.models import HasCreationState
    from oceanho.dj.share.models import HasModificationState
    from oceanho.dj.share.models import HasSoftDeletionState
    from oceanho.dj.share.models import HasTenantIdState
    from oceanho.dj.share.models import HasActivationState

    class MyUser(BigIntPKAbstractModel, HasCreationState):
        email = models.CharField(max_length=200)


2. Execute `./manage.py makemigrations && ./mange.py migrate`, then go to your db, your tables like this::

    +------------+--------------+------+-----+---------+----------------+
    | Field      | Type         | Null | Key | Default | Extra          |
    +------------+--------------+------+-----+---------+----------------+
    | id         | bigint       | NO   | PRI | NULL    | auto_increment |
    | created_at | datetime(6)  | NO   |     | NULL    |                |
    | name       | varchar(200) | NO   |     | NULL    |                |
    +------------+--------------+------+-----+---------+----------------+
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/oceanho/mydj/tree/master/contrib/oceanho/dj/share",
    "name": "oceanho-dj-share-lib",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Ocean Ho",
    "author_email": "gzhehai@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/e9/87/3560fd7e6c0653afc7f06327d054e6be9f99b130fc6e15b64fea3a689548/oceanho-dj-share-lib-0.6.tar.gz",
    "platform": "",
    "description": "====================\noceanho-dj-share-lib\n====================\n\noceanho-dj-share-lib \u662f\u4e2a\u4eba(OceanHo)\u7684 django \u901a\u7528 library, \u5305\u62ec model, utils, middleware, validators \u7b49\u7b49.\n\nQuick start\n-----------\n\n1. Define your models like this::\n\n    import django.db.models\n    from oceanho.dj.share.models import BigIntPKAbstractModel\n    from oceanho.dj.share.models import HasCreationState\n    from oceanho.dj.share.models import HasModificationState\n    from oceanho.dj.share.models import HasSoftDeletionState\n    from oceanho.dj.share.models import HasTenantIdState\n    from oceanho.dj.share.models import HasActivationState\n\n    class MyUser(BigIntPKAbstractModel, HasCreationState):\n        email = models.CharField(max_length=200)\n\n\n2. Execute `./manage.py makemigrations && ./mange.py migrate`, then go to your db, your tables like this::\n\n    +------------+--------------+------+-----+---------+----------------+\n    | Field      | Type         | Null | Key | Default | Extra          |\n    +------------+--------------+------+-----+---------+----------------+\n    | id         | bigint       | NO   | PRI | NULL    | auto_increment |\n    | created_at | datetime(6)  | NO   |     | NULL    |                |\n    | name       | varchar(200) | NO   |     | NULL    |                |\n    +------------+--------------+------+-----+---------+----------------+",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A extension abstract Model from django.db.models.Model",
    "version": "0.6",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "064a619bab7b0b342c8e4119894e44a7",
                "sha256": "4822d9242cd86b5ce36ab3723dfd973e7a20d2e0db30420affef3b914b7a1528"
            },
            "downloads": -1,
            "filename": "oceanho-dj-share-lib-0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "064a619bab7b0b342c8e4119894e44a7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 2519,
            "upload_time": "2020-07-01T01:33:06",
            "upload_time_iso_8601": "2020-07-01T01:33:06.785462Z",
            "url": "https://files.pythonhosted.org/packages/e9/87/3560fd7e6c0653afc7f06327d054e6be9f99b130fc6e15b64fea3a689548/oceanho-dj-share-lib-0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-07-01 01:33:06",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "oceanho-dj-share-lib"
}
        
Elapsed time: 0.12705s