From 79d9486f9decc9b88b580010040a836a20e2aa7f Mon Sep 17 00:00:00 2001 From: Celestino Rey Date: Fri, 30 Aug 2024 10:53:26 +0200 Subject: [PATCH] Quito calculation y algun print --- RepostajesDj/K8S/vehiculos.sql | 113 +++++++++++++++++++ RepostajesDj/vehiculos/entornoPruebas.sh | 1 + RepostajesDj/vehiculos/migra.txt | 107 ++++++++++++++++++ RepostajesDj/vehiculos/repostajes/views.py | 4 - RepostajesDj/vehiculos/vehiculos/settings.py | 1 - 5 files changed, 221 insertions(+), 5 deletions(-) create mode 100644 RepostajesDj/K8S/vehiculos.sql create mode 100644 RepostajesDj/vehiculos/migra.txt diff --git a/RepostajesDj/K8S/vehiculos.sql b/RepostajesDj/K8S/vehiculos.sql new file mode 100644 index 0000000..3ba493a --- /dev/null +++ b/RepostajesDj/K8S/vehiculos.sql @@ -0,0 +1,113 @@ +-- +-- Data for Name: repostajes_repostaje; Type: TABLE DATA; Schema: public; Owner: creylopez +-- + +COPY public.repostajes_repostaje (id, fecha, kms, litros, descuento, importe, precioxlitro, kmsrecorridos, consumo, vehiculo_id) FROM stdin; +16 2021-12-14 52731 0.00 0.00 0.00 0.00 52731 0.00 5 +17 2021-12-23 53162 52.80 0.00 67.32 1.28 431 12.25 5 +18 2021-12-31 54122 49.99 0.00 63.74 1.28 960 5.21 5 +19 2022-01-22 54946 49.14 0.00 62.65 1.27 824 5.96 5 +20 2022-02-09 55908 49.24 0.00 65.24 1.32 962 5.12 5 +21 2022-03-03 56909 48.61 0.00 67.03 1.38 1001 4.86 5 +22 2022-03-18 57542 30.06 0.00 52.54 1.75 633 4.75 5 +23 2022-04-10 58497 46.63 0.00 69.98 1.50 955 4.88 5 +24 2022-05-12 59447 47.14 0.00 72.11 1.53 950 4.96 5 +25 2022-05-19 60414 48.57 0.00 79.81 1.64 967 5.02 5 +26 2022-06-09 61147 36.20 0.00 62.12 1.72 733 4.94 5 +27 2022-06-25 62116 49.17 0.00 90.29 1.84 969 5.07 5 +28 2022-09-14 66359 53.24 0.00 84.83 1.59 1174 4.53 5 +29 2022-09-23 67107 37.26 0.00 55.48 1.49 748 4.98 5 +30 2023-01-24 71790 43.04 2.12 70.54 1.59 871 4.94 5 +31 2022-12-03 70061 46.38 2.04 68.13 1.42 903 5.14 5 +32 2022-12-26 70919 44.58 1.85 61.68 1.34 858 5.20 5 +33 2023-03-05 73711 47.85 0.00 71.20 1.49 948 5.05 5 +34 2023-03-25 74749 49.84 0.00 72.17 1.45 1038 4.80 5 +35 2023-02-19 72763 49.38 2.34 77.97 1.53 973 5.08 5 +36 2023-05-06 76434 32.28 0.00 44.09 1.37 1685 1.92 5 +37 2023-05-22 77366 45.04 0.00 58.46 1.30 932 4.83 5 +38 2022-07-09 63129 47.03 0.00 79.38 1.69 1013 4.64 5 +39 2022-08-12 64088 43.73 0.00 65.55 1.50 959 4.56 5 +40 2022-08-22 65185 52.78 0.00 78.80 1.49 1097 4.81 5 +41 2022-10-12 68204 52.04 2.51 83.73 1.56 1097 4.74 5 +42 2022-11-11 69158 45.28 2.37 78.91 1.69 954 4.75 5 +43 2023-06-10 78170 41.09 0.00 54.16 1.32 804 5.11 5 +44 2023-06-19 79038 40.78 1.95 60.11 1.43 868 4.70 5 +45 2022-06-28 219 9.88 0.00 18.96 1.92 219 4.51 4 +46 2022-06-28 236 27.36 0.00 51.33 1.88 17 160.94 4 +47 2022-07-14 904 32.24 0.00 55.58 1.72 668 4.83 4 +48 2022-07-26 1433 30.49 0.00 48.43 1.59 529 5.76 4 +49 2022-08-21 2030 32.92 0.00 46.72 1.42 597 5.51 4 +50 2022-09-26 2627 23.92 0.00 33.16 1.39 597 4.01 4 +51 2022-10-18 3169 22.97 0.00 32.74 1.43 542 4.24 4 +52 2022-11-09 3791 29.60 0.00 41.88 1.41 622 4.76 4 +53 2022-11-27 4363 28.80 1.20 38.80 1.35 572 5.03 4 +54 2022-12-22 4851 26.74 1.06 34.18 1.28 488 5.48 4 +55 2023-01-12 5291 23.52 1.09 35.34 1.50 440 5.35 4 +56 2023-02-01 5702 27.36 1.28 41.52 1.52 411 6.66 4 +57 2023-02-20 6141 24.09 1.13 36.67 1.52 439 5.49 4 +58 2023-03-15 6631 25.52 1.21 38.96 1.53 490 5.21 4 +59 2023-04-17 7325 29.40 1.47 47.62 1.62 694 4.24 4 +60 2023-05-28 8413 24.16 1.17 37.70 1.56 1088 2.22 4 +61 2023-06-25 8956 26.38 1.30 41.94 1.59 543 4.86 4 +62 2023-07-10 9471 29.04 1.35 43.49 1.50 515 5.64 4 +63 2023-07-14 79875 40.56 1.74 56.26 1.41 837 4.85 5 +64 2023-07-22 80806 46.29 1.95 63.05 1.37 931 4.97 5 +65 2023-07-25 10043 24.85 1.40 40.32 1.62 572 4.34 4 +66 2023-08-07 81695 44.39 0.00 63.88 1.44 889 4.99 5 +67 2023-08-09 10582 26.49 1.39 44.94 1.70 539 4.91 4 +68 2023-08-23 11050 24.05 1.22 39.40 1.64 468 5.14 4 +69 2023-08-27 82715 50.40 0.00 77.06 1.53 1020 4.94 5 +70 2023-09-14 11508 21.44 1.14 37.00 1.73 458 4.68 4 +71 2023-09-19 83709 48.35 0.00 77.26 1.60 994 4.86 5 +72 2023-09-27 84171 23.01 0.00 35.85 1.56 462 4.98 5 +73 2023-10-10 85104 48.00 0.00 72.43 1.51 933 5.14 5 +74 2023-10-15 12006 25.09 1.25 40.37 1.61 498 5.04 4 +75 2023-10-27 86021 46.77 0.00 70.11 1.50 917 5.10 5 +76 2023-11-04 12427 25.64 1.17 37.78 1.47 421 6.09 4 +77 2023-11-11 86757 39.58 1.71 55.33 1.40 736 5.38 5 +78 2023-11-20 12933 26.16 0.00 40.00 1.53 506 5.17 4 +79 2023-11-23 87503 42.41 1.75 56.45 1.33 746 5.68 5 +80 2023-12-04 88256 41.19 0.00 57.62 1.40 753 5.47 5 +81 2023-12-17 88964 41.20 1.66 53.78 1.31 708 5.82 5 +82 2024-01-06 13414 30.72 1.34 43.36 1.41 481 6.39 4 +83 2024-01-07 89802 47.77 1.91 61.75 1.29 838 5.70 5 +84 2024-01-22 13903 25.08 0.00 37.09 1.48 489 5.13 4 +85 2024-01-27 90723 45.25 0.00 60.37 1.33 921 4.91 5 +86 2024-02-11 14365 28.45 0.00 41.37 1.45 462 6.16 4 +87 2024-02-12 91672 48.31 0.00 70.00 1.45 949 5.09 5 +88 2024-02-27 92489 41.99 0.00 57.91 1.38 817 5.14 5 +89 2024-02-29 14857 23.96 1.12 36.35 1.52 492 4.87 4 +90 2024-03-18 15287 13.00 0.00 20.00 1.54 430 3.02 4 +91 2024-03-19 93327 43.85 0.00 60.25 1.37 838 5.23 5 +92 2024-03-25 15537 19.24 0.00 30.00 1.56 250 7.70 4 +93 2024-04-06 15935 29.39 0.00 43.47 1.48 398 7.38 4 +94 2024-04-08 94167 41.11 0.00 56.49 1.37 840 4.89 5 +95 2024-04-22 16465 25.92 0.00 40.66 1.57 530 4.89 4 +96 2024-04-29 95042 43.63 0.00 63.03 1.45 875 4.99 5 +97 2024-05-13 16963 26.80 0.00 41.51 1.55 498 5.38 4 +98 2024-05-21 96585 28.33 0.00 39.63 1.40 572 4.95 5 +99 2024-05-27 97597 49.48 0.00 67.96 1.37 1012 4.89 5 +100 2024-05-06 96013 50.59 0.00 73.32 1.45 971 5.21 5 +101 2024-06-03 98067 23.97 0.00 32.69 1.36 470 5.10 5 +102 2024-06-08 98609 28.28 1.25 40.44 1.43 542 5.22 5 +103 2024-06-10 17494 26.72 0.00 39.92 1.49 531 5.03 4 +104 2024-06-17 99166 26.91 0.00 36.43 1.35 557 4.83 5 +105 2024-06-26 17879 18.91 0.00 28.44 1.50 385 4.91 4 +106 2024-06-30 100048 44.39 0.00 61.57 1.39 882 5.03 5 +107 2024-07-10 18397 25.42 0.00 38.49 1.51 518 4.91 4 +108 2024-07-21 18944 27.71 0.00 40.29 1.45 547 5.07 4 +109 2024-07-23 101010 45.25 0.00 60.52 1.34 962 4.70 5 +110 2024-08-09 19596 32.19 0.00 43.58 1.35 652 4.94 4 +111 2024-08-12 101710 30.69 0.00 39.10 1.27 700 4.38 5 +112 2024-08-25 20185 29.08 0.00 38.07 1.31 589 4.94 4 +\. + + +-- +-- Data for Name: repostajes_vehiculo; Type: TABLE DATA; Schema: public; Owner: creylopez +-- + +COPY public.repostajes_vehiculo (id, marca, modelo, matricula, foto) FROM stdin; +4 Toyota Corolla 7630LYR vehiculos/corolla-active-rojo-0675lrb-1-_Um20SC3.jpg +5 BMW 318d 1018KPD vehiculos/bmw_Y8htLud.png +\. diff --git a/RepostajesDj/vehiculos/entornoPruebas.sh b/RepostajesDj/vehiculos/entornoPruebas.sh index 0e56b74..0d6d9e6 100644 --- a/RepostajesDj/vehiculos/entornoPruebas.sh +++ b/RepostajesDj/vehiculos/entornoPruebas.sh @@ -1,5 +1,6 @@ export CSRF_TRUSTED_ORIGINS="localhost" export DEBUG=1 +export SECRET_KEY="hola" export DJANGO_ALLOWED_HOSTS="localhost" diff --git a/RepostajesDj/vehiculos/migra.txt b/RepostajesDj/vehiculos/migra.txt new file mode 100644 index 0000000..77065b0 --- /dev/null +++ b/RepostajesDj/vehiculos/migra.txt @@ -0,0 +1,107 @@ +listado = [('2021-12-14',52731,0,0,0,0,2,52731,0), +('2021-12-23',53162,52.799999999999997156,0,1.2800000000000000266,67.319999999999993178,2,431,12.250580046403712231), +('2021-12-31',54122,49.99000000000000199,0,1.2800000000000000266,63.74000000000000199,2,960,5.2072916666666664298), +('2022-01-22',54946,49.140000000000000567,0,1.2700000000000000177,62.64999999999999858,2,824,5.963592233009708643), +('2022-02-09',55908,49.240000000000001987,0,1.3200000000000000621,65.239999999999994883,2,962,5.1185031185031188982), +('2022-03-03',56909,48.609999999999999433,0,1.3799999999999998934,67.030000000000001135,2,1001,4.8561438561438565741), +('2022-03-18',57542,30.059999999999998721,0,1.75,52.539999999999999146,2,633,4.7488151658767776552), +('2022-04-10',58497,46.630000000000002557,0,1.5,69.98000000000000398,2,955,4.8827225130890052895), +('2022-05-12',59447,47.140000000000000569,0,1.5300000000000000266,72.109999999999999432,2,950,4.9621052631578947966), +('2022-05-19',60414,48.570000000000000282,0,1.6399999999999999023,79.810000000000002272,2,967,5.0227507755946225742), +('2022-06-09',61147,36.200000000000002841,0,1.7199999999999999733,62.119999999999997442,2,733,4.9386084583901777023), +('2022-06-25',62116,49.170000000000001704,0,1.8400000000000000799,90.290000000000006251,2,969,5.0743034055727553877), +('2022-09-14',66359,53.240000000000001988,0,1.5900000000000000799,84.829999999999998296,2,1174,4.5349233390119252362), +('2022-09-23',67107,37.25999999999999801,0,1.4899999999999999911,55.479999999999996874,2,748,4.9812834224598931953), +('2023-01-24',71790,43.039999999999999148,2.1200000000000001065,1.5900000000000000799,70.540000000000006251,2,871,4.9414466130884040495), +('2022-12-03',70061,46.380000000000002557,2.0400000000000000355,1.4199999999999999289,68.12999999999999545,2,903,5.136212624584717723), +('2022-12-26',70919,44.579999999999998295,1.8500000000000000888,1.3400000000000000799,61.679999999999999714,2,858,5.1958041958041958352), +('2023-03-05',73711,47.850000000000001421,0,1.4899999999999999911,71.200000000000002843,2,948,5.0474683544303795557), +('2023-03-25',74749,49.840000000000003409,0,1.4499999999999999555,72.170000000000001706,2,1038,4.8015414258188826579), +('2023-02-19',72763,49.380000000000002558,2.3399999999999998578,1.5300000000000000266,77.969999999999998864,2,973,5.0750256937307298699), +('2023-05-06',76434,32.280000000000001136,0,1.3700000000000001065,44.090000000000003411,2,1685,1.9157270029673589828), +('2023-05-22',77366,45.039999999999999146,0,1.3000000000000000444,58.460000000000000852,2,932,4.832618025751073354), +('2022-07-09',63129,47.030000000000001135,0,1.6899999999999999467,79.37999999999999545,2,1013,4.6426456071076014353), +('2022-08-12',64088,43.729999999999996872,0,1.5,65.549999999999997157,2,959,4.5599582898852970558), +('2022-08-22',65185,52.780000000000001137,0,1.4899999999999999911,78.799999999999997156,2,1097,4.8113035551504106379), +('2022-10-12',68204,52.039999999999999149,2.5099999999999997868,1.5600000000000000532,83.73000000000000398,2,1097,4.7438468550592522987), +('2022-11-11',69158,45.280000000000001137,2.3700000000000001065,1.6899999999999999467,78.90999999999999659,2,954,4.7463312368972747634), +('2023-06-10',78170,41.090000000000003409,0,1.3200000000000000621,54.159999999999996591,2,804,5.1106965174129355133), +('2023-06-19',79038,40.780000000000001135,1.9499999999999999555,1.4299999999999999378,60.109999999999999429,2,868,4.6981566820276494667), +('2022-06-28',219,9.8800000000000007815,0,1.9199999999999999289,18.960000000000000852,1,219,4.5114155251141561109), +('2022-06-28',236,27.359999999999999431,0,1.8799999999999998934,51.329999999999998292,1,17,160.94117647058823195), +('2022-07-14',904,32.240000000000001989,0,1.7199999999999999733,55.579999999999998294,1,668,4.8263473053892216313), +('2022-07-26',1433,30.489999999999998435,0,1.5900000000000000799,48.429999999999999715,1,529,5.7637051039697544396), +('2022-08-21',2030,32.920000000000001704,0,1.4199999999999999289,46.719999999999998864,1,597,5.5142378559463987031), +('2022-09-26',2627,23.920000000000001705,0,1.3899999999999999023,33.159999999999996589,1,597,4.0067001675041877817), +('2022-10-18',3169,22.969999999999998862,0,1.4299999999999999378,32.740000000000001989,1,542,4.2380073800738005118), +('2022-11-09',3791,29.600000000000001421,0,1.40999999999999992,41.880000000000002558,1,622,4.7588424437299039482), +('2022-11-27',4363,28.80000000000000071,1.1999999999999999555,1.3500000000000000888,38.799999999999997157,1,572,5.0349650349650350023), +('2022-12-22',4851,26.739999999999998435,1.0600000000000000532,1.2800000000000000266,34.179999999999999716,1,488,5.4795081967213112861), +('2023-01-12',5291,23.519999999999999574,1.0900000000000000799,1.5,35.340000000000003411,1,440,5.3454545454545456806), +('2023-02-01',5702,27.359999999999999431,1.2800000000000000266,1.5200000000000000177,41.520000000000003128,1,411,6.6569343065693429295), +('2023-02-20',6141,24.089999999999999857,1.1299999999999998934,1.5200000000000000177,36.670000000000001704,1,439,5.4874715261958995071), +('2023-03-15',6631,25.519999999999999572,1.2099999999999999644,1.5300000000000000266,38.960000000000000852,1,490,5.2081632653061227244), +('2023-04-17',7325,29.399999999999998578,1.4699999999999999733,1.6200000000000001065,47.619999999999997443,1,694,4.2363112391930837219), +('2023-05-28',8413,24.160000000000000142,1.1699999999999999289,1.5600000000000000532,37.700000000000002842,1,1088,2.2205882352941177515), +('2023-06-25',8956,26.379999999999999005,1.3000000000000000444,1.5900000000000000799,41.939999999999997724,1,543,4.8581952117863718143), +('2023-07-10',9471,29.039999999999999147,1.3500000000000000888,1.4970000000000001083,43.490000000000001989,1,515,5.638834951456310307), +('2023-07-14',79875,40.560000000000002275,1.7399999999999999911,1.4070000000000000284,56.259999999999998009,2,837,4.8458781362007172788), +('2023-07-22',80806,46.289999999999999146,1.9499999999999999555,1.3709999999999999964,63.049999999999997157,2,931,4.9720730397422130408), +('2023-07-25',10043,24.850000000000001421,1.3999999999999999111,1.6220000000000001083,40.320000000000000284,1,572,4.3444055944055941509), +('2023-08-07',81695,44.390000000000000568,0,1.4390000000000000568,63.880000000000002557,2,889,4.9932508436445441901), +('2023-08-09',10582,26.489999999999998437,1.3899999999999999023,1.695999999999999952,44.939999999999997726,1,539,4.9146567717996285651), +('2023-08-23',11050,24.05000000000000071,1.2199999999999999733,1.6379999999999999005,39.399999999999998578,1,468,5.1388888888888892836), +('2023-08-27',82715,50.399999999999998577,0,1.5289999999999999147,77.060000000000002272,2,1020,4.9411764705882355031), +('2023-09-14',11508,21.440000000000001278,1.1399999999999999023,1.7259999999999999786,37,1,458,4.681222707423581042), +('2023-09-19',83709,48.350000000000001422,0,1.598000000000000087,77.260000000000005116,2,994,4.8641851106639837354), +('2023-09-27',84171,23.010000000000001563,0,1.5580000000000000515,35.85000000000000142,2,462,4.9805194805194803464), +('2023-10-10',85104,48,0,1.5089999999999998969,72.43000000000000682,2,933,5.1446945337620579863), +('2023-10-15',12006,25.089999999999999858,1.25,1.6089999999999999857,40.36999999999999744,1,498,5.0381526104417666545), +('2023-10-27',86021,46.770000000000003124,0,1.4990000000000001101,70.109999999999999429,2,917,5.1003271537622678621), +('2023-11-04',12427,25.640000000000000568,1.1699999999999999289,1.4739999999999999769,37.780000000000001137,1,421,6.0902612826603323981), +('2023-11-11',86757,39.579999999999998295,1.7099999999999999644,1.3979999999999999094,55.329999999999998293,2,736,5.3777173913043476716), +('2023-11-20',12933,26.160000000000000141,0,1.5289999999999999147,40,1,506,5.1699604743083007463), +('2023-11-23',87503,42.409999999999996589,1.75,1.3309999999999999609,56.45000000000000284,2,746,5.6849865951742630798), +('2023-12-04',88256,41.189999999999997726,0,1.3990000000000000213,57.619999999999997443,2,753,5.47011952191235018), +('2023-12-17',88964,41.200000000000002843,1.65999999999999992,1.3049999999999999378,53.780000000000001136,2,708,5.8192090395480224884), +('2024-01-06',13414,30.719999999999998863,1.3400000000000000799,1.4110000000000000319,43.359999999999999432,1,481,6.3866943866943870489), +('2024-01-07',89802,47.770000000000003128,1.90999999999999992,1.2929999999999999271,61.750000000000000001,2,838,5.7004773269689739123), +('2024-01-22',13903,25.079999999999998295,0,1.4790000000000000923,37.090000000000003411,1,489,5.1288343558282205592), +('2024-01-27',90723,45.25,0,1.3340000000000000746,60.36999999999999744,2,921,4.9131378935939196139), +('2024-02-11',14365,28.449999999999999289,0,1.4539999999999999591,41.369999999999997443,1,462,6.1580086580086579317), +('2024-02-12',91672,48.310000000000002272,0,1.4490000000000000657,70,2,949,5.09062170706006345), +('2024-02-27',92489,41.990000000000001988,0,1.3790000000000000035,57.909999999999996591,2,817,5.1395348837209304804), +('2024-02-29',14857,23.960000000000000852,1.1200000000000001065,1.516999999999999904,36.35000000000000142,1,492,4.8699186991869920504), +('2024-03-18',15287,13,0,1.5380000000000000337,20,1,430,3.0232558139534884134), +('2024-03-19',93327,43.85000000000000142,0,1.3740000000000001101,60.25,2,838,5.2326968973747014501), +('2024-03-25',15537,19.239999999999998436,0,1.5589999999999999413,30,1,250,7.6959999999999988418), +('2024-04-06',15935,29.390000000000000568,0,1.4790000000000000923,43.469999999999998862,1,398,7.3844221105527640958), +('2024-04-08',94167,41.109999999999999433,0,1.3740000000000001101,56.490000000000001991,2,840,4.8940476190476189799), +('2024-04-22',16465,25.920000000000001706,0,1.5689999999999999502,40.659999999999996587,1,530,4.8905660377358488588), +('2024-04-29',95042,43.630000000000002556,0,1.4450000000000000621,63.030000000000001138,2,875,4.9862857142857146541), +('2024-05-13',16963,26.800000000000000709,0,1.5489999999999999324,41.50999999999999801,1,498,5.3815261044176709859), +('2024-05-21',96585,28.329999999999998295,0,1.3990000000000000213,39.630000000000002557,2,572,4.9527972027972024804), +('2024-05-27',97597,49.479999999999996875,0,1.3729999999999999982,67.959999999999993747,2,1012,4.8893280632411064701), +('2024-05-06',96013,50.590000000000003412,0,1.4490000000000000657,73.319999999999993177,2,971,5.210092687950566237), +('2024-06-03',98067,23.969999999999998863,0,1.3640000000000001012,32.689999999999997727,2,470,5.0999999999999996447), +('2024-06-08',98609,28.280000000000001136,1.25,1.4299999999999999378,40.439999999999997727,2,542,5.2177121771217711554), +('2024-06-10',17494,26.719999999999998862,0,1.4939999999999999946,39.920000000000001705,1,531,5.0320150659133711101), +('2024-06-17',99166,26.910000000000000141,0,1.3540000000000000923,36.429999999999999715,2,557,4.8312387791741473463), +('2024-06-26',17879,18.910000000000000142,0,1.5040000000000000035,28.440000000000001278,1,385,4.9116883116883114368), +('2024-06-30',100048,44.390000000000000568,0,1.3870000000000000106,61.570000000000000284,2,882,5.0328798185941039378), +('2024-07-10',18397,25.420000000000001704,0,1.5140000000000000124,38.490000000000001989,1,518,4.907335907335907521), +('2024-07-21',18944,27.710000000000000852,0,1.4539999999999999591,40.289999999999999147,1,547,5.0658135283363803225), +('2024-07-23',101010,45.25,0,1.3369999999999999662,60.520000000000003124,2,962,4.7037422037422036424), +('2024-08-09',19596,32.189999999999997725,0,1.3538365952159057137,43.579999999999998296,1,652,4.9371165644171774999), +('2024-08-12',101710,30.690000000000001278,0,1.2740306288693385994,39.100000000000001421,2,700,4.3842857142857143415), +('2024-08-25',20185,29.079999999999998293,0,1.3091471801925722573,38.070000000000000285,1,589,4.9371816638370118468)] + +for i in listado: + if i[6] == 2: + coche = 5 + else: + coche = 4 + nuevo = Repostaje(vehiculo=Vehiculo.objects.get(pk=coche), fecha=i[0], kms=i[1], litros=i[2], descuento=i[3], precioxlitro=i[4], importe=i[5], kmsrecorridos=i[7], consumo=i[8]) + nuevo.save() + + diff --git a/RepostajesDj/vehiculos/repostajes/views.py b/RepostajesDj/vehiculos/repostajes/views.py index b70e140..ec0e5c5 100644 --- a/RepostajesDj/vehiculos/repostajes/views.py +++ b/RepostajesDj/vehiculos/repostajes/views.py @@ -1,4 +1,3 @@ - # Create your views here. from django.shortcuts import render, get_object_or_404, redirect from django.contrib.auth.decorators import login_required @@ -115,9 +114,6 @@ def nuevo_repostaje(request): instancia.kmsrecorridos = 0 instancia.consumo = 0 - print("nuevo_repostaje: kms litros importe descuento precio recorridos consumo") - print("nuevo_repostaje: ", instancia.kms, instancia.litros, instancia.importe, instancia.descuento, instancia.precioxlitro, instancia.kmsrecorridos, instancia.consumo) - instancia.save() return redirect('lista_repostajes') diff --git a/RepostajesDj/vehiculos/vehiculos/settings.py b/RepostajesDj/vehiculos/vehiculos/settings.py index 639d2ee..ae5dcd2 100644 --- a/RepostajesDj/vehiculos/vehiculos/settings.py +++ b/RepostajesDj/vehiculos/vehiculos/settings.py @@ -41,7 +41,6 @@ INSTALLED_APPS = [ 'repostajes', 'accounts', - 'calculation', ] MIDDLEWARE = [