Exemplo n.º 1
0
DO NOT REMOVE OR MODIFY THE LINES BEGINING WITH:
#>>> PLACE YOUR CODE BELOW...
#<<< PLACE YOUR CODE ABOVE...

MAKE SURE YOU PLACE YOUR CODE BETWEEN THESE LINES OR AT THE END OF THE FILE.
halfORM ONLY PRESERVES THE CODE BETWEEN THESE MARKS WHEN IT IS RUN.
"""

from halftest.db_connector import base_relation_class

#>>> PLACE YOUR CODE BELLOW THIS LINE. DO NOT REMOVE THIS LINE!

#<<< PLACE YOUR CODE ABOVE THIS LINE. DO NOT REMOVE THIS LINE!

__RCLS = base_relation_class('actor.person')

class Person( __RCLS):
    """
    __RCLS: <class 'half_orm.relation.Table_HalftestActorPerson'>
    This class allows you to manipulate the data in the PG relation:
    TABLE: "halftest"."actor"."person"
    DESCRIPTION:
    The table actor.person contains the persons of the blogging system.
    The id attribute is a serial. Just pass first_name, last_name and birth_date
    to insert a new person.
    FIELDS:
    - id:         (int4) UNIQUE NOT NULL
    - first_name: (text) PK
    - last_name:  (text) PK
    - birth_date: (date) PK
Exemplo n.º 2
0
DO NOT REMOVE OR MODIFY THE LINES BEGINING WITH:
#>>> PLACE YOUR CODE BELOW...
#<<< PLACE YOUR CODE ABOVE...

MAKE SURE YOU PLACE YOUR CODE BETWEEN THESE LINES OR AT THE END OF THE FILE.
halfORM ONLY PRESERVES THE CODE BETWEEN THESE MARKS WHEN IT IS RUN.
"""

from halftest.db_connector import base_relation_class

#>>> PLACE YOUR CODE BELLOW THIS LINE. DO NOT REMOVE THIS LINE!

#<<< PLACE YOUR CODE ABOVE THIS LINE. DO NOT REMOVE THIS LINE!

__RCLS = base_relation_class('blog.post')

class Post( __RCLS):
    """
    __RCLS: <class 'half_orm.relation.Table_HalftestBlogPost'>
    This class allows you to manipulate the data in the PG relation:
    TABLE: "halftest"."blog"."post"
    DESCRIPTION:
    The table blog.post contains all the post
    made by a person in the blogging system.
    FIELDS:
    - id:                (int4) PK
    - title:             (text)
    - content:           (text)
    - author_first_name: (text)
    - author_last_name:  (text)
Exemplo n.º 3
0
DO NOT REMOVE OR MODIFY THE LINES BEGINING WITH:
#>>> PLACE YOUR CODE BELOW...
#<<< PLACE YOUR CODE ABOVE...

MAKE SURE YOU PLACE YOUR CODE BETWEEN THESE LINES OR AT THE END OF THE FILE.
halfORM ONLY PRESERVES THE CODE BETWEEN THESE MARKS WHEN IT IS RUN.
"""

from halftest.db_connector import base_relation_class

#>>> PLACE YOUR CODE BELLOW THIS LINE. DO NOT REMOVE THIS LINE!

#<<< PLACE YOUR CODE ABOVE THIS LINE. DO NOT REMOVE THIS LINE!

__RCLS = base_relation_class('blog.comment')

class Comment( __RCLS):
    """
    __RCLS: <class 'half_orm.relation.Table_HalftestBlogComment'>
    This class allows you to manipulate the data in the PG relation:
    TABLE: "halftest"."blog"."comment"
    DESCRIPTION:
    The table blog.comment contains all the comments
    made by a person on a post.
    FIELDS:
    - id:        (int4) PK
    - content:   (text)
    - post_id:   (int4)
    - author_id: (int4)
    FOREIGN KEYS:
Exemplo n.º 4
0
DO NOT REMOVE OR MODIFY THE LINES BEGINING WITH:
#>>> PLACE YOUR CODE BELOW...
#<<< PLACE YOUR CODE ABOVE...

MAKE SURE YOU PLACE YOUR CODE BETWEEN THESE LINES OR AT THE END OF THE FILE.
halfORM ONLY PRESERVES THE CODE BETWEEN THESE MARKS WHEN IT IS RUN.
"""

from halftest.db_connector import base_relation_class
from halftest.blog.post import Post as BlogPost
#>>> PLACE YOUR CODE BELLOW THIS LINE. DO NOT REMOVE THIS LINE!

#<<< PLACE YOUR CODE ABOVE THIS LINE. DO NOT REMOVE THIS LINE!

__RCLS = base_relation_class('blog.event')

class Event(BlogPost, __RCLS):
    """
    __RCLS: <class 'half_orm.relation.Table_HalftestBlogEvent'>
    This class allows you to manipulate the data in the PG relation:
    TABLE: "halftest"."blog"."event"
    DESCRIPTION:
    The table blog.event contains all the events
    of the blogging system. It inherits blog.post.
    It's just here to illustrate the inheriance in half_orm
    FIELDS:
    - id:                (int4) PK
    - title:             (text)
    - content:           (text)
    - author_first_name: (text)
Exemplo n.º 5
0
DO NOT REMOVE OR MODIFY THE LINES BEGINING WITH:
#>>> PLACE YOUR CODE BELOW...
#<<< PLACE YOUR CODE ABOVE...

MAKE SURE YOU PLACE YOUR CODE BETWEEN THESE LINES OR AT THE END OF THE FILE.
halfORM ONLY PRESERVES THE CODE BETWEEN THESE MARKS WHEN IT IS RUN.
"""

from halftest.db_connector import base_relation_class

# >>> PLACE YOUR CODE BELLOW THIS LINE. DO NOT REMOVE THIS LINE!

# <<< PLACE YOUR CODE ABOVE THIS LINE. DO NOT REMOVE THIS LINE!

__RCLS = base_relation_class("blog.view.post_comment")


class PostComment(__RCLS):
    """
    __RCLS: <class 'half_orm.relation.View_HalftestBlogviewPost_comment'>
    This class allows you to manipulate the data in the PG relation:
    VIEW: "halftest"."blog.view"."post_comment"
    DESCRIPTION:
    This view joins:
    - comment,
    - author of the comment,
    - post,
    - author of the post.
    FIELDS:
    - post_title:                (text)