Re: Any free MAP API available

2020-06-10 Thread Ram
 hello Ranga,

Thank you very much posting very useful direction and all the respective
pointers. I really appreciate it.

This is what we tried so far, but we are seeing an error from our
execution. Could you please let us know what we are missing?

import pgeocode
import folium

def zipcode_to_map(country_code, postal_code):

country_code = pgeocode.Nominatim(country_code)

zip_code = country_code.query_postal_code(postal_code)

postal_code = zip_code['postal_code']

multiple_zip_codes = country_code.query_postal_code(["560034", "560083"])

m = folium.Map(location=[zip_code['latitude'], zip_code['longitude']],
zoom_start=9, detect_retina=True, control_scale=False)
m.save(f'{postal_code}-map.html') print(m) zipcode_to_map('in','515411')

Result is here >>

python sam.py


Thanks,
~Ram


On Thu, Jun 4, 2020 at 9:24 AM RANGA BHARATH JINKA 
wrote:

> You can refer these links.
>
>
> https://towardsdatascience.com/visualizing-data-at-the-zip-code-level-with-folium-d07ac983db20
>
> https://morioh.com/p/d896544d6977
>
> https://towardsdatascience.com/making-3-easy-maps-with-python-fb7dfb1036
>
> On Thursday, June 4, 2020 at 3:15:55 AM UTC+5:30, Ram wrote:
>>
>> Hi,
>>
>> We need to add location map based on the zip code in our DJango web
>> application. Is there any free API available out there? if you have used it
>> already could you suggest one?
>>
>> Thanks,
>> ~Ram
>>
> --
> 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/78804b7c-c0c4-4258-bafb-809aa349f4b9%40googlegroups.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/CA%2BOi5F3h%3DigcwBi-fhqjRaDggkMz75d7UWbeKawfjR%3DQfdDTPg%40mail.gmail.com.


Re: Django CSRF protection and AJAX calls

2020-06-10 Thread Kevin
Thanks Boris & Allan,

I was able to research the problem further and found that my header was 
being set entirely correctly, and the Django csrf middleware does in fact 
require both the cookie AND the header to be set. It's not an either/or, 
and there is an explicit error message for when either of them are missing 
and csrf secured method is used. The POSTs that I am seeing fail appear to 
be because the csrf cookie is missing sometimes. I'm not sure as of yet if 
this is because Django is not creating it, or because certain browsers 
(notably Safari) are not sending it, or a mix of both.

