Re: Specifying model relationship as string vs concrete model?

2019-04-06 Thread Mike Dewhirst
Using the class means you have to import it first. I have stuck to the string version since encountering circular import errors some time ago. Django is smart enough to get it right so I don't even think about it. YMMV Mike Connected by Motorola Mohit Solanki wrote: >Since Django provides

Specifying model relationship as string vs concrete model?

2019-04-06 Thread Mohit Solanki
Since Django provides two ways of specifying model relationship, models.ForeignKey('User') vs models.ForeignKey(User) Which one is more preferred and recommended? Is there any upside or downside of choosing one over the other? In Django documentation, all the example are of the second form

Re: In the browser it looks ugly, why?

2019-04-06 Thread Alex Heyden
Short answer, it's giving you exactly what you asked for: the query set inside tags. What you probably want is to loop through the ingredients and place them inside tags. Something like: {% for ingredient in object.ingredientes.all %} {{ ingredient.cantidad }} {{ ingredient.nombre }} {% endfor

In the browser it looks ugly, why?

2019-04-06 Thread Barkalez XX
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

TypeError unsupported operand type(s) for *: 'NoneType' and 'int'

2019-04-06 Thread omar ahmed
models.py class Club(models.Model): league_names = models.ForeignKey(League, on_delete= models.CASCADE, related_name='club') name = models.CharField(max_length=100) logo = models.ImageField(upload_to='media/core', max_length=255, null=True, blank=True) won = models.IntegerField() draw =

Re: What is the proper workflow before first migration?

2019-04-06 Thread 'dtdave' via Django users
The error you are getting is because the CustomUser is not included in your settings.py Because I use a separte user model my settings.py has this line in it: AUTH_USER_MODEL = 'users.CustomUser' I would recommend that you have your Custom User as a separate user model. For good tutorials on

Regarding password and email field

2019-04-06 Thread Soumen Khatua
How I can display please enter the same password. if both password is different in django inbuilt auth forms. -- 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