Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 49 lines (44 sloc) 2.147 kb
f54c9df @claudiob Completed CharField, TextField, SlugField, ForeignKey and partially File...
claudiob authored
1 from distutils.core import setup
2
3 setup(
4 name = "random_instances",
5 packages = ["random_instances"],
6 package_data={'random_instances': ['*.py']},
15348ad @claudiobi Skipping OneToOneField as they might contain _ptr for inherited models.
claudiobi authored
7 version = "0.0.3",
f54c9df @claudiob Completed CharField, TextField, SlugField, ForeignKey and partially File...
claudiob authored
8 description = "Retrieve or generate random instances of Django models.",
9 author = "Red Interactive",
10 author_email = "geeks@ff0000.com",
11 url = "http://ff0000.com/",
12 download_url = "https://github.com/ff0000/random_instances",
13 keywords = ["django", "admin", "bdd", "tdd", "documentation", "lettuce"],
14 classifiers = [
15 "Programming Language :: Python",
16 "Development Status :: 3 - Alpha",
17 "Framework :: Django",
18 "Natural Language :: English",
19 "Environment :: Web Environment",
20 "Intended Audience :: Developers",
21 "License :: OSI Approved :: MIT License",
22 "Operating System :: OS Independent",
23 "Topic :: Software Development :: Documentation",
24 "Topic :: Software Development :: Testing",
25 "Topic :: Utilities"
26 ],
27 long_description = """\
28 An utility to retrieve or generate random instances of Django models.
29 -------------------------------------
30
15348ad @claudiobi Skipping OneToOneField as they might contain _ptr for inherited models.
claudiobi authored
31 This module exports a get_or_create_random function that improves Django's
f54c9df @claudiob Completed CharField, TextField, SlugField, ForeignKey and partially File...
claudiob authored
32 get_or_create (http://djangoproject.com/documentation/models/get_or_create/)
33 on two aspects:
34
35 * invoking get_or_create_random with parameters that match MULTIPLE instances
36 does not raise an error, but rather returns one of those instances at random
37
38 * invoking get_or_create_random with parameters that do not match ANY instance
39 returns a NEW instance of that model (the same occurs with get_or_create). The
40 improvement is that get_or_create_random can be invoked without passing a value
15348ad @claudiobi Skipping OneToOneField as they might contain _ptr for inherited models.
claudiobi authored
41 for all the 'required' fields of the model. If these fields are not passed,
f54c9df @claudiob Completed CharField, TextField, SlugField, ForeignKey and partially File...
claudiob authored
42 they are automatically filled with random values (e.g.: CharFields are filled
43 with random strings, ImageFields with random images).
44
15348ad @claudiobi Skipping OneToOneField as they might contain _ptr for inherited models.
claudiobi authored
45 The goal is to make prototyping faster, as model instances can be obtained and
f54c9df @claudiob Completed CharField, TextField, SlugField, ForeignKey and partially File...
claudiob authored
46 created by specifying just the minimum set of desired fields. This is useful
47 when writing tests and can avoid having to write complex fixtures.
48 """
49 )
Something went wrong with that request. Please try again.