On Wednesday, June 10, 2020 at 11:57:52 AM UTC-4, Boris Pérez wrote:
>
> My way, i use the csrf_token tag on template, an pass it to the view in 
> the ajax call, using 
>
> $.ajax({
> url : url,
> type : "POST", // http method
> data : {'csrfmiddlewaretoken': 
> $('input[name="csrfmiddlewaretoken"]').val(),
> 'v1':v1,'v2':v2,
> }, // data sent with the post request
>
>
>

-- 
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/6a0f1491-cdbc-4cfc-b9fa-665e389fdafeo%40googlegroups.com.


Re: How to display calendar in django webapplication?

2020-06-10 Thread learn code
Thank you so much!!!

On Wed, Jun 10, 2020 at 2:46 PM Miracle  wrote:

> Check this project pinax calendars
> https://github.com/pinax/pinax-calendars
>
> On Wed, 10 Jun 2020, 10:43 pm learn code,  wrote:
>
>> Hi everyone,
>>
>> I'm working on a website. In that, I need to display available dates and
>> timings dynamically. Anyone knows please help me.
>>
>> --
>> 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/6ac935a7-5602-4539-84dd-d746b943823do%40googlegroups.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/CADZv-jC3odzF2ip-mqr2_avz9nF00g-v%2BorVF3Owjbq14KE8Vw%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/CAPUBRGVMxcvCb-mOSyBxy_hBVOxEL%2Bz%2B9_SYhiCouhkPq42q4Q%40mail.gmail.com.


Re: How to display calendar in django webapplication?

2020-06-10 Thread Miracle
Check this project pinax calendars
https://github.com/pinax/pinax-calendars

On Wed, 10 Jun 2020, 10:43 pm learn code,  wrote:

> Hi everyone,
>
> I'm working on a website. In that, I need to display available dates and
> timings dynamically. Anyone knows please help me.
>
> --
> 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/6ac935a7-5602-4539-84dd-d746b943823do%40googlegroups.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/CADZv-jC3odzF2ip-mqr2_avz9nF00g-v%2BorVF3Owjbq14KE8Vw%40mail.gmail.com.


How to display calendar in django webapplication?

2020-06-10 Thread learn code
Hi everyone,

I'm working on a website. In that, I need to display available dates and 
timings dynamically. Anyone knows please help me.

-- 
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/6ac935a7-5602-4539-84dd-d746b943823do%40googlegroups.com.


Custom Permissions of Django Materialized View

2020-06-10 Thread Will Meyers
Hi all,

I'm building an application that uses Django Rest Framework and Django 
Guardian. I have to implement a permissions system such that when a user 
requests data from a materialized view, I need to omit certain rows from 
the returned queryset based on the user's group. 

For example, if my app contains 5 models:

   - User Model
   - User Group Model
   - Source Model
   - Article Model (with manytomany to Source Model)
   - Article Materialized View (consists of a flat table with an array 
   field for sources

If a user searches for articles, but because they belong to a certain group 
that doesn't allow the source "Example Source", the queryset would return 
articles from the materialized view that omit articles related to the 
source "Example Source".

The challenge I'm facing is that I had a permissions system in place for a 
normalized model, but since switching to materialized view (the 
denormalized model), I'm unsure how to go about implementing something like 
this.

Any help appreciated.

Best,

Will

-- 
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/d0085c29-ad47-4050-91a8-42c14daf81bbo%40googlegroups.com.


Re: Best Django Rest Framework Tutorial??????

2020-06-10 Thread chaitanya orakala
which is best among all those channels
?

On Wed, Jun 10, 2020 at 3:59 PM cosmos multi 
wrote:

> on youtube there are very good
>
> El mié., 10 jun. 2020 a las 14:40, chaitanya orakala (<
> chaitu.orak...@gmail.com>) escribió:
>
>> Thank you jacklin
>>
>>
>> On Wed, Jun 10, 2020 at 3:00 PM Jack Lin  wrote:
>>
>>> DOCUMENTATION
>>>
>>>
>>> 在 2020年6月11日 於 上午2:58:42, chaitanya orakala (chaitu.orak...@gmail.com)
>>> 寫下:
>>>
>>> can anyone please respond ??
>>>
>>> On Wed, Jun 10, 2020 at 9:51 AM Sai  wrote:
>>>
 Hi djangoians,
 I want to learn django rest framework, may i please know which is best
 resource in online market or any youtube links or udemy courses???

 Thanks in advance.

 --
 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/d8b89181-f0d9-4ee8-9f79-dedec63738d2o%40googlegroups.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/CAPcTzRYC7UgBAE%3Dm47w74w7kx7JQEtt3ZGZ1naV%2B1tr4jiicYw%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/CAP7OQq11pVJOX6j6fZRHki2YVNiFE8w_yF_BAeFaCGf_mEhZdQ%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/CAPcTzRameZyEwswkSEvgn_txzHYnir-q%2B80SjeKxDSrqmotPVA%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/CA%2Bt%2BYr3m5wAivA4hL3QX%2B9hTWTEB%3Ddiz-%2B8B8NSkQyKSnqQ%3DnA%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/CAPcTzRZbe3pxoGycbce18ykxbs9R18CEn7hybe%3DjxFHgDBYe5g%40mail.gmail.com.


Re: Best Django Rest Framework Tutorial??????

2020-06-10 Thread cosmos multi
on youtube there are very good

El mié., 10 jun. 2020 a las 14:40, chaitanya orakala (<
chaitu.orak...@gmail.com>) escribió:

> Thank you jacklin
>
>
> On Wed, Jun 10, 2020 at 3:00 PM Jack Lin  wrote:
>
>> DOCUMENTATION
>>
>>
>> 在 2020年6月11日 於 上午2:58:42, chaitanya orakala (chaitu.orak...@gmail.com)
>> 寫下:
>>
>> can anyone please respond ??
>>
>> On Wed, Jun 10, 2020 at 9:51 AM Sai  wrote:
>>
>>> Hi djangoians,
>>> I want to learn django rest framework, may i please know which is best
>>> resource in online market or any youtube links or udemy courses???
>>>
>>> Thanks in advance.
>>>
>>> --
>>> 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/d8b89181-f0d9-4ee8-9f79-dedec63738d2o%40googlegroups.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/CAPcTzRYC7UgBAE%3Dm47w74w7kx7JQEtt3ZGZ1naV%2B1tr4jiicYw%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/CAP7OQq11pVJOX6j6fZRHki2YVNiFE8w_yF_BAeFaCGf_mEhZdQ%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/CAPcTzRameZyEwswkSEvgn_txzHYnir-q%2B80SjeKxDSrqmotPVA%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/CA%2Bt%2BYr3m5wAivA4hL3QX%2B9hTWTEB%3Ddiz-%2B8B8NSkQyKSnqQ%3DnA%40mail.gmail.com.


Re: How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-10 Thread chaitanya orakala
Answer :

*First hide the necessary fields which you want  to hide and pop in drop
down.*
style.css

#id_exec_first_name, label[for="id_exec_first_name"] {
  display: none
}

#id_exec_last_name, label[for="id_exec_last_name"]{
display: none
}

#id_exec_title, label[for="id_exec_title"]{
display: none
}

#id_exec_email, label[for="id_exec_email"]{
display: none
}

#id_exec_phone_number, label[for="id_exec_phone_number"]{
display: none
}

#id_exec_fax, label[for="id_exec_fax"]{
display: none
}

#li{
list-style: none;
}



*Include jquery CDN and write a function to make fields display which is
hidden, grad id fields from inspect element.*
*Html*
*
{% extends 'er_form/index.html' %}



{% block content %}


https://code.jquery.com/jquery-3.2.1.slim.min.js";
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous">


$(function () {

 $('#id_executive_authority_1').on('click', function () {
 $('#id_exec_first_name, label[for="id_exec_first_name"]').show();
 $('#id_exec_last_name, label[for="id_exec_last_name"]').show();
 $('#id_exec_title, label[for="id_exec_title"]').show();
 $('#id_exec_email, label[for="id_exec_email"]').show();
 $('#id_exec_phone_number, label[for="id_exec_phone_number"]').show();
 $('#id_exec_fax, label[for="id_exec_fax"]').show();

});
});


