Error After Inspect db

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Error After Inspect db

mansi thakkar
Hello , 
Here is the attached files of my output and my error and my models.py file. I have database residing in aws cloud platform. What I have done is I have used inspectdb command and created models using that command. Then have registered my model into admin site and then model has been displayed (Ingredient in my case.) Now it is showing Ingredient object for each and every entry as shown in pic I would like to display master_name instead og ingredient_name. How can I do that? 
Please reply me as soon as possible. 
Thank you.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/d9fe676d-9988-4f59-a97f-fdc5db777e39%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

DjangoError.png (48K) Download Attachment
IngredientError.png (124K) Download Attachment
models.png (124K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Error After Inspect db

Avraham Serour
it seems you wrote def_str_, if should be def (space) then the function name

also the function str should probably be named with double underscores like this: __str__ not _str_

On Tue, Mar 13, 2018 at 5:27 PM, mansi thakkar <[hidden email]> wrote:
Hello , 
Here is the attached files of my output and my error and my models.py file. I have database residing in aws cloud platform. What I have done is I have used inspectdb command and created models using that command. Then have registered my model into admin site and then model has been displayed (Ingredient in my case.) Now it is showing Ingredient object for each and every entry as shown in pic I would like to display master_name instead og ingredient_name. How can I do that? 
Please reply me as soon as possible. 
Thank you.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/d9fe676d-9988-4f59-a97f-fdc5db777e39%40googlegroups.com.
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 [hidden email].
To post to this group, send email to [hidden email].
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/CAFWa6tJo-jNjU%3DS62UgnTV%3DERu4-w4xe-JcoUT2hgJf2s7e6tA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Error After Inspect db

mansi thakkar
I got it and tried as you said but still couldn't get the output as I want. It is still showing ingredient object.

On Tuesday, March 13, 2018 at 12:09:36 PM UTC-4, Avraham Serour wrote:
it seems you wrote def_str_, if should be def (space) then the function name

also the function str should probably be named with double underscores like this: __str__ not _str_

On Tue, Mar 13, 2018 at 5:27 PM, mansi thakkar <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="0NGATUa_AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mansith...@...> wrote:
Hello , 
Here is the attached files of my output and my error and my models.py file. I have database residing in aws cloud platform. What I have done is I have used inspectdb command and created models using that command. Then have registered my model into admin site and then model has been displayed (Ingredient in my case.) Now it is showing Ingredient object for each and every entry as shown in pic I would like to display master_name instead og ingredient_name. How can I do that? 
Please reply me as soon as possible. 
Thank you.

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="0NGATUa_AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django-users...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="0NGATUa_AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django...@....
Visit this group at <a href="https://groups.google.com/group/django-users" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;">https://groups.google.com/group/django-users.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/django-users/d9fe676d-9988-4f59-a97f-fdc5db777e39%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/django-users/d9fe676d-9988-4f59-a97f-fdc5db777e39%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/django-users/d9fe676d-9988-4f59-a97f-fdc5db777e39%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/django-users/d9fe676d-9988-4f59-a97f-fdc5db777e39%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">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 [hidden email].
To post to this group, send email to [hidden email].
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/147bd8b6-503e-46dc-93ab-1b75ea288ecb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.