From 4da31e06995ff9680c2eb460adf1450c11c5273b Mon Sep 17 00:00:00 2001 From: grgr Date: Fri, 30 Sep 2022 12:41:24 +0200 Subject: [PATCH] fetch of categories and front end fix --- .../export-0.2.0.dist-info/INSTALLER | 1 + .../export-0.2.0.dist-info/LICENSE | 21 +++++ .../export-0.2.0.dist-info/METADATA | 83 ++++++++++++++++++ .../export-0.2.0.dist-info/RECORD | 14 +++ .../export-0.2.0.dist-info/REQUESTED | 0 .../export-0.2.0.dist-info/WHEEL | 4 + .library/lib/site-packages/export/__init__.py | 5 ++ .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 364 bytes .../export/__pycache__/api.cpython-310.pyc | Bin 0 -> 1847 bytes .../export/__pycache__/enums.cpython-310.pyc | Bin 0 -> 579 bytes .../export/__pycache__/models.cpython-310.pyc | Bin 0 -> 627 bytes .library/lib/site-packages/export/api.py | 46 ++++++++++ .library/lib/site-packages/export/enums.py | 9 ++ .library/lib/site-packages/export/models.py | 11 +++ __pycache__/app.cpython-310.pyc | Bin 0 -> 1959 bytes library.py => app.py | 49 ++++++----- init_db.py | 10 ++- library.db | Bin 16384 -> 16384 bytes templates/base.html | 8 +- templates/home.html | 8 +- 20 files changed, 237 insertions(+), 32 deletions(-) create mode 100644 .library/lib/site-packages/export-0.2.0.dist-info/INSTALLER create mode 100644 .library/lib/site-packages/export-0.2.0.dist-info/LICENSE create mode 100644 .library/lib/site-packages/export-0.2.0.dist-info/METADATA create mode 100644 .library/lib/site-packages/export-0.2.0.dist-info/RECORD create mode 100644 .library/lib/site-packages/export-0.2.0.dist-info/REQUESTED create mode 100644 .library/lib/site-packages/export-0.2.0.dist-info/WHEEL create mode 100644 .library/lib/site-packages/export/__init__.py create mode 100644 .library/lib/site-packages/export/__pycache__/__init__.cpython-310.pyc create mode 100644 .library/lib/site-packages/export/__pycache__/api.cpython-310.pyc create mode 100644 .library/lib/site-packages/export/__pycache__/enums.cpython-310.pyc create mode 100644 .library/lib/site-packages/export/__pycache__/models.cpython-310.pyc create mode 100644 .library/lib/site-packages/export/api.py create mode 100644 .library/lib/site-packages/export/enums.py create mode 100644 .library/lib/site-packages/export/models.py create mode 100644 __pycache__/app.cpython-310.pyc rename library.py => app.py (65%) diff --git a/.library/lib/site-packages/export-0.2.0.dist-info/INSTALLER b/.library/lib/site-packages/export-0.2.0.dist-info/INSTALLER new file mode 100644 index 0000000..a1b589e --- /dev/null +++ b/.library/lib/site-packages/export-0.2.0.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/.library/lib/site-packages/export-0.2.0.dist-info/LICENSE b/.library/lib/site-packages/export-0.2.0.dist-info/LICENSE new file mode 100644 index 0000000..457bf0d --- /dev/null +++ b/.library/lib/site-packages/export-0.2.0.dist-info/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Tom Bulled + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/.library/lib/site-packages/export-0.2.0.dist-info/METADATA b/.library/lib/site-packages/export-0.2.0.dist-info/METADATA new file mode 100644 index 0000000..9bdbb3d --- /dev/null +++ b/.library/lib/site-packages/export-0.2.0.dist-info/METADATA @@ -0,0 +1,83 @@ +Metadata-Version: 2.1 +Name: export +Version: 0.2.0 +Summary: Control module exports +Home-page: https://github.com/tombulled/export +License: MIT +Keywords: python,export,public,private +Author: Tom Bulled +Author-email: 26026015+tombulled@users.noreply.github.com +Requires-Python: >=3.8,<4.0 +Classifier: License :: OSI Approved :: MIT License +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Project-URL: Documentation, https://github.com/tombulled/export +Project-URL: Repository, https://github.com/tombulled/export +Description-Content-Type: text/markdown + +# export +Control module exports + +## About +This library dynamically generates an `__all__` attribute for modules + +## Usage + +### Private by Default +*Does* export objects marked **public**, *doesn't* export everything else + +```python +# lib.py + +import export + +export.init(default=export.PRIVATE) + +@export.public +def foo(): + pass + +def bar(): + pass + +def baz(): + pass +``` + +```python +>>> import lib +>>> +>>> lib.__all__ +['foo'] +``` + +### Public by Default +*Doesn't* export objects marked **private**, *does* export everything else + +```python +# lib.py + +import export + +export.init(default=export.PUBLIC) + +def foo(): + pass + +@export.private +def bar(): + pass + +@export.private +def baz(): + pass +``` + +```python +>>> import lib +>>> +>>> lib.__all__ +['export', 'foo'] +``` diff --git a/.library/lib/site-packages/export-0.2.0.dist-info/RECORD b/.library/lib/site-packages/export-0.2.0.dist-info/RECORD new file mode 100644 index 0000000..9d212c8 --- /dev/null +++ b/.library/lib/site-packages/export-0.2.0.dist-info/RECORD @@ -0,0 +1,14 @@ +export-0.2.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +export-0.2.0.dist-info/LICENSE,sha256=GnW03-0adM_f-nbemR0-poxBk-zJQWQB3t8yAMMFMhY,1067 +export-0.2.0.dist-info/METADATA,sha256=DtgARxtzqpdsOa2n2X7MCqeAm5oWFqFY44UuL0UR50U,1472 +export-0.2.0.dist-info/RECORD,, +export-0.2.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +export-0.2.0.dist-info/WHEEL,sha256=y3eDiaFVSNTPbgzfNn0nYn5tEn1cX6WrdetDlQM4xWw,83 +export/__init__.py,sha256=Q_CTsi3EXrwEvUx1vaRfOdyCClh212K0UH3CF8MJsxw,148 +export/__pycache__/__init__.cpython-310.pyc,, +export/__pycache__/api.cpython-310.pyc,, +export/__pycache__/enums.cpython-310.pyc,, +export/__pycache__/models.cpython-310.pyc,, +export/api.py,sha256=11G7-4dXNQMlUcyG91Ct3MVKeB3Q9JIhZYLNDR3yOyg,1208 +export/enums.py,sha256=P2ywq5fVliFyv4XdW-LGi8GDrYoGSQG3baaA0hUhnVY,176 +export/models.py,sha256=q292OojIkSLSBKjo-5WUQWbnAONe_X5nk7vbenuknDA,280 diff --git a/.library/lib/site-packages/export-0.2.0.dist-info/REQUESTED b/.library/lib/site-packages/export-0.2.0.dist-info/REQUESTED new file mode 100644 index 0000000..e69de29 diff --git a/.library/lib/site-packages/export-0.2.0.dist-info/WHEEL b/.library/lib/site-packages/export-0.2.0.dist-info/WHEEL new file mode 100644 index 0000000..3764652 --- /dev/null +++ b/.library/lib/site-packages/export-0.2.0.dist-info/WHEEL @@ -0,0 +1,4 @@ +Wheel-Version: 1.0 +Generator: poetry 1.0.7 +Root-Is-Purelib: true +Tag: py3-none-any diff --git a/.library/lib/site-packages/export/__init__.py b/.library/lib/site-packages/export/__init__.py new file mode 100644 index 0000000..a238f4b --- /dev/null +++ b/.library/lib/site-packages/export/__init__.py @@ -0,0 +1,5 @@ +from .api import init, public, private +from . import enums + +PUBLIC: enums.Access = enums.Access.PUBLIC +PRIVATE: enums.Access = enums.Access.PRIVATE diff --git a/.library/lib/site-packages/export/__pycache__/__init__.cpython-310.pyc b/.library/lib/site-packages/export/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1c624b511f26e81e3d6c2215301edd12f6a05980 GIT binary patch literal 364 zcmYk1&q@O^5XO_u{%Na4@X&YIL+j0h6tNZ$l_Ev0hY$$a-5{x(O-Qn0-@}*im2&mu zD|j-|9vqnOoB6>EGip2@fe;d%*YCkUWAi^yXs$xq+aO!efCjceLJVbs6NxZ_ktJ;^ zGn_%dvt7O`a1osk8Z`eSLp(f?bPk&A0hIX{3=2!-Q_%_MbKO_1sC}W0cx8^4&}Y2s zrShnlQKMXYdqs#*QQo_QF0 h)5^FrO5+oh&h*|7=2A6%%P-@9b`WF&j^SxCfj`b+T&Vy6 literal 0 HcmV?d00001 diff --git a/.library/lib/site-packages/export/__pycache__/api.cpython-310.pyc b/.library/lib/site-packages/export/__pycache__/api.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6461bfdf5d6e762baa1508412ed0484cda1b2609 GIT binary patch literal 1847 zcmaJ>&2QsG6rUN}lxRg;4pEThc&1&uPVAkT z0IAYbD{gu=TGX1QE0#{rXA!)Y+`h+|%oOf(ftiM?pUr@jjn_g#Q~A0qTMa zy6=lnG){THDVoyDBf(L^X(Z-O{r=po)0UWr)7I7LLhZ%f;9^m<;oZETJEU{x8RSQL z&nUM%waGDP*B9s11eOPbP&?SdisPnu!{xcn25W@?Zl3?x`PuV#pbV&Ca3f z6(ZOQIj6_;3-Tk`r@|BdDO6^>+&}S-*^JF-90&rL1U<#zwnCpT1Ay)p2Ee5^KuCfR z_SqhRg8W|~%ulo*pf0&!8$^b}la0J7qZP8xgfD_q|AYcW9KwW0OW8Ox-HoD5lR|HH zzbeI~kSYMjmd83RE2%;-QcUEZ4;c*Ghod*)qvB_>?wn*)Y2G4q)noX z{ysBLpl_^u-+G5~dO_4YT>taSt&azLS}Hw|Doc}rE+^HnOw6FjhAL6hH8C7?uk^uo zHXP{8$h9g-50e84mwu>9W!94_>sC|S+|bgb<*3@c1HLs9pOc8POGf$S(fYr^*^T3* zDB}1U=9fM?P3wtFsRp=ltWpT9?N+FfZ)N(VevhjiSw=-?5 zr;So~;Yyt_w*5xxyrv^2tq@4^HV>q!bF%?ZAw9GKgpt}t zwTE3WY%`A2BGHge$Ge)~`i^sVBLN4SkH9oBG7kGPU1rgO>VRs!a+v>(us9nC!4~Z2 zZ4fvK2Kb+QFpWUd3)TaY^29Z@<3meoPPt|)#06FFqK>4!MnSy_=IgMZKzdMC@qTur~rJsT^XYAHf%SmExPKl%a-pm zhfZffy@ftLM1dcvdm!vpB3N(To)1uS-KV>*0X0Gn;AHjHNg literal 0 HcmV?d00001 diff --git a/.library/lib/site-packages/export/__pycache__/enums.cpython-310.pyc b/.library/lib/site-packages/export/__pycache__/enums.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ea3690b21afb8fa7f5c712a951c4e798d638ce79 GIT binary patch literal 579 zcmYjOO-lnY5S?t&cKs-d2M->+uVB4-5GmDCM9?CB9hQZ#-9%~KcGqMVta#IZA%Y&g z`FnEpXky=q7~o#xZH3+bskQAyW`~n!k$=2rK`ws+g|bcvD^x`br>Q#Z?cI zL|f~sMi-?SB@78>M(YZC8{KXoC|1A|JhK6NMSV{&@G$bX3MuPO*uGQ$Yy2U%iTPVVAcjfWoc%oIC%R1R$;AJa6Wb0eisay^6%_PFwQy~eE94HgXb-J+Dk zOqD6ATbA;^jMJG`Vss)di!7|3T^*hrx5L`m`SJC^Wyf(_7*j`r=@sT+nQAnYzSGhO oAAIJsHE&uCxLL)T6CEU6+%K0A}xp2N|tv$sdjO8x3(9Nb9?27 z@Rxk$)W5)qaZ*7T$@BPT#`F2nO(r8CS%~8kO4vyy$2b|_zq-z8{D!ymTU>LlA4*kMF70*wO;}vaj$FohE7r)l8*#qwp`&YE;sN2CYtgd15zx-CnzJ ziI!libw=<{&`-#0)$hf-H^r4fZ3@(NB?{9Gec1_HsJhfbZ%$-coId!)$GR*`ZSkZR z)mL$i)bzdYw0%h@L1j++jrMQsXB$6h1doH~>;>DRvqVq)*dtO7wx@Ilf9Y>a{_)y* Z$G$Y1@9ycXe{|!2SOysz2T^#;{s6Wwn_K_@ literal 0 HcmV?d00001 diff --git a/.library/lib/site-packages/export/api.py b/.library/lib/site-packages/export/api.py new file mode 100644 index 0000000..1961bd3 --- /dev/null +++ b/.library/lib/site-packages/export/api.py @@ -0,0 +1,46 @@ +import inspect +import sys +import types +import typing + +from . import enums, models + + +def init(*, default: enums.Access = enums.Access.PRIVATE) -> None: + module: types.ModuleType = inspect.getmodule(inspect.stack()[1][0]) + + class Module(types.ModuleType): + _scope: models.Scope = models.Scope(default=default) + + @property + def __all__(self) -> typing.List[str]: + attributes: typing.Set[str] = { + key for key in dir(self) if not key.startswith("_") + } + + if self._scope.default == enums.Access.PUBLIC: + return sorted(attributes - self._scope.private) + + return sorted(self._scope.public) + + module.__class__ = Module + + +def public(obj: typing.T) -> typing.T: + return _export(obj, access=enums.Access.PUBLIC) + + +def private(obj: typing.T) -> typing.T: + return _export(obj, access=enums.Access.PRIVATE) + + +def _export(obj: typing.T, access: enums.Access) -> typing.T: + module: types.ModuleType = sys.modules[obj.__module__] + + collection: typing.Set[str] = ( + module._scope.public if access is enums.Access.PUBLIC else module._scope.private + ) + + collection.add(obj.__name__) + + return obj diff --git a/.library/lib/site-packages/export/enums.py b/.library/lib/site-packages/export/enums.py new file mode 100644 index 0000000..1d76ada --- /dev/null +++ b/.library/lib/site-packages/export/enums.py @@ -0,0 +1,9 @@ +import enum + + +class Access(enum.Enum): + PUBLIC = enum.auto() + PRIVATE = enum.auto() + + def __repr__(self) -> str: + return f"<{type(self).__name__}.{self.name}>" diff --git a/.library/lib/site-packages/export/models.py b/.library/lib/site-packages/export/models.py new file mode 100644 index 0000000..74b6501 --- /dev/null +++ b/.library/lib/site-packages/export/models.py @@ -0,0 +1,11 @@ +import dataclasses +import typing + +from . import enums + + +@dataclasses.dataclass +class Scope: + default: enums.Access = enums.Access.PRIVATE + public: typing.Set[str] = dataclasses.field(default_factory=set) + private: typing.Set[str] = dataclasses.field(default_factory=set) diff --git a/__pycache__/app.cpython-310.pyc b/__pycache__/app.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4fed4115ccb372648326bd4a2e4dbbe42775024d GIT binary patch literal 1959 zcmZ`)Pj4GV6rY*>YsYb%QWXLP?ExXJ)H+Bl98joQ(iDoQQzZe3RnTg^GjTRu?>e&+ zQd?^-4icAs2j|G=;9Ja<6XF~6Qr;UUZE4k!=FOX(H}CIn-j>VDO#&nP>&x`tB|`qj z&FjO4&0Uz)Z$LQVG$%tEQHngvS;Wk0MHZ}9ZV#Qv8M=`>^dfKQNB*!8H9*$p&KZfC z-xBU}?~HIyEX}N_B^RWWTW16$Ryo@x;qpJ= z0|}}22C_UE^~b%?(awWBsh;Q+DGDxRti*7XCrW7VMCS29DYYlX@rkIE_NCyN6sby4 z&E=rLSTHwXR@ZKEbb&OfPi-o3|G!9JZz8!1YxM~bK_bctl*r?ZTW1uCv?zql zU5LonoySrfWKSPuoaf>+kwTLcb8$J4XE04}I>6Kv@Bi%G zd*8(mdk?nt((dNY!^eAZ@7|*=ZQcI-cE~2J&9YFUP&fC+BQa?z@l>q?^s-{|>E2;h z1%SVRm!b-aQU!gHm&G7ZWuOj4fHel_HY=4#Rh?$)&}2$mxhPEHv@43V6^K!L zqWCqFWue>VN-RY+Dhoi;+qq4XJdfj#;8um{?ywIbyDi#c@5u2&z86xt0^;Bm)Tc;> zB93)4j)x^b$&qix@$pHLFHYopAS$mTdF6oN(4=ew!Ixyv>H}U|w)r+$UB5*9`UT>_ zEMnw2T~A?oIeg#{>ZZzn0Her^OtEg}Y0lX>nbM3*nSweRa6^xI#_p3}I{R#DO>Je@ z_6#aqTN^|%8b4wc6} zK#Bhhdr+e{neA@9!S~w_dw3=WrOW^c zzy|Lg+aTM$kRHbw556{ff!W@$e1W%7jZY@m4$GnFZsaAPqq+mkLIf08PsDg)V-TkAVfd4V zkv>$z90Z!L;thS%qyW87MS7w{ugiT20vn zf$)lMfL*D|GOrd+F|dd^)Xo9^SfmBK@k%<#Au6SZ1pBXc%l;9xegkj$F@DCrr~T7v vkj2;*9r#m$0W|iSuP@(<_BR$!><$*Ox(cLafs^by^_@<`?{qBRYSaG!XL{03 literal 0 HcmV?d00001 diff --git a/library.py b/app.py similarity index 65% rename from library.py rename to app.py index 71fee29..11cd6e1 100644 --- a/library.py +++ b/app.py @@ -1,6 +1,7 @@ # THE LIBRARY # -from itertools import groupby # to handle complex iterations + +from itertools import groupby # to handle complex iterations import os import sqlite3 @@ -16,7 +17,6 @@ def get_db_connection(): # Added row_factory attribute to the sqlite connection, in this way you can have name-based access to columns; this means that the database connection will return rows that behave like regular Python dictionaries. - # ----- FLASK ----- # class PrefixMiddleware(object): @@ -41,19 +41,23 @@ app = Flask(__name__) app.wsgi_app = PrefixMiddleware(app.wsgi_app, prefix='/soupboat/library') -@app.route("/", methods=['GET', 'POST']) +@app.route("/") def home(): conn = get_db_connection() todos = conn.execute('SELECT c.content, cat.title FROM cards c JOIN categories cat \ - ON c.category_id = cat.id ORDER BY c.created').fetchall() - + ON c.category_id = cat.id ORDER BY cat.title').fetchall() + categories = {} # for each category and group of cards for each cat in groupby() grouper object for k, g in groupby(todos, key=lambda t: t['title']): categories[k] = list(g) - - + print(categories[k]) + for cat, cards in categories.items(): # ♥ .items is a build in attribute of the dictionary(?) + print(cat) + for card in cards: + print(' ', card['content']) + # if request.method == 'POST': # title = request.form.get('title') # author = request.form.get('author') @@ -64,26 +68,25 @@ def home(): return render_template('home.html', categories=categories) +# @app.route("/add", methods=['GET', 'POST']) +# def create(): +# # the goal here is to choose from a list of parameters what you want to add +# # 1- ogni blocco del form dovrebbe essere una tabella a parte +# if request.method == 'POST': +# title = request.form.get('title') +# author = request.form.get('author') +# description = request.form.get('description') +# add_book(author, title, description) +# # if author: +# # return url_for('add_new_author') +# return redirect(url_for('home')) +# return render_template('add_new.html') -@app.route("/add", methods=['GET', 'POST']) -def create(): - # the goal here is to choose from a list of parameters what you want to add - # 1- ogni blocco del form dovrebbe essere una tabella a parte - if request.method == 'POST': - title = request.form.get('title') - author = request.form.get('author') - description = request.form.get('description') - add_book(author, title, description) -# if author: -# return url_for('add_new_author') - - return redirect(url_for('home')) - return render_template('add_new.html') -app.run(port=3148) +# app.run(port=3148) # TODO: # - list the cards -# - put its category inside \ No newline at end of file +# - put its category inside diff --git a/init_db.py b/init_db.py index 035c09d..137a5a6 100644 --- a/init_db.py +++ b/init_db.py @@ -8,8 +8,16 @@ with open('schema.sql') as f: cur = connection.cursor() +cur.execute("INSERT INTO categories (title) VALUES (?)", ('Reading',)) +cur.execute("INSERT INTO categories (title) VALUES (?)", ('Note',)) +cur.execute("INSERT INTO categories (title) VALUES (?)", ('Question',)) + +cur.execute("INSERT INTO cards (category_id, content) VALUES (?,?)", + (1, 'Oltre Eboli')) +cur.execute("INSERT INTO cards (category_id, content) VALUES (?,?)", + (1, 'This is not an Atlas')) # close conenction connection.commit() -connection.close() \ No newline at end of file +connection.close() diff --git a/library.db b/library.db index 0b485723f0fb50b2a31cc07b19a6ef61318eda0d..9f911a2acb8759b1e38e73b5161c1d5dd9ec9e42 100644 GIT binary patch delta 350 zcmZo@U~Fh$oFFa8&cMLH0>m)DHc`hID5&RO%L^1@=6%V)_nF^yV?i~q1Pi;kxHw~T zZb@QNPHJ*uQA#nGVA{;g=fcRyJlTU^fsti$CjV>>CjPYy{I~hnZWa_+$RDr6#LB>F zY-(g+WTb0gscU4ZU}R`zWME}%7?P1$tN=uL`6UX8c?ymtIf=!}j3Cv@SXBGxloX{Z zxF+T2WP;qr#Q&6m{{#P1pd~l?H947>#Tg;);bUZ01Tsrf)ANfmQ;V6w9^qfa!2f{% zF#jT;@+tgr^2{s@#m)DG*QPGD5z(mzzY;&=6%V)@5=XiV?i~q1T(w1xHw~T zZb@QNPHJ*uQA#nGVA;&f=fcRyIN5_=fstu)CjV?E27%3j3Rn0iPEcb5nSzrG0Op+? A4gdfE diff --git a/templates/base.html b/templates/base.html index 3d8c5b8..86bb645 100644 --- a/templates/base.html +++ b/templates/base.html @@ -2,12 +2,12 @@ - library - - + {% block title %} {% endblock %} + + - + {% block content %} {% endblock %} diff --git a/templates/home.html b/templates/home.html index 0deac9a..a25baa7 100644 --- a/templates/home.html +++ b/templates/home.html @@ -2,20 +2,20 @@ {% block content %}

{% block title %} Welcome to FlaskTodo {% endblock %}

- {% for category, cards in categories.cards() %} + {% for category, cards in categories.items() %}

{{ category }}

    {% for card in cards %} -
  • {{ cards['content'] }}
  • +
  • {{ card['content'] }}
  • {% endfor %}
{% endfor %} {% endblock %} - + #}-->