Do not render empty fields
Hello guys, I'm learning django and I have some doubts, I suppose that from now on you'll see me a lot here because my doubts are endless :). I'm doing a simple recipe app, and some recipes have more ingredients than others and when I render them, empty fields take up space in the rendered HTML. I show you how the HTML is. I also include the repo in github. https://github.com/barkalez/recetas [image: Duda1.png] -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2c9c280f-0ae2-4e2d-b9d1-3de7e95369df%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Link does not work correctly
In the browser, when I'm in "http://127.0.0.1:8000/"; and click in register it takes me to "http://127.0.0.1:8000/register"; and it works correctly, but if I'm in "http: //127.0.0.1:8000/about/ "and click on register takes me to" http://127.0.0.1:8000/about/register/ "instead of" http://127.0.0.1:8000/register " . My project : https://github.com/barkalez/recetas -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f77b7e65-3e0c-4f29-b951-d052e669fe20%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Link does not work correctly
Hi You can see my code in: https://github.com/barkalez/recetas I have it like this: Register El domingo, 10 de marzo de 2019, 18:22:29 (UTC+1), Gil Obradors escribió: > > Hi > I can't give you the exactly response, > > But I know that you are playing with href=url direct, without using django > template code > I suggest you to change de href of register from about, to a href with > django template code: > Something like : href="{% static 'greenfapp/main.css' %} > But I can't see at urls.py from user app, so I don't know if user apps > register view has any name associociated to > > You must write something like href="{ url :'recetas-home' % } ( nor > direct url) > > > Good luck > > > Missatge de Barkalez XX > del dia dg., 10 > de març 2019 a les 15:28: > >> >> In the browser, when I'm in "http://127.0.0.1:8000/"; and click in >> register it takes me to "http://127.0.0.1:8000/register"; and it works >> correctly, but if I'm in "http: //127.0.0.1:8000/about/ "and click on >> register takes me to" http://127.0.0.1:8000/about/register/ "instead of" >> http://127.0.0.1:8000/register " . My project : >> https://github.com/barkalez/recetas >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-users...@googlegroups.com . >> To post to this group, send email to django...@googlegroups.com >> . >> Visit this group at https://groups.google.com/group/django-users. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/f77b7e65-3e0c-4f29-b951-d052e669fe20%40googlegroups.com >> >> <https://groups.google.com/d/msgid/django-users/f77b7e65-3e0c-4f29-b951-d052e669fe20%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/10a468fd-e48a-480a-9404-4f0bca6cc0f2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Doubt in the creation of fields in the FrontEnd
I would like to know if it is possible to create a new field in a table from the FrontEnd. For example, in a form to create recipes, not all recipes contain the same number of ingredients. At first I thought about putting a high number of ingredients to enter in the form to create a recipe, but that's not pretty. I think it would be better for the user to add fields in the form as needed. Although thinking well, if that were done, who would execute the command makemigrations and migrate ?, it occurred to me to create a high number of fields for the ingredients but that did not appear in the FrontEnd form and that they were appearing as needed by the user. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c416f450-0172-45e2-9242-4704c4aca421%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Doubt in the creation of fields in the FrontEnd
Thank for you answer. I did not know that fields could be generated in the database from FrontEnd. It occurs to me to put a "Add ingredient" button and produce a new field in the recipe table, but I do not know how to do that. El sábado, 23 de marzo de 2019, 17:54:24 (UTC+1), Aldian Fazrihady escribió: > > Hi, > > I don't think that's a good idea to frequently add new field to a database > table. > > A field in form doesn't mean that it will also be a field of a table > database. > You can make a new ingredient field in a form to become a new row of a > database table. > You just need to properly design your database schema. > > Regards, > > Aldian Fazrihady > > On Sun, Mar 24, 2019 at 12:46 AM Barkalez XX > wrote: > >> >> I would like to know if it is possible to create a new field in a table >> from the FrontEnd. For example, in a form to create recipes, not all >> recipes contain the same number of ingredients. At first I thought about >> putting a high number of ingredients to enter in the form to create a >> recipe, but that's not pretty. I think it would be better for the user to >> add fields in the form as needed. Although thinking well, if that were >> done, who would execute the command makemigrations and migrate ?, it >> occurred to me to create a high number of fields for the ingredients but >> that did not appear in the FrontEnd form and that they were appearing as >> needed by the user. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-users...@googlegroups.com . >> To post to this group, send email to django...@googlegroups.com >> . >> Visit this group at https://groups.google.com/group/django-users. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/c416f450-0172-45e2-9242-4704c4aca421%40googlegroups.com >> >> <https://groups.google.com/d/msgid/django-users/c416f450-0172-45e2-9242-4704c4aca421%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0c94870c-b8df-40eb-89ff-b54565fe4070%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Doubt in the creation of fields in the FrontEnd
Then it occurs to me to create a table called List Ingredients and relate it to the recipe. El sábado, 23 de marzo de 2019, 19:16:47 (UTC+1), Aldian Fazrihady escribió: > > > Hi, > > Generating fields is possible, > > but for your recipe app, that's absolutely not a good thing to do. > > Regards, > > Aldian Fazrihady > > On Sun, Mar 24, 2019 at 1:54 AM Barkalez XX > wrote: > >> Thank for you answer. >> >> >> I did not know that fields could be generated in the database from >> FrontEnd. >> >> It occurs to me to put a "Add ingredient" button and produce a new field >> in the recipe table, but I do not know how to do that. >> >> El sábado, 23 de marzo de 2019, 17:54:24 (UTC+1), Aldian Fazrihady >> escribió: >>> >>> Hi, >>> >>> I don't think that's a good idea to frequently add new field to a >>> database table. >>> >>> A field in form doesn't mean that it will also be a field of a table >>> database. >>> You can make a new ingredient field in a form to become a new row of a >>> database table. >>> You just need to properly design your database schema. >>> >>> Regards, >>> >>> Aldian Fazrihady >>> >>> On Sun, Mar 24, 2019 at 12:46 AM Barkalez XX wrote: >>> >>>> >>>> I would like to know if it is possible to create a new field in a table >>>> from the FrontEnd. For example, in a form to create recipes, not all >>>> recipes contain the same number of ingredients. At first I thought about >>>> putting a high number of ingredients to enter in the form to create a >>>> recipe, but that's not pretty. I think it would be better for the user to >>>> add fields in the form as needed. Although thinking well, if that were >>>> done, who would execute the command makemigrations and migrate ?, it >>>> occurred to me to create a high number of fields for the ingredients but >>>> that did not appear in the FrontEnd form and that they were appearing as >>>> needed by the user. >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Django users" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to django-users...@googlegroups.com. >>>> To post to this group, send email to django...@googlegroups.com. >>>> Visit this group at https://groups.google.com/group/django-users. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/django-users/c416f450-0172-45e2-9242-4704c4aca421%40googlegroups.com >>>> >>>> <https://groups.google.com/d/msgid/django-users/c416f450-0172-45e2-9242-4704c4aca421%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-users...@googlegroups.com . >> To post to this group, send email to django...@googlegroups.com >> . >> Visit this group at https://groups.google.com/group/django-users. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/0c94870c-b8df-40eb-89ff-b54565fe4070%40googlegroups.com >> >> <https://groups.google.com/d/msgid/django-users/0c94870c-b8df-40eb-89ff-b54565fe4070%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/057a0841-c9a4-44fb-8341-1592863bffd4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
In the browser it looks ugly, why?
Why does this happen to me? https://pasteboard.co/I8VU79E.png html:https://dpaste.de/AVti views.py:https://dpaste.de/44Jz models.py: https://dpaste.de/Dfwy I want to list all the ingredients in that recipe and make it look beautiful. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/07ff0403-914f-46ae-a418-6c42a9de8ac2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.