|
113 | 113 | "/Users/cls/miniforge3/envs/tuttle/lib/python3.9/site-packages/sqlmodel/orm/session.py:60: SAWarning: Class SelectOfScalar will not make use of SQL compilation caching as it does not set the 'inherit_cache' attribute to ``True``. This can have significant performance implications including some performance degradations in comparison to prior SQLAlchemy versions. Set this attribute to True if this object can make use of the cache key generated by the superclass. Alternatively, this attribute may be set to False which will disable this warning. (Background on this error at: https://sqlalche.me/e/14/cprf)\n",
|
114 | 114 | " results = super().execute(\n"
|
115 | 115 | ]
|
| 116 | + }, |
| 117 | + { |
| 118 | + "ename": "NoResultFound", |
| 119 | + "evalue": "No row was found when one was required", |
| 120 | + "output_type": "error", |
| 121 | + "traceback": [ |
| 122 | + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
| 123 | + "\u001b[0;31mNoResultFound\u001b[0m Traceback (most recent call last)", |
| 124 | + "\u001b[0;32m/var/folders/pl/9s2ysv_92pn6_2w7j2t40mh00000gn/T/ipykernel_48194/3726912579.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mmy_project\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mapp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_project\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtitle\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"#HeatingRepair\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", |
| 125 | + "\u001b[0;32m~/Documents/Work/Projects/PrototypeFund/Dev/tuttle/tuttle/app.py\u001b[0m in \u001b[0;36mget_project\u001b[0;34m(self, title, tag)\u001b[0m\n\u001b[1;32m 86\u001b[0m \u001b[0;34m\"\"\"Get a project by title or tag.\"\"\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 87\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mtitle\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 88\u001b[0;31m project = self.db_session.exec(\n\u001b[0m\u001b[1;32m 89\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0msqlmodel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mselect\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmodel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mProject\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwhere\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmodel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mProject\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtitle\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0mtitle\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 90\u001b[0m ).one()\n", |
| 126 | + "\u001b[0;32m~/miniforge3/envs/tuttle/lib/python3.9/site-packages/sqlalchemy/engine/result.py\u001b[0m in \u001b[0;36mone\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1405\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1406\u001b[0m \"\"\"\n\u001b[0;32m-> 1407\u001b[0;31m return self._only_one_row(\n\u001b[0m\u001b[1;32m 1408\u001b[0m \u001b[0mraise_for_second_row\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mraise_for_none\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mscalar\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1409\u001b[0m )\n", |
| 127 | + "\u001b[0;32m~/miniforge3/envs/tuttle/lib/python3.9/site-packages/sqlalchemy/engine/result.py\u001b[0m in \u001b[0;36m_only_one_row\u001b[0;34m(self, raise_for_second_row, raise_for_none, scalar)\u001b[0m\n\u001b[1;32m 559\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mrow\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 560\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mraise_for_none\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 561\u001b[0;31m raise exc.NoResultFound(\n\u001b[0m\u001b[1;32m 562\u001b[0m \u001b[0;34m\"No row was found when one was required\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 563\u001b[0m )\n", |
| 128 | + "\u001b[0;31mNoResultFound\u001b[0m: No row was found when one was required" |
| 129 | + ] |
116 | 130 | }
|
117 | 131 | ],
|
118 | 132 | "source": [
|
119 |
| - "my_project = app.get_project(title=\"Heating Repair\")" |
| 133 | + "my_project = app.get_project(title=\"#HeatingRepair\")" |
120 | 134 | ]
|
121 | 135 | },
|
122 | 136 | {
|
|
145 | 159 | },
|
146 | 160 | {
|
147 | 161 | "cell_type": "code",
|
148 |
| - "execution_count": 5, |
| 162 | + "execution_count": null, |
149 | 163 | "id": "70b0dd5b-e749-4864-a951-0ca3a21b00af",
|
150 | 164 | "metadata": {},
|
151 | 165 | "outputs": [],
|
|
193 | 207 | },
|
194 | 208 | {
|
195 | 209 | "cell_type": "code",
|
196 |
| - "execution_count": 6, |
| 210 | + "execution_count": null, |
197 | 211 | "id": "690a6ac7-f5cd-494f-bb69-dbd1f0bea5f2",
|
198 | 212 | "metadata": {},
|
199 |
| - "outputs": [ |
200 |
| - { |
201 |
| - "name": "stderr", |
202 |
| - "output_type": "stream", |
203 |
| - "text": [ |
204 |
| - "/Users/cls/miniforge3/envs/tuttle/lib/python3.9/site-packages/sqlmodel/orm/session.py:101: SAWarning: Dialect sqlite+pysqlite does *not* support Decimal objects natively, and SQLAlchemy must convert from floating point - rounding errors and other issues may occur. Please consider storing Decimal numbers as strings or integers on this platform for lossless storage.\n", |
205 |
| - " return super().execute( # type: ignore\n" |
206 |
| - ] |
207 |
| - } |
208 |
| - ], |
| 213 | + "outputs": [], |
209 | 214 | "source": [
|
210 | 215 | "my_timesheet = tuttle.timetracking.generate_timesheet(\n",
|
211 | 216 | " source=my_calendar,\n",
|
|
233 | 238 | },
|
234 | 239 | {
|
235 | 240 | "cell_type": "code",
|
236 |
| - "execution_count": 7, |
| 241 | + "execution_count": null, |
237 | 242 | "id": "3bbb30ec-e5dd-4383-960f-5043f947774b",
|
238 | 243 | "metadata": {},
|
239 | 244 | "outputs": [],
|
|
249 | 254 | },
|
250 | 255 | {
|
251 | 256 | "cell_type": "code",
|
252 |
| - "execution_count": 8, |
| 257 | + "execution_count": null, |
253 | 258 | "id": "5eeb012a-ea3b-4502-a968-31faad9422f2",
|
254 | 259 | "metadata": {},
|
255 |
| - "outputs": [ |
256 |
| - { |
257 |
| - "data": { |
258 |
| - "text/plain": [ |
259 |
| - "'2022-02-23-01'" |
260 |
| - ] |
261 |
| - }, |
262 |
| - "execution_count": 8, |
263 |
| - "metadata": {}, |
264 |
| - "output_type": "execute_result" |
265 |
| - } |
266 |
| - ], |
| 260 | + "outputs": [], |
267 | 261 | "source": [
|
268 | 262 | "my_invoice.number"
|
269 | 263 | ]
|
270 | 264 | },
|
271 | 265 | {
|
272 | 266 | "cell_type": "code",
|
273 |
| - "execution_count": 9, |
| 267 | + "execution_count": null, |
274 | 268 | "id": "d630bf01-3e04-444c-9cdb-8848ba591a7b",
|
275 | 269 | "metadata": {},
|
276 |
| - "outputs": [ |
277 |
| - { |
278 |
| - "data": { |
279 |
| - "text/plain": [ |
280 |
| - "Decimal('952.000000000000')" |
281 |
| - ] |
282 |
| - }, |
283 |
| - "execution_count": 9, |
284 |
| - "metadata": {}, |
285 |
| - "output_type": "execute_result" |
286 |
| - } |
287 |
| - ], |
| 270 | + "outputs": [], |
288 | 271 | "source": [
|
289 | 272 | "my_invoice.total"
|
290 | 273 | ]
|
|
323 | 306 | },
|
324 | 307 | {
|
325 | 308 | "cell_type": "code",
|
326 |
| - "execution_count": 10, |
| 309 | + "execution_count": null, |
327 | 310 | "id": "a786c042-0602-4313-9dd8-3ea2cf6c6f1c",
|
328 | 311 | "metadata": {},
|
329 |
| - "outputs": [ |
330 |
| - { |
331 |
| - "data": { |
332 |
| - "text/html": [ |
333 |
| - "<!doctype html>\n", |
334 |
| - "<html class=\"no-js\" lang=\"\">\n", |
335 |
| - "\n", |
336 |
| - "<head>\n", |
337 |
| - " <meta charset=\"utf-8\">\n", |
338 |
| - " <title>Invoice No. 2022-02-23-01</title>\n", |
339 |
| - " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n", |
340 |
| - "\n", |
341 |
| - " \n", |
342 |
| - " <!-- pure HTML -->\n", |
343 |
| - " \n", |
344 |
| - "</head>\n", |
345 |
| - "<body>\n", |
346 |
| - "\n", |
347 |
| - "<div class=\"web-container\">\n", |
348 |
| - "\n", |
349 |
| - " <div class=\"page-container\">\n", |
350 |
| - " <span class=\"page\"></span>\n", |
351 |
| - " <span class=\"pages\"></span>\n", |
352 |
| - " </div>\n", |
353 |
| - "\n", |
354 |
| - " \n", |
355 |
| - "\n", |
356 |
| - "\n", |
357 |
| - " <table class=\"invoice-info-container\">\n", |
358 |
| - " <tr>\n", |
359 |
| - " <td rowspan=\"2\" class=\"client-name\">\n", |
360 |
| - " Sam Lowry<br>\n", |
361 |
| - " \n", |
362 |
| - "Main Street 9999<br>\n", |
363 |
| - "55555 Sao Paolo<br>\n", |
364 |
| - "Brazil\n", |
365 |
| - "\n", |
366 |
| - " </td>\n", |
367 |
| - " <td>\n", |
368 |
| - " Harry Tuttle<br>\n", |
369 |
| - " \n", |
370 |
| - "Main Street 450<br>\n", |
371 |
| - "555555 Sao Paolo<br>\n", |
372 |
| - "Brazil\n", |
373 |
| - "\n", |
374 |
| - " </td>\n", |
375 |
| - " </tr>\n", |
376 |
| - " <tr>\n", |
377 |
| - " <td>\n", |
378 |
| - "\n", |
379 |
| - " </td>\n", |
380 |
| - " </tr>\n", |
381 |
| - " <tr>\n", |
382 |
| - " <td>\n", |
383 |
| - "\n", |
384 |
| - " </td>\n", |
385 |
| - " <td>\n", |
386 |
| - "\n", |
387 |
| - " </td>\n", |
388 |
| - " </tr>\n", |
389 |
| - " <tr>\n", |
390 |
| - " <td>\n", |
391 |
| - " Invoice Date: <strong>2022-02-23</strong><br>\n", |
392 |
| - " Invoice Number: <strong>2022-02-23-01</strong>\n", |
393 |
| - " </td>\n", |
394 |
| - " <td>\n", |
395 |
| - " </td>\n", |
396 |
| - " </tr>\n", |
397 |
| - " </table>\n", |
398 |
| - "\n", |
399 |
| - "\n", |
400 |
| - " <table class=\"line-items-container\">\n", |
401 |
| - " <thead>\n", |
402 |
| - " <tr>\n", |
403 |
| - " <th class=\"heading-description\">Date</th>\n", |
404 |
| - " <th class=\"heading-description\">Description</th>\n", |
405 |
| - " <th class=\"heading-quantity\">Qty</th>\n", |
406 |
| - " <th class=\"heading-quantity\">Unit</th>\n", |
407 |
| - " <th class=\"heading-price\">Unit Price</th>\n", |
408 |
| - " <th class=\"heading-price\">VAT%</th>\n", |
409 |
| - " <th class=\"heading-subtotal\">Subtotal</th>\n", |
410 |
| - " </tr>\n", |
411 |
| - " </thead>\n", |
412 |
| - " <tbody>\n", |
413 |
| - " \n", |
414 |
| - " <tr>\n", |
415 |
| - " <td>2022-02-23</td>\n", |
416 |
| - " <td>Heating Repair - February 2022</td>\n", |
417 |
| - " <td class=\"right\">16</td>\n", |
418 |
| - " <td class=\"right\">hour</td>\n", |
419 |
| - " <td class=\"right\">€50.00 €</td>\n", |
420 |
| - " <td class=\"right\">19.00 %</td>\n", |
421 |
| - " <td class=\"right\">€800.00</td>\n", |
422 |
| - " </tr>\n", |
423 |
| - " \n", |
424 |
| - " </tbody>\n", |
425 |
| - " </table>\n", |
426 |
| - "\n", |
427 |
| - "\n", |
428 |
| - " <table class=\"line-items-container has-bottom-border\">\n", |
429 |
| - " <thead>\n", |
430 |
| - " <tr>\n", |
431 |
| - " <th>Payment Info</th>\n", |
432 |
| - " <th>Due By</th>\n", |
433 |
| - " <th>Total VAT</th>\n", |
434 |
| - " <th>Total Due</th>\n", |
435 |
| - " </tr>\n", |
436 |
| - " </thead>\n", |
437 |
| - " <tbody>\n", |
438 |
| - " <tr>\n", |
439 |
| - " <td class=\"payment-info\">\n", |
440 |
| - " <div>\n", |
441 |
| - " Account No: <strong>BZ99830994950003161565</strong>\n", |
442 |
| - " </div>\n", |
443 |
| - " </td>\n", |
444 |
| - " <td class=\"bold\">2022-03-09</td>\n", |
445 |
| - " <td>€152.00</td>\n", |
446 |
| - " <td class=\"bold\">€952.00</td>\n", |
447 |
| - " </tr>\n", |
448 |
| - " </tbody>\n", |
449 |
| - " </table>\n", |
450 |
| - "\n", |
451 |
| - " <div class=\"footer\">\n", |
452 |
| - " <div class=\"footer-info\">\n", |
453 |
| - " <span></span> |\n", |
454 |
| - " <span>+55555555555</span> |\n", |
455 |
| - " <span>https://tuttle-dev.github.io/tuttle/</span>\n", |
456 |
| - " </div>\n", |
457 |
| - " <div class=\"footer-thanks\">\n", |
458 |
| - " <span>Thank you!</span>\n", |
459 |
| - " </div>\n", |
460 |
| - " </div>\n", |
461 |
| - "\n", |
462 |
| - "\n", |
463 |
| - "</div>\n", |
464 |
| - "\n", |
465 |
| - "\n", |
466 |
| - "</body>\n", |
467 |
| - "</html>" |
468 |
| - ], |
469 |
| - "text/plain": [ |
470 |
| - "<IPython.core.display.HTML object>" |
471 |
| - ] |
472 |
| - }, |
473 |
| - "execution_count": 10, |
474 |
| - "metadata": {}, |
475 |
| - "output_type": "execute_result" |
476 |
| - } |
477 |
| - ], |
| 312 | + "outputs": [], |
478 | 313 | "source": [
|
479 | 314 | "display.HTML(\n",
|
480 | 315 | " tuttle.rendering.render_invoice(\n",
|
|
507 | 342 | },
|
508 | 343 | {
|
509 | 344 | "cell_type": "code",
|
510 |
| - "execution_count": 11, |
| 345 | + "execution_count": null, |
511 | 346 | "id": "f87c6347-8664-483b-9e2f-f5d61f1772ae",
|
512 | 347 | "metadata": {},
|
513 | 348 | "outputs": [],
|
|
517 | 352 | },
|
518 | 353 | {
|
519 | 354 | "cell_type": "code",
|
520 |
| - "execution_count": 12, |
| 355 | + "execution_count": null, |
521 | 356 | "id": "3e6d9815-e474-4f3a-b6df-e803c3cc5bfd",
|
522 | 357 | "metadata": {},
|
523 | 358 | "outputs": [],
|
|
540 | 375 | },
|
541 | 376 | {
|
542 | 377 | "cell_type": "code",
|
543 |
| - "execution_count": 13, |
| 378 | + "execution_count": null, |
544 | 379 | "id": "f7c0a6c9-5a7a-4b3a-9d2f-de0671fac734",
|
545 | 380 | "metadata": {},
|
546 | 381 | "outputs": [],
|
|
574 | 409 | },
|
575 | 410 | {
|
576 | 411 | "cell_type": "code",
|
577 |
| - "execution_count": 14, |
| 412 | + "execution_count": null, |
578 | 413 | "id": "4eeb3a78-64ab-4ebf-b69d-6c5b99285b7b",
|
579 | 414 | "metadata": {},
|
580 | 415 | "outputs": [],
|
|
0 commit comments