This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [23]: for p in Product.objects.all(): | In [24]: for p in Product.objects.all(): | |
...: print() ...: print() | |
...: print(p.name) ...: print(p.name) | |
...: for pv in p.productversion_set.all(): ...: for pv in p.productversion_set.all(): | |
...: print(' Version') ...: print(' Version') | |
...: for qc in pv.questioncollection_set.all(): ...: for qc in pv.questioncollection_set.all(): | |
...: print(' QC #', qc.position) ...: print(' QC #', qc.position) | |
...: for q in qc.questions.all(): ...: for q in qc.questions.all(): | |
...: print(' Q #', q.question_code, ...: print(' Q #', q.question_code, | |
...: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.apps import apps | |
from django.test import TestCase | |
from django.db.migrations.executor import MigrationExecutor | |
from django.db import connection | |
from django.db.models import F | |
from model_mommy import mommy | |
class TestMigrations(TestCase): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ActivityEdit = ({activity, updateActivity, response}) => ( | |
<div> | |
<h1>Welcome to {activity.get('name')}</h1> | |
<button | |
onClick={() => updateActivity(Map({name: 'New name'}))} | |
disabled={isPending(response)} | |
> | |
Update name | |
</button> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OrganisationDetail(SerializationSpecMixin, generics.RetrieveAPIView): | |
queryset = Organisation.objects.all() | |
serialization_spec = [ | |
'id', | |
'name', | |
{'created_by_user': [ | |
'email', | |
'status', |