sync from Atlas
This commit is contained in:
@@ -1243,7 +1243,7 @@
|
||||
"time_start": "2014-07-21 13:30:00",
|
||||
"time_stop": "2014-07-21 17:00:00",
|
||||
"venue_serial": 1451,
|
||||
"description": "Metaprograming in Python is fun and profitable thanks to its rich Data Model \u2013 APIs that let you handle functions, modules and even classes as objects that you can create, inspect and modify at runtime. The Data Model also enables your own objects to support infix operators, become iterable and emulate collections. This workshop shows how, through a diverse selection of examples and exercises.",
|
||||
"description": "Metaprogramming in Python is fun and profitable thanks to its rich Data Model \u2013 APIs that let you handle functions, modules and even classes as objects that you can create, inspect and modify at runtime. The Data Model also enables your own objects to support infix operators, become iterable and emulate collections. This workshop shows how, through a diverse selection of examples and exercises.",
|
||||
"website_url": "http://oscon.com/oscon2014/public/schedule/detail/34107",
|
||||
"speakers": [150170],
|
||||
"categories": [
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import shelve
|
||||
|
||||
from schedule_v2 import DB_NAME, CONFERENCE, load_db
|
||||
from schedule_v2 import DbRecord, Event
|
||||
|
||||
with shelve.open(DB_NAME) as db:
|
||||
if CONFERENCE not in db:
|
||||
load_db(db)
|
||||
|
||||
DbRecord.set_db(db)
|
||||
event = DbRecord.fetch('event.33950')
|
||||
print(event)
|
||||
print(event.venue)
|
||||
print(event.venue.name)
|
||||
for spkr in event.speakers:
|
||||
print(f'{spkr.serial}:', spkr.name)
|
||||
|
||||
print(repr(Event.venue))
|
||||
|
||||
event2 = DbRecord.fetch('event.33451')
|
||||
print(event2)
|
||||
print(event2.fetch)
|
||||
print(event2.venue)
|
||||
@@ -56,4 +56,4 @@ def test_event_speakers():
|
||||
|
||||
def test_event_no_speakers():
|
||||
event = schedule.Record.fetch('event.36848')
|
||||
assert event.speakers == []
|
||||
assert event.speakers == []
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# pseudo-code for object construction
|
||||
# pseudocode for object construction
|
||||
def make(the_class, some_arg):
|
||||
new_object = the_class.__new__(some_arg)
|
||||
if isinstance(new_object, the_class):
|
||||
|
||||
Reference in New Issue
Block a user