Esempio n. 1
0
class Person(ApplicationRecord):
    name = japi.Attribute()
    age = japi.Attribute()

    company = japi.BelongsTo()
    tags = japi.HasMany()
    pets = japi.HasMany()
Esempio n. 2
0
class Post(japi.Model):
    site = 'http://test.com'

    basic = True

    title = japi.Attribute()
    body = japi.Attribute()

    creator = japi.BelongsTo(class_name='Author')
    comments = japi.HasMany()
    rating = japi.HasOne()
Esempio n. 3
0
class ResponseCode(ApplicationRecord):
    code = japi.Attribute()
Esempio n. 4
0
class Admin(ApplicationRecord):
    name = japi.Attribute()
Esempio n. 5
0
class Toy(ApplicationRecord):
    name = japi.Attribute()
Esempio n. 6
0
class Pet(ApplicationRecord):
    name = japi.Attribute()

    toys = japi.HasMany()
Esempio n. 7
0
class Company(ApplicationRecord):
    name = japi.Attribute()
Esempio n. 8
0
class Rating(japi.Model):
    stars = japi.Attribute()
Esempio n. 9
0
class State(japi.Model):
    name = japi.Attribute()
Esempio n. 10
0
class Author(japi.Model):
    name = japi.Attribute()

    state = japi.BelongsTo()
Esempio n. 11
0
class Comment(japi.Model):
    text = japi.Attribute()

    author = japi.BelongsTo()