示例#1
0
def create_postcards():
    c = Collection(slug='Postcards')
    c.add_field('rdfs:label', "Postcards Collection")
    base.create_child(c)  # create it in F4

    pc = Object(slug='Postcard', ordered=True)
    pc.add_field('label', 'Postcard')
    base.create_child(pc)   # This is when we get created in F4   
    pcp = c.add_member(pc)  # And now we modify to add order :(

    front = Object(slug='Front')
    base.create_child(front)
    pc.add_member(front)

    back = Object(slug='Back')
    base.create_child(back)
    pc.add_member(back)

    # Now we need to update Postcard and Proxies to set order?
    ff = File(slug="front.jpg", filename="../front.jpg")
    ff.contentType = "image/jpeg"
    front.add_file(ff)

    bf = File(slug="back.jpg", filename="../back.jpg")
    bf.contentType = "image/jpeg"
    back.add_file(bf)

    return c
示例#2
0
def create_postcards():
    c = Collection(slug='Postcards')
    c.add_field('rdfs:label', "Postcards Collection")
    base.create_child(c)  # create it in F4

    pc = Object(slug='Postcard', ordered=True)
    pc.add_field('label', 'Postcard')
    base.create_child(pc)  # This is when we get created in F4
    pcp = c.add_member(pc)  # And now we modify to add order :(

    front = Object(slug='Front')
    base.create_child(front)
    pc.add_member(front)

    back = Object(slug='Back')
    base.create_child(back)
    pc.add_member(back)

    # Now we need to update Postcard and Proxies to set order?
    ff = File(slug="front.jpg", filename="../front.jpg")
    ff.contentType = "image/jpeg"
    front.add_file(ff)

    bf = File(slug="back.jpg", filename="../back.jpg")
    bf.contentType = "image/jpeg"
    back.add_file(bf)

    return c
示例#3
0
def create_postcards():

    cs = BasicContainer(slug='Collections')
    base.create_child(cs)
    os = BasicContainer(slug='Objects')
    base.create_child(os)
    agents = BasicContainer(slug="Agents")
    base.create_child(agents)
    rwos = BasicContainer(slug="RWOs")
    base.create_child(rwos)
    places = BasicContainer(slug="Places")
    base.create_child(places)

    c = Collection(slug='Postcards')
    c.add_field('rdfs:label', "Postcards Collection")
    cs.create_child(c)  # create it in F4

    pc = Object(slug='Postcard', ordered=True)
    pc.add_field('label', 'Postcard')
    os.create_child(pc)   # This is when we get created in F4   
    pcp = c.add_member(pc)  # And now we modify to add order :(

    front = Object(slug='Front')
    os.create_child(front)
    pc.add_member(front)

    back = Object(slug='Back')
    os.create_child(back)
    pc.add_member(back)

    frontfs = FileSet(slug='FrontFiles')
    front.add_fileset(frontfs)

    # Now we need to update Postcard and Proxies to set order?
    ff = File(slug="front.jpg", filename="../front.jpg")
    ff.contentType = "image/jpeg"
    frontfs.add_file(ff)

    backfs = FileSet(slug='BackFiles')
    back.add_fileset(backfs)

    bf = File(slug="back.jpg", filename="../back.jpg")
    bf.contentType = "image/jpeg"
    backfs.add_file(bf)

    return c