コード例 #1
0
def prepare_data(api):
    Entity.init()
    Scholarship.init()

    api.post('/api/entities/', json={
        'name': 'Foo',
        'code': 'foo',
        'website': 'http://foo.com',
    })

    api.post('/api/entities/', json={
        'name': 'Bar',
        'code': 'bar',
        'website': 'http://bar.com',
    })

    Scholarship.create({
        'id': 'foo',
        'name': 'foo',
        'createdAt': '2020-01-01',
        'state': State.ARCHIVED.value,
        'entity': {
            'code': 'foo',
            'name': 'Foo',
        },
    })

    Scholarship.create({
        'id': 'bar',
        'name': 'bar',
        'createdAt': '2020-01-01',
        'state': State.ARCHIVED.value,
        'entity': {
            'code': 'bar',
            'name': 'Bar',
        },
    })
コード例 #2
0
def scholarships_index():
    Scholarship.init()