$(function () {

 $('#id_executive_authority_0').on('click', function () {
 $('#id_exec_first_name, label[for="id_exec_first_name"]').hide();
 $('#id_exec_last_name, label[for="id_exec_last_name"]').hide();
 $('#id_exec_title, label[for="id_exec_title"]').hide();
 $('#id_exec_email, label[for="id_exec_email"]').hide();
 $('#id_exec_phone_number, label[for="id_exec_phone_number"]').hide();
 $('#id_exec_fax, label[for="id_exec_fax"]').hide();

});
});




 


{% csrf_token %}
{{ client_form.as_p }}
{{ billing_form.as_p }}
Submit


  
{% endblock content %}

>
> *



On Wed, Jun 10, 2020 at 6:00 AM Balaji Shetty 
wrote:

> Thank You Very Much for considering advice
>
> On Wed, Jun 10, 2020 at 8:11 AM chaitanya orakala <
> chaitu.orak...@gmail.com> wrote:
>
>> sure, I will do it by tomorrow
>>
>>
>> On Tue, Jun 9, 2020 at 2:35 AM Balaji Shetty 
>> wrote:
>>
>>> Nice
>>>
>>> Can you please share sample code on git link.
>>>
>>> This is very common requirement in every project
>>>
>>>
>>>
>>> On Tuesday, June 9, 2020, chaitanya orakala 
>>> wrote:
>>>
 Thank You, Amine Aziz. I tried jquery and it worked. its so simple once
 we know jquery.
 do help others like you did to me.

 On Sun, Jun 7, 2020 at 1:18 PM AMINE AZIZ  wrote:

