-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bbd7e00
commit 5cf4ef6
Showing
66 changed files
with
174 additions
and
86 deletions.
There are no files selected for viewing
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
2023/chengdu/accessing-mongodb-sub-documents-through-proxy-objects/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<!DOCTYPE html><html lang="zh"><head><meta charset="utf-8"/><meta content="IE=edge" http-equiv="X-UA-Compatible"/><link href="../../pychina.png?h=621881a7" rel="shortcut icon"/><meta content="width=device-width, initial-scale=1.0" name="viewport"/><link href="../../static/style.css" rel="stylesheet"/><link href="../../static/custom.css" rel="stylesheet"/><title>Accessing MongoDB Sub-Documents Through Proxy Objects | PyCon China 2023</title></head><body><div class="flex flex-col min-h-screen"><nav><div class="max-w-6xl mx-auto px-4"><div class="flex justify-between"><div class="flex space-x-7"><div><a class="flex items-center py-4 px-2" href="../../"><img alt="Logo" class="h-10 w-10 mr-2" src="../../pychina.png?h=621881a7"/></a></div><div class="hidden md:flex items-center space-x-1 text-xl font-thin"><a class="py-4 px-2 text-white transition duration-300 hover:text-shadow" href="../../">首页 / Index</a><div class="menu"><div class="py-4 px-2 cursor-pointer text-white transition duration-300 hover:text-shadow">大会 / Conference</div><div class="menu-item bg-black border"><a class="block py-2 pl-2 pr-6 text-white transition duration-300 hover:bg-primary" href="../../about/">关于大会</a> <a class="block py-2 pl-2 pr-6 text-white transition duration-300 hover:bg-primary" href="../../cfp/">讲师/议题征集</a> <a class="block py-2 pl-2 pr-6 text-white transition duration-300 hover:bg-primary" href="../../partners/">合作伙伴</a></div></div><div class="menu"><div class="py-4 px-2 cursor-pointer text-white transition duration-300 hover:text-shadow">组委会 / Organization</div><div class="menu-item bg-black border"><a class="block py-2 pl-2 pr-6 text-white transition duration-300 hover:bg-primary" href="../../volunteer/">志愿者</a> <a class="block py-2 pl-2 pr-6 text-white transition duration-300 hover:bg-primary" href="../../special-thanks/">特别鸣谢</a></div></div><div class="menu"><div class="py-4 px-2 cursor-pointer text-white transition duration-300 hover:text-shadow">演讲 / Schedule</div><div class="menu-item bg-black border"><a class="block py-2 pl-2 pr-6 text-white transition duration-300 hover:bg-primary" href="../../beijing/">北京</a> <a class="block py-2 pl-2 pr-6 text-white transition duration-300 hover:bg-primary" href="../../shanghai/">上海</a> <a class="block py-2 pl-2 pr-6 text-white transition duration-300 hover:bg-primary" href="../../hangzhou/">杭州</a> <a class="block py-2 pl-2 pr-6 text-white transition duration-300 hover:bg-primary" href="../../chongqing/">重庆</a> <a class="block py-2 pl-2 pr-6 text-white transition duration-300 hover:bg-primary" href="../">成都</a> <a class="block py-2 pl-2 pr-6 text-white transition duration-300 hover:bg-primary" href="../../guangzhou/">广州</a> <a class="block py-2 pl-2 pr-6 text-white transition duration-300 hover:bg-primary" href="../../shenzhen/">深圳</a></div></div></div></div><div class="hidden md:flex items-center space-x-3"></div><div class="md:hidden flex items-center"><button class="outline-none mobile-menu-button"><svg class="w-6 h-6 text-black hover:text-white" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" x-show="!showMenu"><path d="M4 6h16M4 12h16M4 18h16"></path></svg></button></div></div></div><div class="hidden mobile-menu"><ul><li><a class="block text-sm px-2 py-4 hover:bg-gray-900 transition duration-300" href="../../">首页</a></li><li><div class="block text-sm px-2 py-4">大会</div><ul><li><a class="block text-sm py-2 pl-4 hover:bg-gray-900 transition duration-300" href="../../about/">关于大会</a></li><li><a class="block text-sm py-2 pl-4 hover:bg-gray-900 transition duration-300" href="../../cfp/">讲师/议题征集</a></li><li><a class="block text-sm py-2 pl-4 hover:bg-gray-900 transition duration-300" href="../../partners/">合作伙伴</a></li></ul></li><li><div class="block text-sm px-2 py-4">组委会</div><ul><li><a class="block text-sm py-2 pl-4 hover:bg-gray-900 transition duration-300" href="../../volunteer/">志愿者</a></li><li><a class="block text-sm py-2 pl-4 hover:bg-gray-900 transition duration-300" href="../../special-thanks/">特别鸣谢</a></li></ul></li><li><div class="block text-sm px-2 py-4">演讲</div><ul><li><a class="block text-sm py-2 pl-4 hover:bg-gray-900 transition duration-300" href="../../beijing/">北京</a></li><li><a class="block text-sm py-2 pl-4 hover:bg-gray-900 transition duration-300" href="../../shanghai/">上海</a></li><li><a class="block text-sm py-2 pl-4 hover:bg-gray-900 transition duration-300" href="../../hangzhou/">杭州</a></li><li><a class="block text-sm py-2 pl-4 hover:bg-gray-900 transition duration-300" href="../../chongqing/">重庆</a></li><li><a class="block text-sm py-2 pl-4 hover:bg-gray-900 transition duration-300" href="../">成都</a></li><li><a class="block text-sm py-2 pl-4 hover:bg-gray-900 transition duration-300" href="../../guangzhou/">广州</a></li><li><a class="block text-sm py-2 pl-4 hover:bg-gray-900 transition duration-300" href="../../shenzhen/">深圳</a></li></ul></li></ul></div><script> | ||
const btn = document.querySelector("button.mobile-menu-button"); | ||
const menu = document.querySelector(".mobile-menu"); | ||
|
||
btn.addEventListener("click", () => { | ||
menu.classList.toggle("hidden"); | ||
}); | ||
</script></nav><main class="mx-auto w-full lg:w-3/4 py-2 px-8 grow flex flex-col gap-2"><h1 class="font-bold text-4xl my-6 flex items-center space-x-2"><img class="w-16" src="../../arrow.png?h=57aa1d5d"/><span class="text-shadow">Accessing MongoDB Sub-Documents Through Proxy Objects</span></h1><p class="breadcumb flex"><a href="../../">首页</a><a href="../">成都</a><span>Accessing MongoDB Sub-Documents Through Proxy Objects</span></p><h2 class="text-xl mb-4 flex items-center text-white"><svg class="w-4 h-4 mr-2" viewBox="0 0 24 24"><path d="M12 20c4.4 0 8-3.6 8-8s-3.6-8-8-8s-8 3.6-8 8s3.6 8 8 8m0-18c5.5 0 10 4.5 10 10s-4.5 10-10 10S2 17.5 2 12S6.5 2 12 2m5 9.5V13h-6V7h1.5v4.5H17Z" fill="currentColor"></path></svg>2023-12-17 17:20</h2><article class="prose prose-invert lg:prose-lg border border-primary p-4 max-w-none grow"><div class="lg:flex items-center border-b border-gray-200"><img alt="Jonathan Lindstrom" class="w-40 h-40 rounded-full mr-6" src="jonathan.png"/><div><p class="text-base"><span class="font-bold mr-4 text-xl">Jonathan Lindstrom</span></p><div class="text-base"><p>Jonathan Lindstrom and his wife Lori currently live in Singapore. Their consulting firm Headwaters Entrepreneurs mentors small business owners throughout Asia. Jonathan has spent the last 33 years working for companies large and small in various IT roles as developer, system administrator, release engineer and manager. He made the switch to Python as his primary development language a decade ago but finds there are new and interesting things to learn about Python each day.</p><p>Jonathan Lindstrom 和他的妻子 Lori 目前住在新加坡。他们的咨询公司 Headwaters Entrepreneurs 为整个亚洲的小企业主提供指导。在过去的33年里,Jonathan 一直在大大小小的公司工作,担任各种 IT 角色,如开发人员、系统管理员、发布工程师和经理。十年前,他将 Python 作为自己的主要开发语言,但他发现每天都有关于 Python 的新的有趣的东西需要学习。</p></div></div></div><p>No-SQL databases like MongoDB make it easy to store application data in dictionary-like document objects. The PyMongo driver already makes it convenient to present MongoDB documents in custom Python classes. Sub-documents are simply child lists or dictionaries saved within a larger parent document. For example, a school management system might save students and grades as dictionaries within a "classroom" document. A shopping cart app could save color choices and inventory within each "item" document. This talk will demonstrate techniques for writing sub-document object classes that proxy references back to the original parent document. By proxying back to the parent, we ...</p><ol><li>retain the benefit of custom classes for each sub-document type</li><li>maintain a single source of truth inside our application</li><li>potentially reduce the need for database reads and writes</li></ol></article></main><footer class="mt-8 py-4 border-t-2 border-primary text-white"><div class="max-w-6xl mx-auto px-4 flex justify-between"><section class="w-1/3"><h1 class="text-lg font-bold p-2">导航</h1><a class="block p-2 hover:text-primary transition duration-300" href="../../">首页</a><div class="p-2">大会</div><div class="flex flex-wrap space-x-4 pl-6 py-2 text-sm"><a class="block hover:text-primary transition duration-300" href="../../about/">关于大会</a> <a class="block hover:text-primary transition duration-300" href="../../cfp/">讲师/议题征集</a> <a class="block hover:text-primary transition duration-300" href="../../partners/">合作伙伴</a></div><div class="p-2">组委会</div><div class="flex flex-wrap space-x-4 pl-6 py-2 text-sm"><a class="block hover:text-primary transition duration-300" href="../../volunteer/">志愿者</a> <a class="block hover:text-primary transition duration-300" href="../../special-thanks/">特别鸣谢</a></div></section><section class="w-1/3 border-l border-gray-200"><h1 class="text-lg font-bold p-2">演讲</h1><a class="block p-2 hover:text-primary transition duration-300" href="../../beijing/">北京</a> <a class="block p-2 hover:text-primary transition duration-300" href="../../shanghai/">上海</a> <a class="block p-2 hover:text-primary transition duration-300" href="../../hangzhou/">杭州</a> <a class="block p-2 hover:text-primary transition duration-300" href="../../chongqing/">重庆</a> <a class="block p-2 hover:text-primary transition duration-300" href="../">成都</a> <a class="block p-2 hover:text-primary transition duration-300" href="../../guangzhou/">广州</a> <a class="block p-2 hover:text-primary transition duration-300" href="../../shenzhen/">深圳</a></section><section class="w-1/3 border-l border-gray-200 p-2"><h1 class="text-lg font-bold">主办方</h1><p><a href="https://pychina.org" target="_blank"><img alt="PyChina" class="w-full" src="../../pychina-logo.jpeg"/></a></p><div class="flex flex-wrap items-center justify-center mb-2 space-x-1"><a class="hover:text-primary transition duration-300 mr-1" href="https://github.com/PyConChina/PyConChina2023" target="_blank"><svg aria-hidden="true" class="w-8 h-8" preserveAspectRatio="xMidYMid meet" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M12 2A10 10 0 0 0 2 12c0 4.42 2.87 8.17 6.84 9.5c.5.08.66-.23.66-.5v-1.69c-2.77.6-3.36-1.34-3.36-1.34c-.46-1.16-1.11-1.47-1.11-1.47c-.91-.62.07-.6.07-.6c1 .07 1.53 1.03 1.53 1.03c.87 1.52 2.34 1.07 2.91.83c.09-.65.35-1.09.63-1.34c-2.22-.25-4.55-1.11-4.55-4.92c0-1.11.38-2 1.03-2.71c-.1-.25-.45-1.29.1-2.64c0 0 .84-.27 2.75 1.02c.79-.22 1.65-.33 2.5-.33c.85 0 1.71.11 2.5.33c1.91-1.29 2.75-1.02 2.75-1.02c.55 1.35.2 2.39.1 2.64c.65.71 1.03 1.6 1.03 2.71c0 3.82-2.34 4.66-4.57 4.91c.36.31.69.92.69 1.85V21c0 .27.16.59.67.5C19.14 20.16 22 16.42 22 12A10 10 0 0 0 12 2Z" fill="currentColor"></path></svg></a> <a class="hover:text-primary transition duration-300 mr-1" href="https://twitter.com/PyConChina" target="_blank"><svg class="w-8 h-8" viewBox="0 0 24 24"><path d="M22.46 6c-.77.35-1.6.58-2.46.69c.88-.53 1.56-1.37 1.88-2.38c-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29c0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15c0 1.49.75 2.81 1.91 3.56c-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07a4.28 4.28 0 0 0 4 2.98a8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21C16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56c.84-.6 1.56-1.36 2.14-2.23Z" fill="currentColor"></path></svg></a> <a class="hover:text-primary transition duration-300 mr-1" href="https://pychina.org/#gh" target="_blank"><svg class="w-8 h-8" viewBox="0 0 24 24"><path d="M9.5 4C5.36 4 2 6.69 2 10c0 1.89 1.08 3.56 2.78 4.66L4 17l2.5-1.5c.89.31 1.87.5 2.91.5A5.22 5.22 0 0 1 9 14c0-3.31 3.13-6 7-6c.19 0 .38 0 .56.03C15.54 5.69 12.78 4 9.5 4m-3 2.5a1 1 0 0 1 1 1a1 1 0 0 1-1 1a1 1 0 0 1-1-1a1 1 0 0 1 1-1m5 0a1 1 0 0 1 1 1a1 1 0 0 1-1 1a1 1 0 0 1-1-1a1 1 0 0 1 1-1M16 9c-3.31 0-6 2.24-6 5s2.69 5 6 5c.67 0 1.31-.08 1.91-.25L20 20l-.62-1.87C20.95 17.22 22 15.71 22 14c0-2.76-2.69-5-6-5m-2 2.5a1 1 0 0 1 1 1a1 1 0 0 1-1 1a1 1 0 0 1-1-1a1 1 0 0 1 1-1m4 0a1 1 0 0 1 1 1a1 1 0 0 1-1 1a1 1 0 0 1-1-1a1 1 0 0 1 1-1Z" fill="currentColor"></path></svg></a><div class="text-sm text-center"><p>合作及其他更多事宜请联系</p><p>CynthiaXin1</p><p>PyChina © 2023</p></div></div></section></div></footer></div></body></html> |
Binary file added
BIN
+433 KB
2023/chengdu/accessing-mongodb-sub-documents-through-proxy-objects/jonathan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.