hacker.rst 396 Bytes
Newer Older
Jamesie Pic's avatar
Jamesie Pic committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Hacker guide
~~~~~~~~~~~~

Adding random recommendations
=============================

::

    $ ./manage.py shell
    In [1]: from representatives_votes.models import Proposal
    In [2]: from votes.models import Recommendation
    In [3]: import random

    In [4]: for p in Proposal.objects.all(): Recommendation.objects.create(proposal=p, recommendation='for', weight=random.randint(1,10))