> I will share with you my iwn code used in admin , but it still the
> same as the front end
>
> withe jQuery i can show input or hide it , so you will do the same
> with popup , by default it will be display none, and with Jquery you can
> show it if user change value to yes dropdown (select)
>
> you will use id div of pupup to show it or hide it
>
>
> if (!$) {
> // Need this line because Django also provided jQuery and namespaced 
> as django.jQuery
> $ = django.jQuery;
> }
>
>
>
> $(document).ready(function() {
>
> $("#id_paysPartenaires").change(function()
> {
>
>
>
>  var 
> total_partenaire=$("#id_multipartenairecooperationbilaterale_set-TOTAL_FORMS").val()
> var SelectNumber =  i
>  
> SelectedValuePartenaire=$("#id_multipartenairecooperationbilaterale_set-"+SelectNumber+"-multiPartenairePP").val()
>  //alert(SelectNumber)
>
>
>
> 
> $("[id=div-2-multiAdefinir]:eq("+SelectNumber+")").hide();
> 
> $("[id=div-2-multiGouvernementPP]:eq("+SelectNumber+")").hide();
>
> $("[id=div-2-multiGouvernementPP]:eq("+SelectNumber+")").hide();
> 
> $("[id=div-2-multiPaysPP]:eq("+SelectNumber+")").show();
>   }
>
>
> });
>
>
> Le dimanche 7 juin 2020 07:34:00 UTC+1, Sai a écrit :
>>
>> Hi guys,
>> I am working on a* Django project,* which involves submission form
>> and saving the data in the database using model form.  I am stuck with 
>> one
>> of the functionalities of form which should work like for example "do you
>> want benefit plan: *YES,* *next Field options should pop up*. if
>> click* NO, nothing should happen* and move to the next question."
>>
>> I went through all over the internet and found the dependent
>> drop-down select option but not like field pop up as we click through te
>> form.
>>
>> Please let me know how to achieve this in a clear way as 

Re: Best Django Rest Framework Tutorial??????

2020-06-10 Thread chaitanya orakala
Thank you jacklin


On Wed, Jun 10, 2020 at 3:00 PM Jack Lin  wrote:

> DOCUMENTATION
>
>
> 在 2020年6月11日 於 上午2:58:42, chaitanya orakala (chaitu.orak...@gmail.com) 寫下:
>
> can anyone please respond ??
>
> On Wed, Jun 10, 2020 at 9:51 AM Sai  wrote:
>
>> Hi djangoians,
>> I want to learn django rest framework, may i please know which is best
>> resource in online market or any youtube links or udemy courses???
>>
>> Thanks in advance.
>>
>> --
>> 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/d8b89181-f0d9-4ee8-9f79-dedec63738d2o%40googlegroups.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/CAPcTzRYC7UgBAE%3Dm47w74w7kx7JQEtt3ZGZ1naV%2B1tr4jiicYw%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/CAP7OQq11pVJOX6j6fZRHki2YVNiFE8w_yF_BAeFaCGf_mEhZdQ%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/CAPcTzRameZyEwswkSEvgn_txzHYnir-q%2B80SjeKxDSrqmotPVA%40mail.gmail.com.


Re: Best Django Rest Framework Tutorial??????

2020-06-10 Thread Jack Lin
DOCUMENTATION


在 2020年6月11日 於 上午2:58:42, chaitanya orakala (chaitu.orak...@gmail.com) 寫下:

can anyone please respond ??

On Wed, Jun 10, 2020 at 9:51 AM Sai  wrote:

> Hi djangoians,
> I want to learn django rest framework, may i please know which is best
> resource in online market or any youtube links or udemy courses???
>
> Thanks in advance.
>
> --
> 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/d8b89181-f0d9-4ee8-9f79-dedec63738d2o%40googlegroups.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/CAPcTzRYC7UgBAE%3Dm47w74w7kx7JQEtt3ZGZ1naV%2B1tr4jiicYw%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/CAP7OQq11pVJOX6j6fZRHki2YVNiFE8w_yF_BAeFaCGf_mEhZdQ%40mail.gmail.com.


Re: Best Django Rest Framework Tutorial??????

2020-06-10 Thread chaitanya orakala
can anyone please respond ??

On Wed, Jun 10, 2020 at 9:51 AM Sai  wrote:

> Hi djangoians,
> I want to learn django rest framework, may i please know which is best
> resource in online market or any youtube links or udemy courses???
>
> Thanks in advance.
>
> --
> 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/d8b89181-f0d9-4ee8-9f79-dedec63738d2o%40googlegroups.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/CAPcTzRYC7UgBAE%3Dm47w74w7kx7JQEtt3ZGZ1naV%2B1tr4jiicYw%40mail.gmail.com.


RE: Changing name of file in FileField field

2020-06-10 Thread matthew.pava
Thank you so much for that! It was due to duplicate file names.

I had a tearDownClass method that was deleting my temp files after the test was 
completed. It should have been a tearDown method that occurred at the end of 
every test.

 

From: django-users@googlegroups.com  On Behalf 
Of Chetan Ganji
Sent: Tuesday, June 9, 2020 3:07 PM
To: django-users@googlegroups.com
Subject: Re: Changing name of file in FileField field

 

Hi,
I had come across a similar issue last year. Filename would change after the 
upload.
It been time and I am not sure why it happened then. But, i think it happened 
because a file with the same name was already present the given location. 
And the django/drf code would make the name of the file unique by appending 
random text like above. 
You can check if this is the case. 

You can try a couple of things. 

1. Print the name of the file being generated as soon as it gets generated.  
2. Print the name of the file and Path(d1.file.name  
).name just before the assertion.
3. Check if a document with the same name already exists in the db and media 
root folder, and make sure that it doesnt. 

 

I hope it helps.

Cheers



Regards,

Chetan Ganji

+91-900-483-4183

  ganji.che...@gmail.com

  http://ryucoder.in

 

 

On Wed, Jun 10, 2020 at 12:31 AM Matthew Pava mailto:matthew.p...@gmail.com> > wrote:

Good day,

I have been struggling with this issue for weeks, and I can't figure out what 
I'm doing wrong.

I have a model with a FileField with a custom upload_to function. It seems to 
work fine when I'm doing runserver.

Problems arise during my tests.

 

My assertion error fails:

AssertionError: 'Rev0_2020-06-09_L123_My_Document_63ExUTF.docx' != 
'Rev0_2020-06-09_L123_My_Document.docx'

- Rev0_2020-06-09_L123_My_Document_63ExUTF.docx

? 

+ Rev0_2020-06-09_L123_My_Document.docx

 


You see, it keeps adding these extra random characters to the filename, which 
is not at all in my upload_to function.

 

class DocumentTestCase(TestCase):
def create_document(self, **kwargs):
if 'file' not in kwargs:
kwargs['file'] = self.get_test_file()
return Document.objects.create(**kwargs)
 def _create_file(self):
f = tempfile.NamedTemporaryFile(suffix=self.TEST_FILE_EXTENSION, 
delete=False)
with open(f.name  , mode='wb'):
f.write(b"NA")
return open(f.name  , mode='rb')

TEST_FILE_EXTENSION = ".docx"

def setUp(self):
super().setUp()
settings.MEDIA_ROOT = MEDIA_ROOT

def get_test_file(self):
file = self._create_file()
return File(file, name=file.name  )
def test_rename_file_after_upload(self):
d1 = self.create_document(title="My Document", number="L123")
title = d1.title.replace(" ", "_")
extension = Path(d1.file.path).suffix
new_name = 
f"Rev{d1.revision}_{d1.revision_date}_{d1.number}_{title}{extension}"
self.assertEqual(Path(d1.file.name).name, new_name)

 

-- 
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/cbc812fc-6d5e-4afb-ab64-6bc0fad303a3o%40googlegroups.com
 

 .

-- 
You received this message because you are subscribed to a topic in the Google 
Groups "Django users" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/django-users/7bwtdfURlSk/unsubscribe.
To unsubscribe from this group and all its topics, 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/CAMKMUjsSKYU3FyD4SL%3DxumDc3spfM74KmnFhpRBbFniNe5ex2w%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/002c01d63f58%24d66e40b0%24834ac210%24%40gmail.com.


Re: Django CSRF protection and AJAX calls

2020-06-10 Thread Boris Pérez
My way, i use the csrf_token tag on template, an pass it to the view in the 
ajax call, using 

$.ajax({
url : url,
type : "POST", // http method
data : {'csrfmiddlewaretoken': $('input[name="csrfmiddlewaretoken"]').val(),
'v1':v1,'v2':v2,
}, // data sent with the post request


El martes, 26 de mayo de 2020, 14:19:08 (UTC-4), Kevin escribió:
>
> Hi,
>
> I'm not able to POST to django without having a csrf_token cookie sent 
> with the request, though the documentation says you can set an X-CSRFToken 
> header - it appears to be entirely ignored.
>
> The behaviour has been pointed out a couple of times before:
>
> https://code.djangoproject.com/ticket/26904
>
> https://code.djangoproject.com/ticket/30514
>
> but it doesn't appear to have ever been triaged by a project member or 
> looked into in any way.
>
> I'm trying to find a definitive answer - should a POST request to a CSRF 
> protected endpoint work without the cookie if the header is set?
>
> Thanks
>
> -Kevin
>

-- 
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/329b6346-2a11-449f-9c02-51d79f774fe1o%40googlegroups.com.


Compare logged-in user against record owner in filter

2020-06-10 Thread Clive Bruton
I am trying to create a queryset that filters against the logged-in  
user's id and the user_id in the record, ie so that only the relevant  
user can see the record.


Without the filter, when I display the page I can capture elements in  
the template that would allow this comparison, ie:


object.user.id # the record owner
user.id # the logged-in user's id
object.user # the record owner's user name
user # the logged-in user’s user name

So, in models.py I made a new query manager:

class EditManager(models.Manager):
def get_queryset(self):
return super(EditManager, self).get_queryset().filter(
user.id==object.user.id,
expires__gte=datetime.now(timezone.utc),
is_active=True)

Then the debug gives the following error:

Exception Value:name 'user' is not defined

Even if I try fields that are obviously in the table, just to get a  
nonsensical filter, I get similar errors, eg "id==user_id".


I have tried variations on the user id comparison, but have not got  
any further.


Or, am I going about this completely the wrong way?

Any help greatly appreciated.


-- Clive

--
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/3F70FF33-445A-4EB4-A582-6C20268B0355%40indx.co.uk.


Re: Idea production with Django

2020-06-10 Thread Andréas Kühne
Very meta :)

Regards,

Andréas


Den ons 10 juni 2020 kl 15:52 skrev Wim Olivier :

> Build an app where people can post their ideas, and other people vote on
> their ideas - whether they're good or not good.  :-)
>
> On Wednesday, 10 June 2020 14:51:33 UTC+2, vchanel Hoang wrote:
>>
>> Please everybody give me some idea.
>>
> --
> 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/8e71fef3-156d-4225-ae44-1490b70d043bo%40googlegroups.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/CAK4qSCepoBCfM-TO7fbnwOaPs2FDKMxnKg2sSwiQc8rZVObUAw%40mail.gmail.com.


Re: Idea production with Django

2020-06-10 Thread Wim Olivier
Build an app where people can post their ideas, and other people vote on 
their ideas - whether they're good or not good.  :-)

On Wednesday, 10 June 2020 14:51:33 UTC+2, vchanel Hoang wrote:
>
> Please everybody give me some idea.
>

-- 
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/8e71fef3-156d-4225-ae44-1490b70d043bo%40googlegroups.com.


Best Django Rest Framework Tutorial??????

2020-06-10 Thread Sai
Hi djangoians,
I want to learn django rest framework, may i please know which is best resource 
in online market or any youtube links or udemy courses???

Thanks in advance.

-- 
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/d8b89181-f0d9-4ee8-9f79-dedec63738d2o%40googlegroups.com.


Cannot resolve keyword 'slug' into field.

2020-06-10 Thread Ateequr Rahman
I trying to develop  a ToDoList using Django. For every user there is a *List 
*model and in each List there are several *Task(*model*). *
I am using django auth *User *model and Class based views to Create, Update 
and Delete Lists and Tasks.

I successfully created, updated and deleted *List*. But am facing problems 
when updating *Task. *I am using slug for both List and Task.

I am facing this error (Cannot resolve keyword 'slug' into field.) when 
getting the update_form page. 

Please help. The following are the codes for my project:

models.py
from django.db import models
from django.contrib.auth import get_user_model
from django.utils.text import slugify
from django.urls import reverse

User = get_user_model()
# Create your models here.
class List(models.Model):

LIST_TYPES = [('daily','Daily'),
('weekly','Weekly'),
('monthly', 'Monthly'),
('lifelong', 'Life Long')]
list_type = models.CharField(max_length = 10, choices = LIST_TYPES)
user = models.ForeignKey(User, related_name = 'list', on_delete = 
models.CASCADE)
title = models.CharField(max_length = 32)
slug = models.SlugField(allow_unicode = True, unique = True)
created_at = models.DateTimeField(auto_now_add = True)

def __str__(self):
return self.title

def save(self, *args, **kwargs):
self.slug = slugify(self.title)
super().save( *args, **kwargs)

class Meta():
ordering = ['title']

class Task(models.Model):

list = models.ForeignKey(List, related_name = 'tasks', on_delete = 
models.CASCADE)
user = models.ForeignKey(User, related_name = 'tasks', on_delete = 
models.CASCADE)
name = models.CharField(max_length = 64)
task_slug = models.SlugField(allow_unicode = True)
completed = models.BooleanField(default = False)
created_at = models.DateTimeField(auto_now_add = True)
complete_before = models.DateTimeField()
class Meta():
ordering = ['complete_before']


def __str__(self):
return self.name

def save(self,*args, **kwargs):
self.task_slug = slugify(self.name)
super().save(*args, **kwargs)

def get_absolute_url(self):
return reverse('listApp:detail', kwargs={'slug':self.slug})



urls.py(for app):-
from django.urls import path
from . import views

app_name = 'listApp'

urlpatterns = [
path('', views.ListListView.as_view(), name = 'all'),
path('create', views.ListCreateView.as_view(), name = 'create'),
path('', views.ListDetailView.as_view(), name = 'detail'),
path('/createtask', views.TaskCreateView.as_view(), name = 
'createtask'),
path('/updatetask/', 
views.TaskUpdateView.as_view(), name = 'updatetask'),
path('update/', views.ListUpdateView.as_view(), 
name='update'),
path('delete/', views.ListDeleteView.as_view(), 
name='delete'),

]


views.py:-

from django.shortcuts import render
from django.views.generic import CreateView, ListView, DetailView, 
UpdateView, DeleteView
from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls import reverse_lazy
from django.utils.text import slugify
from braces.views import SelectRelatedMixin
from .forms import ListCreateForm,TaskCreateForm
from .models import List,Task


# Create your views here.
class ListCreateView(LoginRequiredMixin, CreateView):

form_class = ListCreateForm
success_url = reverse_lazy('listApp:all')
template_name = 'listApp/list_form.html'

def form_valid(self, form):
self.object = form.save(commit = False)
self.object.user = self.request.user
self.object.save()
return super().form_valid(form)

class ListListView(LoginRequiredMixin, ListView):

model = List
template_name = 'listApp/list_list.html'
context_object_name = 'lists'

def get_queryset(self):
self.user = self.request.user
return List.objects.filter(user=self.user)

class ListDetailView(LoginRequiredMixin, DetailView):

model = List
template_name = 'listApp/list_detail.html'
context_object_name = 'list_detail'

class ListUpdateView(LoginRequiredMixin, UpdateView):
model = List
fields = ('title', 'list_type')
template_name_suffix = '_update_form'
success_url = reverse_lazy('listApp:all')
#
# def get_success_url(self):
# current_slug = self.kwargs['slug']
# return reverse_lazy('listApp:detail', kwargs={'slug': 
current_slug})

