Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    model_mommy 1.0

    Download button

    No screenshots available
    Downloads: 199  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Vanderson Mota dos Santos | More programs
    The Apache License 2.0 / FREE
    September 11th, 2012, 19:47 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    model_mommy description

    Object factory for Django

    model_mommy is a Python module for creating objects for testing in Django, inspired in ruby's ObjectDaddy and FactoryGirl. It generate the values according with the field type, but i will add support to custom values as well.

    Installing:

    pip install model_mommy

    Basic Usage:

    If you have a model like this in your app:

    class Kid(models.Model):
     name = models.CharField(max_length=30)
     age = models.IntegerField()
     bio = models.TextField()
     birthday = models.DateField()

    just call the mommy =):

    from model_mommy import mommy
    kid = mommy.make_one(Kid)


    and your object is created! No boring attributes passing like 'foobar' every damn time.

    mommy also handles relationships. Suppose the kid has a dog:

    class Dog(models.Model):
     owner = models.ForeignKey('Kid')

    when you do:

    rex = mommy.make_one(Dog)

    it will also create the Kid, automatically.

    Currently supports the fields:

    CharField, TextField, FloatField, ForeignKey, DateField, and all the integer-type Fields


    Product's homepage

    Requirements:

    · Python

      


    TAGS:

    object factory | Django testing | Django | object | factory

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM