{ "info": { "author": "Mikko Hellsing", "author_email": "mikko@aino.se", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "==============\ndjango-mockups\n==============\nThis app aims to provide a simple way of loading masses of randomly generated\ntest data into your development database. You can use a management command to\nload test data through command line.\n\nUsually you add test data through the admin to see how your site looks with non\nstatic pages. You export data by using ``dumpdata`` to send it to your\ncolleagues or to preserve it before you make a ``manage.py reset app`` and so\non. Your site gets more and more complex and adding test data gets more and\nmore annoying.\n\nThis is the usecase where mockups should help you to save time that can\nactually be spent on hacking.\n\n\nInstallation\n============\nYou must make the ``mockups`` package available on your python path. Either\ndrop it into your project directory or install it from the python package index\nwith ``pip install django-mockups``.\n\nTo use the management command you must add ``'mockups'`` to the\n``INSTALLED_APPS`` setting in your django settings file. You don't need to do\nthis if you want to use the ``mockups`` package only as library.\n\n\nManagement command\n==================\nThe ``mockups`` accepts the following syntax::\n\n django-admin.py mockups [options] app.Model:# [app.Model:# ...]\n\nIts nearly self explanatory. Supply names of models, prefixed with its app\nname. After that, place a colon and tell the command how many objects you want\nto create. Here is an example how to create three categories and twenty\nentries for you blogging app::\n\n django-admin.py mockups blog.Category:3 blog.Entry:20\n\nVoila! You have ready to use testing data populated to your database. The\nmodel fields are filled with data by producing randomly generated values\ndepending on the type of the field. E.g. text fields are filled with lorem\nipsum dummies, date fields are populated with random dates from the last\nyears etc.\n\nThere are a few command line options available. Mainly to control the\nbehavior of related fields. If foreingkey or many to many fields should be\npopulated with existing data or if the related models are also generated on\nthe fly. Please have a look at the help page of the command for more\ninformation::\n\n django-admin.py help mockups\n\n\nUsing mockups as tool for unittests\n========================================\nIt has proofed that mockups have a great use for unittests. It has always\nbugged me that creating complex models for testing their behaviour was\ncomplicated. Sometimes models have strict restrictions or many related objects\nwhich they depend on. One solution would be to use traditional fixtures\ndumped from your production database. But while in development when database\nschemes are changing frequently, its hard to maintain all fixtures and to know\nexactly which objects are contained in the dumps etc...\n\nMockups to the rescue! It lets you automatically generate models and all\nof their dependecies on the fly. Have a look at the following examples.\n\nLets start with the very basics. We create a ``Mockup`` instance for the\n``Entry`` model and tell it to create ten model instances::\n\n from mockups import Mockup\n mockup = Mockup(Entry)\n entries = mockup.create(10)\n\nNow you can play around and test your blog entries. By default dependecies of\nforeignkeys and many to many relations are solved by randomly selecting an\nalready existing object of the related model. What if you don't have one yet?\nYou can provide the ``generate_fk`` attribute which allows the mockup\ninstance to follow foreignkeys by generating new related models::\n\n mockup = Mockup(Entry, generate_fk=True)\n\nThis generates new instance for *all* foreignkey fields of ``Entry``. Its\npossible to limit this behaviour to single fields::\n\n mockup = Mockup(Entry, generate_fk=['author'])\n\nThis will only create new authors automatically and doesn't touch other\ntables. The same is possible with many to many fields. But you need\nadditionally specify how many objects should be created for the m2m relation::\n\n mockup = Mockup(Entry, generate_m2m={'categories': (1,3)})\n\nAll created entry models get one to three new categories assigned.\n\nSetting custom values for fields\n--------------------------------\nHowever its often necessary to be sure that a specific field must have a\nspecific value. This is easily achieved with the use of ``Factory``::\n\n class PonyFactory(Factory):\n pub_date = generators.StaticGenerator(datetime(2010, 2, 1))\n\n class PonyMockup(Mockup):\n factory = PonyFactory \n\n mockup = PonyMockup(Entry)\n\n\nMore\n====\nThere is so much more to explore which might be useful for you and your\nprojects:\n\n* There are ways to register custom ``Mockup`` subclasses with models\n that are automatically used when calling ``mockups`` on the model.\n* More control for related models, even with relations of related models...\n (e.g. by using ``generate_fk=['author', 'author__user']``)\n* Custom constraints that are used to ensure that created the models are\n valid (e.g. ``unique`` and ``unique_together`` constraints which are\n already handled by default)\n\nI hope to explain this in the future with more details in a documentation. It\nwill be written but is not finished yet. I wanted to get this project out to\nsupport you in development. But since its only python code you can easily study\nthe source on your own and see in which ways it can be used. There are already\nsome parts documented with doc strings which might also be helpful for you.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sorl/django-mockups", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-mockups", "package_url": "https://pypi.org/project/django-mockups/", "platform": "any", "project_url": "https://pypi.org/project/django-mockups/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/sorl/django-mockups" }, "release_url": "https://pypi.org/project/django-mockups/0.4.8/", "requires_dist": null, "requires_python": null, "summary": "Provides tools to auto generate content.", "version": "0.4.8" }, "last_serial": 4528470, "releases": { "0.2.6": [ { "comment_text": "", "digests": { "md5": "982cb098c67c7ad4e6dd9e1c88bc0de7", "sha256": "810fc1bb253f6aab0a3c9576797ee1bdb8293b459d33a002613bd980cafb0244" }, "downloads": -1, "filename": "django-mockups-0.2.6.tar.gz", "has_sig": false, "md5_digest": "982cb098c67c7ad4e6dd9e1c88bc0de7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16713, "upload_time": "2010-10-15T23:35:48", "url": "https://files.pythonhosted.org/packages/53/c9/4a8bdf4ba2437acf39132de89a5c5792e74da04b04684e52af7defaf615f/django-mockups-0.2.6.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "ddd75fafdfd6c9f88f4a11b6d0773b80", "sha256": "9ee4199db3fff616fd98233d590e15fd62917889c1ddfb16909b8d4bc9477f7a" }, "downloads": -1, "filename": "django-mockups-0.4.0.tar.gz", "has_sig": false, "md5_digest": "ddd75fafdfd6c9f88f4a11b6d0773b80", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17491, "upload_time": "2010-10-16T22:38:31", "url": "https://files.pythonhosted.org/packages/3f/a8/359f59d28b21f1824831e13ff5f7c0bda6dc3b9778333cd8accf8d6407ae/django-mockups-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "af71b76f85038f4fa1d8b5975555a1be", "sha256": "2744810bdca9fbe30241a680471ca609c4668500e80c384ef996a285bc7f359d" }, "downloads": -1, "filename": "django-mockups-0.4.1.tar.gz", "has_sig": false, "md5_digest": "af71b76f85038f4fa1d8b5975555a1be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17490, "upload_time": "2010-10-17T02:22:56", "url": "https://files.pythonhosted.org/packages/2f/e5/e959cb56f13aee90c8bb8d6a6114402517dab8621a3db6d76f2b14f53edf/django-mockups-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "12ed65cb763e78df3273b3c905dbac35", "sha256": "453d769cdd411ccef4fa1a9ac23f257242b555021e7e6f01a2ffdca4bde6baca" }, "downloads": -1, "filename": "django-mockups-0.4.2.tar.gz", "has_sig": false, "md5_digest": "12ed65cb763e78df3273b3c905dbac35", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17575, "upload_time": "2010-10-17T11:21:12", "url": "https://files.pythonhosted.org/packages/3e/80/5f5db6398d704f966b10498a57bb8ea1a494aabf56d582c892d3951258f1/django-mockups-0.4.2.tar.gz" } ], "0.4.3": [ { "comment_text": "", "digests": { "md5": "ef6147e22534635c7e77401d97237016", "sha256": "973e9d19a51ed8161fa2b4a007087fb22817801612d466a6fb5aa9330efce447" }, "downloads": -1, "filename": "django-mockups-0.4.3.tar.gz", "has_sig": false, "md5_digest": "ef6147e22534635c7e77401d97237016", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20639, "upload_time": "2010-10-18T09:40:01", "url": "https://files.pythonhosted.org/packages/ef/60/49fc477b3440737d17f74bf6615c69b1cf9a9b7d93bfe260473e0280d68e/django-mockups-0.4.3.tar.gz" } ], "0.4.4": [ { "comment_text": "", "digests": { "md5": "1d1c4d5b7d8d775de7d64ea82bc4b154", "sha256": "020ce2c7615819c7512c9554fcc8156f5eb808f00b27ee58beb72fc312e2502a" }, "downloads": -1, "filename": "django-mockups-0.4.4.tar.gz", "has_sig": false, "md5_digest": "1d1c4d5b7d8d775de7d64ea82bc4b154", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20670, "upload_time": "2010-10-18T13:30:09", "url": "https://files.pythonhosted.org/packages/43/6c/7cbae8a2ed19c104061574f196cb4ef1c71ac7f617fe565608c8f05bd730/django-mockups-0.4.4.tar.gz" } ], "0.4.5": [ { "comment_text": "", "digests": { "md5": "4a1a5b654b12bba57c75c4b9e4c14fcf", "sha256": "90bd84ce47d41b8182c1c284c4ee066faae7eb757b9ceca2202ab1a9121335bc" }, "downloads": -1, "filename": "django-mockups-0.4.5.tar.gz", "has_sig": false, "md5_digest": "4a1a5b654b12bba57c75c4b9e4c14fcf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31427, "upload_time": "2011-02-06T22:57:21", "url": "https://files.pythonhosted.org/packages/d3/4e/1da42d97a990c812b8d466214c94a42075e6e4da8fcda0316f078fd14e00/django-mockups-0.4.5.tar.gz" } ], "0.4.6": [ { "comment_text": "", "digests": { "md5": "7bdd2ed3d54d71ee6bb70b5226c55d7e", "sha256": "7ae804f03412f9f8ade1cbec30a46fd351d5bae4a06a9dba109aef42e74ff0e7" }, "downloads": -1, "filename": "django-mockups-0.4.6.tar.gz", "has_sig": false, "md5_digest": "7bdd2ed3d54d71ee6bb70b5226c55d7e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31505, "upload_time": "2011-02-07T03:04:56", "url": "https://files.pythonhosted.org/packages/62/ab/4fa5cf2714c8f2765e1172adc8c7bfd695960036c981f90b740603363141/django-mockups-0.4.6.tar.gz" } ], "0.4.7": [ { "comment_text": "", "digests": { "md5": "9d605cb76f4d05599b5cd46bd39ad7b4", "sha256": "aa197bcc789c063f5aa55806191a6893d465a7c9ae7f16921b1a90583283b076" }, "downloads": -1, "filename": "django-mockups-0.4.7.tar.gz", "has_sig": false, "md5_digest": "9d605cb76f4d05599b5cd46bd39ad7b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31525, "upload_time": "2011-05-03T09:36:20", "url": "https://files.pythonhosted.org/packages/8b/8b/804dcfb8f06c1f28c703f9ba6b59e7ba43b1323aee12c70901b15ec4173c/django-mockups-0.4.7.tar.gz" } ], "0.4.8": [ { "comment_text": "", "digests": { "md5": "ea5a636f527f35af4ae971769021038a", "sha256": "9949f0290bb5dba652742ef8359756f81a6438a407ba45eef623fb515d1147dd" }, "downloads": -1, "filename": "django-mockups-0.4.8.tar.gz", "has_sig": false, "md5_digest": "ea5a636f527f35af4ae971769021038a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31586, "upload_time": "2011-05-03T09:52:09", "url": "https://files.pythonhosted.org/packages/88/f4/e19e3d2fcad9106f347eba02aa9a3b5ba1d15da0685fd2689d60203213f3/django-mockups-0.4.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ea5a636f527f35af4ae971769021038a", "sha256": "9949f0290bb5dba652742ef8359756f81a6438a407ba45eef623fb515d1147dd" }, "downloads": -1, "filename": "django-mockups-0.4.8.tar.gz", "has_sig": false, "md5_digest": "ea5a636f527f35af4ae971769021038a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31586, "upload_time": "2011-05-03T09:52:09", "url": "https://files.pythonhosted.org/packages/88/f4/e19e3d2fcad9106f347eba02aa9a3b5ba1d15da0685fd2689d60203213f3/django-mockups-0.4.8.tar.gz" } ] }