class ListDeleteView(LoginRequiredMixin, DeleteView):

model = List
template_name_suffix = '_check_delete'
success_url = reverse_lazy('listApp:all')


class TaskCreateView(LoginRequiredMixin, CreateView):

form_class = TaskCreateForm
template_name = 'listApp/task_form.html'

def form_valid(self, form):
self.object = form.save(commit = False)
self.object.user = self.request.user
self.object.list = List.objects.get(slug=self.kwargs['slug'])
self.object.save()
return 

Cannot resolve keyword 'slug' into field.

2020-06-10 Thread Ateequr Rahman
I am trying to make a ToDoList for every user.
I am using class based views and the auth User model. 

For Every User, there is a List model, consisting the List Name, and a Task 
model which is a child to the List.

I am having problem when I am updating a Task under a List.

I have my models.py, urls.py, views.py and the templates as follows.

models.py:

from django.db import models
from django.contrib.auth import get_user_model
from django.utils.text import slugify
from django.urls import reverse

User = get_user_model()
# Create your models here.
class List(models.Model):

LIST_TYPES = [('daily','Daily'),
('weekly','Weekly'),
('monthly', 'Monthly'),
('lifelong', 'Life Long')]
list_type = models.CharField(max_length = 10, choices = LIST_TYPES)
user = models.ForeignKey(User, related_name = 'list', on_delete = 
models.CASCADE)
title = models.CharField(max_length = 32)
slug = models.SlugField(allow_unicode = True, unique = True)
created_at = models.DateTimeField(auto_now_add = True)

