Re: TypeError: 'str' object is not callable

2021-09-01 Thread Lalit Suthar
cool :)


On Tue, 31 Aug 2021 at 11:27, Salima Begum 
wrote:

> Hi all,
> Actually this error is prompting because in my deployment site I am using
> django version 3.2. In this version they have some issue with messages so,
> I referred to this document and I fixed it by adding one line in the
> settings.py file.
> https://docs.djangoproject.com/en/3.2/ref/contrib/messages/
>
> On Tue, Aug 31, 2021 at 11:22 AM Lalit Suthar 
> wrote:
>
>> go like this
>>
>> messages.add_message(request, messages.WARNING, "failure message")
>> return HttpResponse / render
>>
>> On Tue, 31 Aug 2021 at 10:32, Salima Begum 
>> wrote:
>>
>>> Hi, Thank you for your response.
>>>  I have defined as below  I have mentioned snippet in all
>>> functionalities i am getting error in every functionality  " 'str' object
>>> is not callable ".Please help me to fix this issue.
>>>
>>> ```
>>> messages.success(request, """Your Ad is successfully posted.""")
>>> ```
>>> Thank you
>>> ~Salima
>>>
>>> On Tue, Aug 31, 2021 at 10:19 AM Salima Begum <
>>> salim...@rohteksolutions.com> wrote:
>>>
 Hi Thomas,

 The way I defined how i have written code for confirmation message
 ```
 messages.success(request, """Your Ad is successfully posted.""")
 ```
 Thank you
 ~Salima

 On Tue, Aug 31, 2021 at 9:31 AM Thomas Lockhart <
 tlockhart1...@gmail.com> wrote:

> Just guessing that you need to write
>
> messages.success = “Your ad is successfully posted”
>
> But without more information from you that is only a guess.
>
> How is messages.success defined?
>
> - Tom
>
> On Aug 30, 2021, at 8:57 PM, Salima Begum <
> salim...@rohteksolutions.com> wrote:
>
> Hi all,
> In my project for each functionality I have written code for
> confirmation messages. For example
> ```
> messages.success("Your ad is successfully posted")
> ```
> Every functionality is breaking because of confirmation messages after
> deployment. How to fix it? Can anyone help me?
>
> Thank you
> ~Salima
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMSz6bkOz8AXa7d%2BRFFjm0m8xmCLYOyLQNx6syy7tf-NsPTRhA%40mail.gmail.com
> 
> .
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3831F4E1-0003-4F5A-922D-F6E1534E1B87%40gmail.com
> 
> .
>
 --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAMSz6b%3Dgrd5PeypVZJQ9L9uA90_xxijiq6eQSaqH6bdqhgNukg%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAGp2JVE6P_5qUAC2Ec%3D8Tzn6mUPTdvXhWJ4dO5XUUC2D-7vYVQ%40mail.gmail.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMSz6bmDkQio%3DYD9jxHxthnuupwkR80sjWgLEY4E6-SPZ5ofxQ%40mail.gmail.com
> 
> .

Curious about ModelAdmin internals.. how the hell does it work

2021-09-01 Thread Michal Plsek
Hello, I would like to know about this (although I hacked around it, but I 
am still curious):

if I have model which contains ForeignKey attribute and I am using 
autocomplete_fields on it, where is the found FK of foreign object saved on 
ModelAdmin page?
Numerical ID of foreign object represented by usual SELECTBOX is marked 
using **. I understand reasons why this is not 
done with autocomplete_fields, but I would presume the found value of FK 
would be saved in some* * or something like that, 
which is obviously not.

So, using autocomplete_fields, how can I get the found FK value on page?

(q on SO: 
https://stackoverflow.com/questions/69016647/where-is-id-saved-in-django-modeladmin-autocomplete-fields
 
)

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b12187f2-af5c-4631-a20e-b7648c97e89bn%40googlegroups.com.


Re: please help me todebug this code

2021-09-01 Thread Munzir Abba Daneji
Alright Peter sorry i get it. Fine

On Tue, Aug 31, 2021, 2:16 PM 'Peter van der Does' via Django users <
django-users@googlegroups.com> wrote:

> You seem to be confused about who asked the question because it was not me
> who asked the question.
> On 8/31/21 6:58 AM, Munzir Abba Daneji wrote:
>
> Hi peter The tag library you use is not correct use
> 
> {% load static %}
>
> again you html directory seems to be not organise try project_folder >
> Template_folder> index.html for example
>
> On Tue, Aug 31, 2021, 1:46 AM 'Peter van der Does' via Django users <
> django-users@googlegroups.com> wrote:
>
>> Uh what question are you answering?
>> On 8/30/21 12:55 PM, Munzir Abba Daneji wrote:
>>
>> Peter Check your Template DIR you supposed to organize you folders flow
>> under your "first_project" folder create the template folder and inser you
>> html
>>
>> On Mon, Aug 30, 2021, 5:09 PM 'Peter van der Does' via Django users <
>> django-users@googlegroups.com> wrote:
>>
>>> You got a " on line 2 that shouldn't be there
>>> On 8/28/21 1:15 PM, DUSHYANT SINGH wrote:
>>>
>>> In template C:\Users\DUSHYANT
>>> THAKUR\PycharmProjects\django\gs15\course\templates\course\index.html,
>>> error at line 2
>>>'"' is not a registered tag library. Must be one of:
>>>
>>>1 : 
>>>2 :  {% load static "%}
>>>
>>> --
>>>
>>> *Peter van der Does o: **410-584-2500*
>>> * m: 732-425-3102 ONeil Interactive, Inc  oneilinteractive.com
>>>  *
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/4c7aa0fa-8e0e-01c1-e5f0-491a3c3d9c96%40oneilinteractive.com
>>> 
>>> .
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CADL6%2BCk9m%3DiYeNvaPHmNt%3D4qiVt66DO5UvDQMq2w8c8GN-4dYg%40mail.gmail.com
>> 
>> .
>>
>> --
>>
>> *Peter van der Does o: **410-584-2500*
>> * m: 732-425-3102 ONeil Interactive, Inc  oneilinteractive.com
>>  *
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/273a594d-dd67-0640-c717-ce90789692d3%40oneilinteractive.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CADL6%2BC%3DW20E1e-NZpRPjmULL%3DaD-Ty13xMk78jj%3Dupc-Wx%3D_pw%40mail.gmail.com
> 
> .
>
> --
>
> *Peter van der Does o: **410-584-2500*
> * m: 732-425-3102 ONeil Interactive, Inc  oneilinteractive.com
>  *
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/7abe5b37-5819-608b-a746-979c31812592%40oneilinteractive.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADL6%2BCnntENZ82gwUSY%3DOfNFv6cijjRVDO83R9TnwoNmvaju%2BQ%40mail.gmai