def __str__(self):
return self.title

def save(self, *args, **kwargs):
self.slug = slugify(self.title)
super().save( *args, **kwargs)

class Meta():
ordering = ['title']

class Task(models.Model):

list = models.ForeignKey(List, related_name = 'tasks', on_delete = 
models.CASCADE)
user = models.ForeignKey(User, related_name = 'tasks', on_delete = 
models.CASCADE)
name = models.CharField(max_length = 64)
task_slug = models.SlugField(allow_unicode = True)
completed = models.BooleanField(default = False)
created_at = models.DateTimeField(auto_now_add = True)
complete_before = models.DateTimeField()
class Meta():
ordering = ['complete_before']


def __str__(self):
return self.name

def save(self,*args, **kwargs):
self.task_slug = slugify(self.name)
super().save(*args, **kwargs)

def get_absolute_url(self):
return reverse('listApp:detail', kwargs={'slug':self.slug})



urls.py:-

from django.urls import path
from . import views

app_name = 'listApp'

urlpatterns = [
path('', views.ListListView.as_view(), name = 'all'),
path('create', views.ListCreateView.as_view(), name = 'create'),
path('', views.ListDetailView.as_view(), name = 'detail'),
path('/createtask', views.TaskCreateView.as_view(), name = 
'createtask'),
path('/updatetask/', 
views.TaskUpdateView.as_view(), name = 'updatetask'),
path('update/', views.ListUpdateView.as_view(), 
name='update'),
path('delete/', views.ListDeleteView.as_view(), 
name='delete'),

]



views.py:-

from django.shortcuts import render
from django.views.generic import CreateView, ListView, DetailView, 
UpdateView, DeleteView
from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls import reverse_lazy
from django.utils.text import slugify
from braces.views import SelectRelatedMixin
from .forms import ListCreateForm,TaskCreateForm
from .models import List,Task


# Create your views here.
class ListCreateView(LoginRequiredMixin, CreateView):

form_class = ListCreateForm
success_url = reverse_lazy('listApp:all')
template_name = 'listApp/list_form.html'

def form_valid(self, form):
self.object = form.save(commit = False)
self.object.user = self.request.user
self.object.save()
return super().form_valid(form)

class ListListView(LoginRequiredMixin, ListView):

model = List
template_name = 'listApp/list_list.html'
context_object_name = 'lists'

def get_queryset(self):
self.user = self.request.user
return List.objects.filter(user=self.user)

class ListDetailView(LoginRequiredMixin, DetailView):

model = List
template_name = 'listApp/list_detail.html'
context_object_name = 'list_detail'

class ListUpdateView(LoginRequiredMixin, UpdateView):
model = List
fields = ('title', 'list_type')
template_name_suffix = '_update_form'
success_url = reverse_lazy('listApp:all')
#
# def get_success_url(self):
# current_slug = self.kwargs['slug']
# return reverse_lazy('listApp:detail', kwargs={'slug': 
current_slug})

class ListDeleteView(LoginRequiredMixin, DeleteView):

model = List
template_name_suffix = '_check_delete'
success_url = reverse_lazy('listApp:all')


class TaskCreateView(LoginRequiredMixin, CreateView):

form_class = TaskCreateForm
template_name = 'listApp/task_form.html'

def form_valid(self, form):
self.object = form.save(commit = False)
self.object.user = self.request.user
self.object.list = List.objects.get(slug=self.kwargs['slug'])
self.object.save()
return super().form_valid(form)

def get_success_url(self):
current_slug = self.kwargs['slug']
return reverse_lazy('listApp:detail', kwargs={'slug': current_slug})


class 

Idea production with Django

2020-06-10 Thread vchanel Hoang
Please everybody give me some idea.

-- 
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/4e9a7c64-571e-49a7-8bbd-585ad01e4cf9o%40googlegroups.com.


Re: How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-10 Thread Balaji Shetty
Thank You Very Much for considering advice

On Wed, Jun 10, 2020 at 8:11 AM chaitanya orakala 
wrote:

> sure, I will do it by tomorrow
>
>
> On Tue, Jun 9, 2020 at 2:35 AM Balaji Shetty 
> wrote:
>
>> Nice
>>
>> Can you please share sample code on git link.
>>
>> This is very common requirement in every project
>>
>>
>>
>> On Tuesday, June 9, 2020, chaitanya orakala 
>> wrote:
>>
>>> Thank You, Amine Aziz. I tried jquery and it worked. its so simple once
>>> we know jquery.
>>> do help others like you did to me.
>>>
>>> On Sun, Jun 7, 2020 at 1:18 PM AMINE AZIZ  wrote:
>>>
 I will share with you my iwn code used in admin , but it still the same
 as the front end

 withe jQuery i can show input or hide it , so you will do the same with
 popup , by default it will be display none, and with Jquery you can show it
 if user change value to yes dropdown (select)

 you will use id div of pupup to show it or hide it


 if (!$) {
 // Need this line because Django also provided jQuery and namespaced 
 as django.jQuery
 $ = django.jQuery;
 }



 $(document).ready(function() {

 $("#id_paysPartenaires").change(function()
 {



  var 
 total_partenaire=$("#id_multipartenairecooperationbilaterale_set-TOTAL_FORMS").val()
 var SelectNumber =  i
  
 SelectedValuePartenaire=$("#id_multipartenairecooperationbilaterale_set-"+SelectNumber+"-multiPartenairePP").val()
  //alert(SelectNumber)



 
 $("[id=div-2-multiAdefinir]:eq("+SelectNumber+")").hide();
 
 $("[id=div-2-multiGouvernementPP]:eq("+SelectNumber+")").hide();

 $("[id=div-2-multiGouvernementPP]:eq("+SelectNumber+")").hide();
 
 $("[id=div-2-multiPaysPP]:eq("+SelectNumber+")").show();
   }


 });


 Le dimanche 7 juin 2020 07:34:00 UTC+1, Sai a écrit :
>
> Hi guys,
> I am working on a* Django project,* which involves submission form
> and saving the data in the database using model form.  I am stuck with one
> of the functionalities of form which should work like for example "do you
> want benefit plan: *YES,* *next Field options should pop up*. if click*
> NO, nothing should happen* and move to the next question."
>
> I went through all over the internet and found the dependent drop-down
> select option but not like field pop up as we click through te form.
>
> Please let me know how to achieve this in a clear way as I am new to
> Django and programming as well.
>
> Thank You so much in advance.
>
 --
 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/3f3bf262-7fac-4818-836e-dc8532dae707o%40googlegroups.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/CAPcTzRabB90jUEuYj1v-9JWdOMqqsM4fjN-TEq1CwOcwEPX1zA%40mail.gmail.com
>>> 
>>> .
>>>
>>
>>
>> --
>> Mr Shetty Balaji
>> Asst. Prof.
>> IT Department
>> SGGS I
>> Nanded. My. India
>>
>> --
>> 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/CAECSbOt4OiS_WLAucNWQtwpWuZ_LZe1hXyM4%3DFXZzmm6mSVGHw%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
> 

Re: autocomplete django in visual studio code

2020-06-10 Thread Miracle
I think using "Jedi" as IntelliSense engine would solve the problem.

You can also get more template and django specific snippets and auto
completion using the "django" extension from the marketplace.

On Wed, 10 Jun 2020, 3:23 am THAKUR SINGH, 
wrote:

> INSTALL WINDOWS 10 THEN  INSTALL YOUR SOFTWARES
>
> --
> 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/60cd712f-07ed-471c-887a-f5e77b4402dfo%40googlegroups.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/CADZv-jA%2B%2BYROox3Qkp8V9Td18F0ZgT5ORyXoC%2B1gNide0_wyZw%40mail.gmail.com.


Re: How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-10 Thread AMINE AZIZ
 
Shre your code, so it will help others. 
And if you can, change to resoulved, so it will be marked in Google search 

Best regards 

-- 
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/0986b7a6-ac98-4687-8d21-1d45917984f6o%40googlegroups.com.


Re: Django-Firebase cloudstore ORM

2020-06-10 Thread Integr@te System
Hi Goil,

Did you register your model to site admin contrib.




On Wed, Jun 10, 2020, 6:52 AM sparsh goil  wrote:

> Hey,
> Does anyone know how to perfectly use Firebase with Django?
>
> I am using Django-Firebase-ORM which automatically maps my models to cloud
> firestore database but I am getting error.
> Model.py
> from firebase_orm import models
> # Create your models here.
>
> class Article(models.Model):
> headline = models.TextField()
> type_article = models.TextField(db_column='type')
>
> class Meta:
> db_table = 'medications'
>
> def __str__(self):
> return self.headline
>
> >python3 manage.py makemigrations
>
> Error:
> Traceback (most recent call last):
>   File "manage.py", line 21, in 
> main()
>   File "manage.py", line 17, in main
> execute_from_command_line(sys.argv)
>   File "/home/spaggy/Documents/Summer Internship
> 2020/venv/lib/python3.6/site-packages/django/core/management/__init__.py",
> line 401, in execute_from_command_line
> utility.execute()
>   File "/home/spaggy/Documents/Summer Internship
> 2020/venv/lib/python3.6/site-packages/django/core/management/__init__.py",
> line 377, in execute
> django.setup()
>   File "/home/spaggy/Documents/Summer Internship
> 2020/venv/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
> apps.populate(settings.INSTALLED_APPS)
>   File "/home/spaggy/Documents/Summer Internship
> 2020/venv/lib/python3.6/site-packages/django/apps/registry.py", line 122,
> in populate
> app_config.ready()
>   File "/home/spaggy/Documents/Summer Internship
> 2020/venv/lib/python3.6/site-packages/django/contrib/admin/apps.py", line
> 24, in ready
> self.module.autodiscover()
>   File "/home/spaggy/Documents/Summer Internship
> 2020/venv/lib/python3.6/site-packages/django/contrib/admin/__init__.py",
> line 26, in autodiscover
> autodiscover_modules('admin', register_to=site)
>   File "/home/spaggy/Documents/Summer Internship
> 2020/venv/lib/python3.6/site-packages/django/utils/module_loading.py", line
> 47, in autodiscover_modules
> import_module('%s.%s' % (app_config.name, module_to_search))
>   File "/usr/lib/python3.6/importlib/__init__.py", line 126, in
> import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 994, in _gcd_import
>   File "", line 971, in _find_and_load
>   File "", line 955, in
> _find_and_load_unlocked
>   File "", line 665, in _load_unlocked
>   File "", line 678, in exec_module
>   File "", line 219, in
> _call_with_frames_removed
>   File "/home/spaggy/Documents/Summer Internship
> 2020/AI_legal/AI_legal/case_archives/admin.py", line 4, in 
> admin.site.register(Article)
>   File "/home/spaggy/Documents/Summer Internship
> 2020/venv/lib/python3.6/site-packages/django/contrib/admin/sites.py", line
> 103, in register
> for model in model_or_iterable:
> TypeError: 'ModelBase' object is not iterable
>
>
>
> --
> 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/2208da1b-3469-4a30-ab7e-4fda4016fe8bo%40googlegroups.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/CAP5HUWpZ1-R8GTsCj-050VP%2B-cYqxqb7aUhwPA0DPDqmdt_OZQ%40mail.gmail.com.


Re: webex / zoom meetings Integrations in django

2020-06-10 Thread Kasper Laudrup

Hi Irfan,

On 10/06/2020 09.09, Irfan Khan wrote:

Hi Everyone,

I wanted to integrate webex or zoom meetings Into my django application, 
can any one please guide me or suggest docs.




https://developer.webex.com/docs/api/getting-started
https://marketplace.zoom.us/docs/api-reference/introduction

Kind regards,

Kasper Laudrup

--
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/9cd9e4fd-a43a-5af0-89b5-e1028e43ba06%40stacktrace.dk.


webex / zoom meetings Integrations in django

2020-06-10 Thread Irfan Khan
Hi Everyone,

I wanted to integrate webex or zoom meetings Into my django application,
can any one please guide me or suggest docs.

target : i have one linke on template which is if the end user click on
that link he can join the session/ meeting.



With Regards,
*Irfan khan*

-- 
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/CALKGVir930sJ53HbxOt1tSms5YEwEA-W_eNHjz55X_Mn6n6Hrw%40mail.gmail.com.