Re: Need to volunteer in a django project to emprove my knowledge

2021-06-17 Thread Williams Andy Inc
Communication will be difficult, I think .

On Thu, Jun 17, 2021 at 11:27 PM Luciano Martins  wrote:

> it also accepts dev BR, but I don't speak english and I use google
> translator
>
> Em quinta-feira, 17 de junho de 2021 às 14:40:43 UTC-3, swiss...@gmail.com
> escreveu:
>
>> https://github.com/swisscodes
>>
>> On Thu, Jun 17, 2021 at 5:50 PM Williams Andy Inc 
>> wrote:
>>
>>> Its open for anyone ready to participate just add me on my github or msg
>>> me here we can do some google meets or zoom ,,, for example now i want to
>>> add the edit and delete button using jquery and ajax.. so it stays on same
>>> page.
>>> we can collaborate and learn
>>>
>>> On Thu, Jun 17, 2021 at 4:05 PM Boris Pérez  wrote:
>>>
 I´m intrested on participate too...is it posiible??? Thanks, Boris

 2021-06-17 8:13 GMT-04:00, Williams Andy Inc :
 > I currently have a django project going on incase you want to learn or
 > contribute or collaborate for learning.
 >
 > https://swiss-social.herokuapp.com/
 >
 > code https://github.com/swisscodes/social-app
 >
 > anyone want to learn or collaborate msg me. we could do video
 learning by
 > zoom or google. can share my knowledge and learn from you
 >
 > On Thu, Jun 17, 2021 at 3:00 PM Nikeet NA 
 wrote:
 >
 >> OK that interesting I can help.
 >>
 >> On Thursday, 17 June 2021 at 17:03:28 UTC+5:30 flavie...@gmail.com
 wrote:
 >>
 >>> Actually im not working on any django project but i was working on
 >>> geodjango in the past
 >>> Flavien
 >>>
 >>> On 6/17/21, Nikeet NA  wrote:
 >>> > What type of project are you working upon ?
 >>> >
 >>> > On Thursday, 17 June 2021 at 16:51:01 UTC+5:30
 flavie...@gmail.com
 >>> wrote:
 >>> >
 >>> >> hi guys in term of improving my knowledge in building Django
 project,
 >>> >> i need to be a volunteer
 >>> >> I'm good in English and fluent in French
 >>> >>
 >>> >> My WhatsApp number:+243815357825 <+243%20815%20357%20825>
 <+243%20815%20357%20825>
 >>> <+243%20815%20357%20825>
 >>> >> thank you so much
 >>> >> Flavien
 >>> >>
 >>> >> --
 >>> >> FLAVIEN HERI
 >>> >>
 >>> >> *Information management AscociateUNHCR-Kinshasa*
 >>> >> Tél:+243978587009 <+243%20978%20587%20009>
 <+243%20978%20587%20009> <+243%20978%20587%20009>
 >>> >> Skype: flavien.heri1
 >>> >> Facebook: flavien semi
 >>> >>
 >>> >
 >>> > --
 >>> > 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 view this discussion on the web visit
 >>> >
 >>>
 https://groups.google.com/d/msgid/django-users/12f66979-6742-4552-b09e-eec6dc9e169an%40googlegroups.com
 .
 >>>
 >>> >
 >>>
 >>>
 >>> --
 >>> FLAVIEN HERI
 >>>
 >>> *Information management AscociateUNHCR-Kinshasa*
 >>> Tél:+243978587009 <+243%20978%20587%20009> <+243%20978%20587%20009>
 >>> Skype: flavien.heri1
 >>> Facebook: flavien semi
 >>>
 >> --
 >> 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 view this discussion on the web visit
 >>
 https://groups.google.com/d/msgid/django-users/6691c88c-14d5-40b1-91fe-7b8466c559a6n%40googlegroups.com
 >> <
 https://groups.google.com/d/msgid/django-users/6691c88c-14d5-40b1-91fe-7b8466c559a6n%40googlegroups.com?utm_medium=email_source=footer
 >
 >> .
 >>
 >
 > --
 > 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 view this discussion on the web visit
 >
 https://groups.google.com/d/msgid/django-users/CAPCthNK3ZOoO77OSo6wYFatzo-Y0KPx8OD33Q5b6%3DaFgrYufVw%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...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CAObPVPDK_3%2B0gmqfAt6FCpD4yAeuS1TgPcuPnvYd1E6wcZBDuw%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 project(website) and cpane

2021-06-17 Thread Peter Kirieny
would somebody please help me with the procedure on how to upload my django
website on cpanel
i used: python, pycharm, django,html css and some javascript
I've already bought a domain name and hosting and i can log into cpanel
please help.

-- 
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/CAL8t8eqJTRnRaZJo42U2EhiWpP6m_LLiwr1SK%3DQ35b6-BqkQpg%40mail.gmail.com.


Re: Need to volunteer in a django project to emprove my knowledge

2021-06-17 Thread Luciano Martins
it also accepts dev BR, but I don't speak english and I use google 
translator

Em quinta-feira, 17 de junho de 2021 às 14:40:43 UTC-3, swiss...@gmail.com 
escreveu:

> https://github.com/swisscodes
>
> On Thu, Jun 17, 2021 at 5:50 PM Williams Andy Inc  
> wrote:
>
>> Its open for anyone ready to participate just add me on my github or msg 
>> me here we can do some google meets or zoom ,,, for example now i want to 
>> add the edit and delete button using jquery and ajax.. so it stays on same 
>> page.
>> we can collaborate and learn
>>
>> On Thu, Jun 17, 2021 at 4:05 PM Boris Pérez  wrote:
>>
>>> I´m intrested on participate too...is it posiible??? Thanks, Boris
>>>
>>> 2021-06-17 8:13 GMT-04:00, Williams Andy Inc :
>>> > I currently have a django project going on incase you want to learn or
>>> > contribute or collaborate for learning.
>>> >
>>> > https://swiss-social.herokuapp.com/
>>> >
>>> > code https://github.com/swisscodes/social-app
>>> >
>>> > anyone want to learn or collaborate msg me. we could do video learning 
>>> by
>>> > zoom or google. can share my knowledge and learn from you
>>> >
>>> > On Thu, Jun 17, 2021 at 3:00 PM Nikeet NA  
>>> wrote:
>>> >
>>> >> OK that interesting I can help.
>>> >>
>>> >> On Thursday, 17 June 2021 at 17:03:28 UTC+5:30 flavie...@gmail.com 
>>> wrote:
>>> >>
>>> >>> Actually im not working on any django project but i was working on
>>> >>> geodjango in the past
>>> >>> Flavien
>>> >>>
>>> >>> On 6/17/21, Nikeet NA  wrote:
>>> >>> > What type of project are you working upon ?
>>> >>> >
>>> >>> > On Thursday, 17 June 2021 at 16:51:01 UTC+5:30 flavie...@gmail.com
>>> >>> wrote:
>>> >>> >
>>> >>> >> hi guys in term of improving my knowledge in building Django 
>>> project,
>>> >>> >> i need to be a volunteer
>>> >>> >> I'm good in English and fluent in French
>>> >>> >>
>>> >>> >> My WhatsApp number:+243815357825 <+243%20815%20357%20825> 
>>> <+243%20815%20357%20825>
>>> >>> <+243%20815%20357%20825>
>>> >>> >> thank you so much
>>> >>> >> Flavien
>>> >>> >>
>>> >>> >> --
>>> >>> >> FLAVIEN HERI
>>> >>> >>
>>> >>> >> *Information management AscociateUNHCR-Kinshasa*
>>> >>> >> Tél:+243978587009 <+243%20978%20587%20009> 
>>> <+243%20978%20587%20009> <+243%20978%20587%20009>
>>> >>> >> Skype: flavien.heri1
>>> >>> >> Facebook: flavien semi
>>> >>> >>
>>> >>> >
>>> >>> > --
>>> >>> > 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 view this discussion on the web visit
>>> >>> >
>>> >>> 
>>> https://groups.google.com/d/msgid/django-users/12f66979-6742-4552-b09e-eec6dc9e169an%40googlegroups.com
>>> .
>>> >>>
>>> >>> >
>>> >>>
>>> >>>
>>> >>> --
>>> >>> FLAVIEN HERI
>>> >>>
>>> >>> *Information management AscociateUNHCR-Kinshasa*
>>> >>> Tél:+243978587009 <+243%20978%20587%20009> <+243%20978%20587%20009>
>>> >>> Skype: flavien.heri1
>>> >>> Facebook: flavien semi
>>> >>>
>>> >> --
>>> >> 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 view this discussion on the web visit
>>> >> 
>>> https://groups.google.com/d/msgid/django-users/6691c88c-14d5-40b1-91fe-7b8466c559a6n%40googlegroups.com
>>> >> <
>>> https://groups.google.com/d/msgid/django-users/6691c88c-14d5-40b1-91fe-7b8466c559a6n%40googlegroups.com?utm_medium=email_source=footer
>>> >
>>> >> .
>>> >>
>>> >
>>> > --
>>> > 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 view this discussion on the web visit
>>> > 
>>> https://groups.google.com/d/msgid/django-users/CAPCthNK3ZOoO77OSo6wYFatzo-Y0KPx8OD33Q5b6%3DaFgrYufVw%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...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/CAObPVPDK_3%2B0gmqfAt6FCpD4yAeuS1TgPcuPnvYd1E6wcZBDuw%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/96fd4049-b1a3-417b-8fe5-7ad5929c307bn%40googlegroups.com.


Re: Hiring Django developers in Mumbai

2021-06-17 Thread Williams Andy Inc
Am not in india but ill like to collaborate with you so i can learn from
other developers and also add to my cv. here is my latest work.

https://swiss-social.herokuapp.com/

On Thu, Jun 17, 2021 at 10:00 PM Prasad Ajmire 
wrote:

> Interested
>
> On Sun, May 23, 2021, 9:28 AM Sidhesh D  wrote:
>
>> Hello,
>>
>> We are building a new website for kids to engage with our content and
>> showcase their projects. We are looking for a mid-level full-stack
>> developer.
>>
>>
>> Please mail your resume to care...@curiositygym.com.
>>
>> - sidhesh
>>
>> --
>> 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/a835a37b-a40d-4662-8ccc-c5abb8dc97f6n%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/CAJC%2BgnDz6P6gdnQwuX241pJsbTpzB%2BQ8Tc6%3D4YmZ5PX%2BW%2BSuxA%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/CAPCthNJz5uDt-YLAaSzzr_ijUSN7-KmH3iM%2Bkh27AN_sNNV5ng%40mail.gmail.com.


Re: Allow field validation in ajax.

2021-06-17 Thread Ayush Bisht
If you specifically trying to validate the form on the basis of empty input 
field, then simply include  *required* attribute in you input field
 **
and for more validation , you just validate all the thing in HTML only 
using django template tags... 
here I am including a descent approach ... 

 {% csrf_token %}
{% load bootstrap_tags %} 
   {{form.non_field_errors}}
   

 
   
   
   
 
  
*{% if form.username.errors %}*
*  {{form.username.errors}}  *
*  {% endif %}*
  Username  
   {{form.username}}
   


   
 
*   {% if form.email.errors %}*
*   {{form.email.errors}}  *
*   {% endif %}*
   Email   
  {{form.email}}
   


   


*   {% if form.password1.errors %}*
*   {{form.password1.errors}}  *
* {% endif %}*
   Enter the Password  
   
  {{form.password1}}
   


   

*   {% if form.password2.errors %} *
* {{form.password2.errors}}*
*   {% endif %} *
 Confirm Password
 

 {{form.password2}}
   
   
 
   
 
   *{% if form.captcha.errors %} *
* {{form.captcha.errors}}*
*   {% endif %}  *   
  Captcha
   {{form.captcha}}
 
 

   Register



if any validation error has caught , then it will shown at 
*{{form.captcha.errors}}*




On Thursday, June 17, 2021 at 4:04:48 AM UTC-7 eugenet...@gmail.com wrote:

> Dear NA,
>
> still it does not wark
>
> On Sun, 13 Jun 2021 at 03:20, Nikeet NA  wrote:
>
>> You are not submitting your form which Inturn is not validating. For 
>> validations to run you need to submit a form.
>>
>> Give the submit button attribute type="submit", then add an event 
>> listener for form submit in your javascript.
>> $("#ReportForm").on('submit', function(event) {
>>// here event is submit type event object
>>event.preventDefault() // this is added to prevent default 
>> execution of form submit event which will stop the page reload. 
>>// here event.target is your form so you can use that to get data 
>> as let data = new FormData(event.target) 
>> })
>>
>> On Saturday, 12 June 2021 at 22:09:26 UTC+5:30 eugenet...@gmail.com 
>> wrote:
>>
>>> Friends,
>>>
>>> The ajax codes below successfully save the records in the database 
>>> without page loading. But what I want is to validate the fields first 
>>> before saving. The codes do not validate the empty field. How can I include 
>>> that validation ? please help
>>>
>>> 
>>> $(".submit_btn").click(function(){
>>> var form=new FormData($("#ReportForm")[0]);
>>> //AJAX CODE
>>> var xhr=new XMLHttpRequest();
>>> xhr.onreadystatechange=function(){
>>> if(xhr.status==200){
>>> console.log(xhr.responseText);
>>> }
>>> }
>>> xhr.open("POST","{% url 'report_create' %}",true);
>>> $("#progressbar").show();
>>>
>>> //UPDATING PROGRESS BAR
>>> xhr.upload.addEventListener("progress",function(ev){
>>> if(ev.lengthComputable){
>>> var percentage=(ev.loaded/ev.total*100|0);
>>> $("#progressbar").css({"width":""+percentage+"%"}).text("Uploading .."+
>>> percentage+"%");
>>> console.log(percentage);
>>> if(percentage>=100){
>>> location.reload()
>>>
>>> }
>>> }
>>> });
>>>
>>> xhr.send(form);
>>> })
>>> 
>>>
>>> Regards,
>>> *Eugene*
>>>
>>>
>>> -- 
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/d4c70f2f-2b3f-4d64-a94a-ee31b9ecdd03n%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> *TUYIZERE Eugene*

Re: Hiring Django developers in Mumbai

2021-06-17 Thread Prasad Ajmire
Interested

On Sun, May 23, 2021, 9:28 AM Sidhesh D  wrote:

> Hello,
>
> We are building a new website for kids to engage with our content and
> showcase their projects. We are looking for a mid-level full-stack
> developer.
>
>
> Please mail your resume to care...@curiositygym.com.
>
> - sidhesh
>
> --
> 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/a835a37b-a40d-4662-8ccc-c5abb8dc97f6n%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/CAJC%2BgnDz6P6gdnQwuX241pJsbTpzB%2BQ8Tc6%3D4YmZ5PX%2BW%2BSuxA%40mail.gmail.com.


Re: In need of urgent help regarding dynamic image display v

2021-06-17 Thread Ayush Bisht
I think there is 2 method which you can do to get the work done. ...

*1 : first one* .. you can declare a property decorator which just return 
the url of that image 

 
  class Banner(BaseModel):
image = ResizedImageField(upload_to="banner", null=True, 
blank=True)

@property
  def get_image_url(self):
  return str(self.image.url).replace(" ", "")
 
and then you can simply access this function like normal attributes.. 

 
{% for banner in banners %}

{% endfor %}




*2 Method :  *you can create a   root path for static files as well 

 
STATIC_URL = '/static/'
STATICFILES_DIRS = [os.path.join(BASE_DIR,'static')]


now , with this root path I can access all the file belonging to that 
particular folder 

folder structure ... 

* static
   *Banner
 *banner1.jpg



now u can simply access all the stuff ...

.banner-item-01 {
padding:300px 0px;
background-size: cover;
background-image: url('/static/Banner/banner1.jpg');
background-repeat: no-repeat;
background-position: center center;
} 

On Thursday, June 17, 2021 at 4:11:11 AM UTC-7 arit...@gmail.com wrote:

> Hi, 
> I've been building a Django E-commerce website and I'm facing this problem.
> I have created a Banner model which will take in images via 
> django.ResizedImage and then display it in the homepage. But I'm unable to 
> process them in CSS.
> Kindly help me out.
>
> PS: I'll have to process it as background-image orelse when passed as 
>  in html, we're getting extra wrapped spaces which aren't needed.
>
> Below given are: views.py, models.py, index.html, css block. 
> Kindly help me out as it is urgent. Thank you for your support in advance.
>
> Regards,
> Aritra
>
> class HomeView(ListView):
> context_object_name = 'items'
> template_name = "index.html"
> queryset = Items.objects.all()
>
> def get_context_data(self, **kwargs):
> context = super(HomeView, self).get_context_data(**kwargs)
> context['banners'] = Banner.objects.all()
> return context
>
> class Banner(BaseModel):
> image = ResizedImageField(upload_to="banner", null=True, blank=True)
>
> 
> 
>   {% for banner in banners %}
> 
>   {% endfor %}
> 
> 
>
>   .banner-item-01 {
>padding:300px 0px;
>background-size: cover;
>background-image: url(var(--item));
>background-repeat: no-repeat;
>background-position: center center;
> }  
>
>
>

-- 
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/241a1f08-a093-4f3a-a01f-46e0a3e73ce1n%40googlegroups.com.


Re: Adding Two Models In Django

2021-06-17 Thread Ayush Bisht

class Year(models.Model):
year = models.IntegerField()


class Month(models.Model):
MONTH_CHOICE = (
(1 , "Jan"),
(2, 'Feb'),
(3, 'March'),
(4, 'April'),
(5, 'May'),
(6, 'June'),
(7, 'July'),
(8, 'Aug'),
(9, 'Sept'),
(10, 'Oct'),
(11, 'Nov'),
(12, 'Dec')

)
month = models.PositiveSmallIntegerField(choices = MONTH_CHOICE)
year = models.ForeignKey(Year, on_delete= models.SET_NULL)


class Student(models.Model):
name = models.CharField(max_length=266)
admission_month = models.ForeignKey(Month, on_delete=models.SET_NULL)


you can proceed with this approach also... 

On Wednesday, June 16, 2021 at 2:37:34 PM UTC-7 adesolar...@gmail.com wrote:

> Good day,
> Please how can this be achieved?
> Best regards.
>
> On Wed, Jun 16, 2021, 7:01 PM Ridwan Adeyemo  
> wrote:
>
>> Thanks man.
>>
>> On Wed, Jun 16, 2021, 5:22 PM Ayush Bisht  wrote:
>>
>>> I think you are trying to sum up the value of two model fields and store 
>>> them in some other field. 
>>>
>>>
>>> so for that u can proceed from base. 
>>>
>>> simple you just have to update that field in save method
>>>
>>> for example : 
>>>  *class Student(models.Model):*
>>>maths_score = models.DecimalField()
>>>english_score = models.DecimalFIeld()
>>>Total_score   = models.DecimalField(default = 0)
>>>
>>>*def save(self, *args, **kwargs):*
>>> *  self.Total_score  = self.maths_score  + self.english_score*
>>>   super(Student, self).save(*args, **kwargs)
>>>
>>>
>>>
>>> or you can proceed with clean() method also. 
>>> On Tuesday, June 15, 2021 at 11:34:37 AM UTC-7 adesolar...@gmail.com 
>>> wrote:
>>>
 How do I add two models together in the database, two different 
 DecimalField. 
 i.e math_score + eng_score = total_score

>>> -- 
>>> 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/qsaj_ELIfgA/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> django-users...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/81d7b7b1-9521-47b1-9fef-91be3ba4c952n%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/41290c5b-17f5-4be5-94a2-5ba9db079b02n%40googlegroups.com.


Re: Need to volunteer in a django project to emprove my knowledge

2021-06-17 Thread Williams Andy Inc
https://github.com/swisscodes

On Thu, Jun 17, 2021 at 5:50 PM Williams Andy Inc 
wrote:

> Its open for anyone ready to participate just add me on my github or msg
> me here we can do some google meets or zoom ,,, for example now i want to
> add the edit and delete button using jquery and ajax.. so it stays on same
> page.
> we can collaborate and learn
>
> On Thu, Jun 17, 2021 at 4:05 PM Boris Pérez  wrote:
>
>> I´m intrested on participate too...is it posiible??? Thanks, Boris
>>
>> 2021-06-17 8:13 GMT-04:00, Williams Andy Inc :
>> > I currently have a django project going on incase you want to learn or
>> > contribute or collaborate for learning.
>> >
>> > https://swiss-social.herokuapp.com/
>> >
>> > code https://github.com/swisscodes/social-app
>> >
>> > anyone want to learn or collaborate msg me. we could do video learning
>> by
>> > zoom or google. can share my knowledge and learn from you
>> >
>> > On Thu, Jun 17, 2021 at 3:00 PM Nikeet NA 
>> wrote:
>> >
>> >> OK that interesting I can help.
>> >>
>> >> On Thursday, 17 June 2021 at 17:03:28 UTC+5:30 flavie...@gmail.com
>> wrote:
>> >>
>> >>> Actually im not working on any django project but i was working on
>> >>> geodjango in the past
>> >>> Flavien
>> >>>
>> >>> On 6/17/21, Nikeet NA  wrote:
>> >>> > What type of project are you working upon ?
>> >>> >
>> >>> > On Thursday, 17 June 2021 at 16:51:01 UTC+5:30 flavie...@gmail.com
>> >>> wrote:
>> >>> >
>> >>> >> hi guys in term of improving my knowledge in building Django
>> project,
>> >>> >> i need to be a volunteer
>> >>> >> I'm good in English and fluent in French
>> >>> >>
>> >>> >> My WhatsApp number:+243815357825 <+243%20815%20357%20825>
>> >>> <+243%20815%20357%20825>
>> >>> >> thank you so much
>> >>> >> Flavien
>> >>> >>
>> >>> >> --
>> >>> >> FLAVIEN HERI
>> >>> >>
>> >>> >> *Information management AscociateUNHCR-Kinshasa*
>> >>> >> Tél:+243978587009 <+243%20978%20587%20009> <+243%20978%20587%20009>
>> >>> >> Skype: flavien.heri1
>> >>> >> Facebook: flavien semi
>> >>> >>
>> >>> >
>> >>> > --
>> >>> > 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 view this discussion on the web visit
>> >>> >
>> >>>
>> https://groups.google.com/d/msgid/django-users/12f66979-6742-4552-b09e-eec6dc9e169an%40googlegroups.com
>> .
>> >>>
>> >>> >
>> >>>
>> >>>
>> >>> --
>> >>> FLAVIEN HERI
>> >>>
>> >>> *Information management AscociateUNHCR-Kinshasa*
>> >>> Tél:+243978587009 <+243%20978%20587%20009>
>> >>> Skype: flavien.heri1
>> >>> Facebook: flavien semi
>> >>>
>> >> --
>> >> 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/6691c88c-14d5-40b1-91fe-7b8466c559a6n%40googlegroups.com
>> >> <
>> https://groups.google.com/d/msgid/django-users/6691c88c-14d5-40b1-91fe-7b8466c559a6n%40googlegroups.com?utm_medium=email_source=footer
>> >
>> >> .
>> >>
>> >
>> > --
>> > 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/CAPCthNK3ZOoO77OSo6wYFatzo-Y0KPx8OD33Q5b6%3DaFgrYufVw%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/CAObPVPDK_3%2B0gmqfAt6FCpD4yAeuS1TgPcuPnvYd1E6wcZBDuw%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/CAPCthNJV%3D9jEXfaM1RKywkYpE%2BONA8M1%2B9RV%3DFD6JmwNaM59hA%40mail.gmail.com.


Re: How to use django template tags in .js file ??

2021-06-17 Thread Ayush Bisht
thanks, It works for me  

On Wednesday, June 16, 2021 at 12:08:20 PM UTC-7 Nikeet NA wrote:

> Or you can store the url in the variable then use it.
>
> On Thursday, 17 June 2021 at 00:29:00 UTC+5:30 Nikeet NA wrote:
>
>> Do like this use 
>> var obj_slug = object.slug inside script tag below it include your js 
>> file with the above js script. in js file you can acces it with obj_slug 
>> variable.
>>
>> On Wednesday, 16 June 2021 at 22:31:39 UTC+5:30 kuassi...@paydunya.com 
>> wrote:
>>
>>> I also had the problem once. But what I understood is that the 
>>> interpretation of the DJANGO syntax in statics files only works when the 
>>> file has an HTML extension. So if you really want to do something separate 
>>> with the script you can just create another HTML file but in another folder 
>>> where you will put the script content surrounded by the SCRIPT tags and 
>>> then you will just include with the directive {% INCLUDE %} in 
>>> your main HTML file.
>>>
>>> On Wednesday, June 16, 2021 at 3:59:16 PM UTC bisht.a...@gmail.com 
>>> wrote:
>>>
 while doing great stuff with django I have found some clumsy behaviour 
 of django in handling .js file. Is there a way to effectively integrate 
 all 
 the stuff of   in a separate file and effectively used it 
 with rest of the html code. 

 for example : 

 // *file.html 
 ..*

 
   

 >>> method="POST" id="likes-form">
 {% csrf_token %}

 >>> id="like-{{
 object.pk}}">
 
   
   
 {{ object.total_likes }}
   
 




 //  *file.js file*  
 ..

 $("#likes-form").submit(function (e)
 {  e.preventDefault();
   var serializedData = $(this).serializeArray();
   $.ajax({
   type: 'POST',
   url: '{% url 'blog_likes' object.slug  %}',
   data: serializedData,
   success: function (response) {
 var like_count = JSON.parse(response["like"]);
 like_flag = JSON.parse(response["flag"]);
 
 console.log(like_flag);
   
 if(like_flag == 0){  
 $(".like-inner-flex-1").toggleClass('like-animate');   
   }else
   $(".like-inner-flex-1").toggleClass('like-animate'); 
   
   if(like_flag){

   $('.like-btn').css({"background-color": "#d629801a" , "outline": 
 "none"});

 $('.like-inner-flex-1').css({"background-position": "right",  
 "filter": "grayscale(0%)"});

 } else {

 $('.like-btn').css({"background-color": "transparent", "outline": 
 "none"});

 $('.like-inner-flex-1').css({"background-position": "right",  
 "filter": "grayscale(100%)"});

 }

 $("#likes").text(`${like_count}`);
 }})
 })

 ..

 if I use above script inside the same html file then it works, but in 
 above case its not working ?? If there is any work around to do this thing 
 , then please suggest me .

 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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0e2ac9d2-60ef-4acf-b69f-8f0ba70eeffbn%40googlegroups.com.


Re: Need to volunteer in a django project to emprove my knowledge

2021-06-17 Thread Williams Andy Inc
Its open for anyone ready to participate just add me on my github or msg me
here we can do some google meets or zoom ,,, for example now i want to add
the edit and delete button using jquery and ajax.. so it stays on same page.
we can collaborate and learn

On Thu, Jun 17, 2021 at 4:05 PM Boris Pérez  wrote:

> I´m intrested on participate too...is it posiible??? Thanks, Boris
>
> 2021-06-17 8:13 GMT-04:00, Williams Andy Inc :
> > I currently have a django project going on incase you want to learn or
> > contribute or collaborate for learning.
> >
> > https://swiss-social.herokuapp.com/
> >
> > code https://github.com/swisscodes/social-app
> >
> > anyone want to learn or collaborate msg me. we could do video learning by
> > zoom or google. can share my knowledge and learn from you
> >
> > On Thu, Jun 17, 2021 at 3:00 PM Nikeet NA 
> wrote:
> >
> >> OK that interesting I can help.
> >>
> >> On Thursday, 17 June 2021 at 17:03:28 UTC+5:30 flavie...@gmail.com
> wrote:
> >>
> >>> Actually im not working on any django project but i was working on
> >>> geodjango in the past
> >>> Flavien
> >>>
> >>> On 6/17/21, Nikeet NA  wrote:
> >>> > What type of project are you working upon ?
> >>> >
> >>> > On Thursday, 17 June 2021 at 16:51:01 UTC+5:30 flavie...@gmail.com
> >>> wrote:
> >>> >
> >>> >> hi guys in term of improving my knowledge in building Django
> project,
> >>> >> i need to be a volunteer
> >>> >> I'm good in English and fluent in French
> >>> >>
> >>> >> My WhatsApp number:+243815357825 <+243%20815%20357%20825>
> >>> <+243%20815%20357%20825>
> >>> >> thank you so much
> >>> >> Flavien
> >>> >>
> >>> >> --
> >>> >> FLAVIEN HERI
> >>> >>
> >>> >> *Information management AscociateUNHCR-Kinshasa*
> >>> >> Tél:+243978587009 <+243%20978%20587%20009> <+243%20978%20587%20009>
> >>> >> Skype: flavien.heri1
> >>> >> Facebook: flavien semi
> >>> >>
> >>> >
> >>> > --
> >>> > 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 view this discussion on the web visit
> >>> >
> >>>
> https://groups.google.com/d/msgid/django-users/12f66979-6742-4552-b09e-eec6dc9e169an%40googlegroups.com
> .
> >>>
> >>> >
> >>>
> >>>
> >>> --
> >>> FLAVIEN HERI
> >>>
> >>> *Information management AscociateUNHCR-Kinshasa*
> >>> Tél:+243978587009 <+243%20978%20587%20009>
> >>> Skype: flavien.heri1
> >>> Facebook: flavien semi
> >>>
> >> --
> >> 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/6691c88c-14d5-40b1-91fe-7b8466c559a6n%40googlegroups.com
> >> <
> https://groups.google.com/d/msgid/django-users/6691c88c-14d5-40b1-91fe-7b8466c559a6n%40googlegroups.com?utm_medium=email_source=footer
> >
> >> .
> >>
> >
> > --
> > 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/CAPCthNK3ZOoO77OSo6wYFatzo-Y0KPx8OD33Q5b6%3DaFgrYufVw%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/CAObPVPDK_3%2B0gmqfAt6FCpD4yAeuS1TgPcuPnvYd1E6wcZBDuw%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/CAPCthNJ-85ZVDjr6Eat37t2DvKctBXv%2B0VaHRMh-pXBGnKs%3DLQ%40mail.gmail.com.


Re: In need of urgent help regarding dynamic image display v

2021-06-17 Thread Arjun Kumar
Hi all,

Anyone having complete practical knowledge of Django. Kindly help me to do
so.

Warm regards,
Arjun Kumar
Delhi, India


On Thu, 17 Jun 2021 at 16:40, Aritra Ray  wrote:

> Hi,
> I've been building a Django E-commerce website and I'm facing this problem.
> I have created a Banner model which will take in images via
> django.ResizedImage and then display it in the homepage. But I'm unable to
> process them in CSS.
> Kindly help me out.
>
> PS: I'll have to process it as background-image orelse when passed as
>  in html, we're getting extra wrapped spaces which aren't needed.
>
> Below given are: views.py, models.py, index.html, css block.
> Kindly help me out as it is urgent. Thank you for your support in advance.
>
> Regards,
> Aritra
>
> class HomeView(ListView):
> context_object_name = 'items'
> template_name = "index.html"
> queryset = Items.objects.all()
>
> def get_context_data(self, **kwargs):
> context = super(HomeView, self).get_context_data(**kwargs)
> context['banners'] = Banner.objects.all()
> return context
>
> class Banner(BaseModel):
> image = ResizedImageField(upload_to="banner", null=True, blank=True)
>
> 
> 
>   {% for banner in banners %}
> 
>   {% endfor %}
> 
> 
>
>   .banner-item-01 {
>padding:300px 0px;
>background-size: cover;
>background-image: url(var(--item));
>background-repeat: no-repeat;
>background-position: center center;
> }
>
>
> --
> 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/CAFecadvDi5V4%3DuetJhSZo1FSyOyGsvLH_s7K%2Bhc-vMLU%2BHLBpA%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/CAFURcXxyVB-jjAr9Duruehs5HTdUugos55gp1vMhm1ODrd6ehQ%40mail.gmail.com.


Re: Need to volunteer in a django project to emprove my knowledge

2021-06-17 Thread Boris Pérez
I´m intrested on participate too...is it posiible??? Thanks, Boris

2021-06-17 8:13 GMT-04:00, Williams Andy Inc :
> I currently have a django project going on incase you want to learn or
> contribute or collaborate for learning.
>
> https://swiss-social.herokuapp.com/
>
> code https://github.com/swisscodes/social-app
>
> anyone want to learn or collaborate msg me. we could do video learning by
> zoom or google. can share my knowledge and learn from you
>
> On Thu, Jun 17, 2021 at 3:00 PM Nikeet NA  wrote:
>
>> OK that interesting I can help.
>>
>> On Thursday, 17 June 2021 at 17:03:28 UTC+5:30 flavie...@gmail.com wrote:
>>
>>> Actually im not working on any django project but i was working on
>>> geodjango in the past
>>> Flavien
>>>
>>> On 6/17/21, Nikeet NA  wrote:
>>> > What type of project are you working upon ?
>>> >
>>> > On Thursday, 17 June 2021 at 16:51:01 UTC+5:30 flavie...@gmail.com
>>> wrote:
>>> >
>>> >> hi guys in term of improving my knowledge in building Django project,
>>> >> i need to be a volunteer
>>> >> I'm good in English and fluent in French
>>> >>
>>> >> My WhatsApp number:+243815357825 <+243%20815%20357%20825>
>>> <+243%20815%20357%20825>
>>> >> thank you so much
>>> >> Flavien
>>> >>
>>> >> --
>>> >> FLAVIEN HERI
>>> >>
>>> >> *Information management AscociateUNHCR-Kinshasa*
>>> >> Tél:+243978587009 <+243%20978%20587%20009> <+243%20978%20587%20009>
>>> >> Skype: flavien.heri1
>>> >> Facebook: flavien semi
>>> >>
>>> >
>>> > --
>>> > 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 view this discussion on the web visit
>>> >
>>> https://groups.google.com/d/msgid/django-users/12f66979-6742-4552-b09e-eec6dc9e169an%40googlegroups.com.
>>>
>>> >
>>>
>>>
>>> --
>>> FLAVIEN HERI
>>>
>>> *Information management AscociateUNHCR-Kinshasa*
>>> Tél:+243978587009 <+243%20978%20587%20009>
>>> Skype: flavien.heri1
>>> Facebook: flavien semi
>>>
>> --
>> 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/6691c88c-14d5-40b1-91fe-7b8466c559a6n%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/CAPCthNK3ZOoO77OSo6wYFatzo-Y0KPx8OD33Q5b6%3DaFgrYufVw%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/CAObPVPDK_3%2B0gmqfAt6FCpD4yAeuS1TgPcuPnvYd1E6wcZBDuw%40mail.gmail.com.


Re: using .annotate on a queryset and output field is a result of function

2021-06-17 Thread Nikeet NA
Its not the perfect method you can optimize ot more if you want.
You can prefer this Link


On Thu, 17 Jun 2021 at 18:06, Nikeet NA  wrote:

> You can do it like this :
>
> class TransactionEntry(models.Manager):
>def get_total_prices(self):
>  return
> self.queryset().defer("users").annotate.(total_price=F("num_shares")*F("price_per_share"))
>
> On Thu, 17 Jun 2021 at 15:31, VISHESH MANGLA <
> f20170...@pilani.bits-pilani.ac.in> wrote:
>
>> what about overwriting the manager? How to make the manager auto-add
>> those computed properties ?
>>
>> On Thursday, June 17, 2021 at 8:50:27 AM UTC+5:30 Nikeet NA wrote:
>>
>>> You cannot use properties in django orm , it does not allow that.
>>>
>>> TransactionEntry.objects.defer("users").annotate(total_price=F("num_shares")*F("price_per_share")).values('total_price')
>>> On Thursday, 17 June 2021 at 03:23:01 UTC+5:30 VISHESH MANGLA wrote:
>>>
 Hello,

 I wanted to know that how for the model below,  how can I get a
 queryset with  all the fields excluding the `user` and including the
 output of get_output_field? Please avoid hardcoding.
 One way is

 `TransactionEntry
 .objects.defer("users").annotate(total_price=F("num_shares")*F("price_per_share"))`

 but that is undesirable. I just want to use that function on the model
 and not hard code the formula.
 Thanks,



 class TransactionEntry(models.Model):
 """Model to save data of users who want to buy/sell shares"""

 user = models.ForeignKey(
 to=Relative,
 on_delete=models.CASCADE,
 related_name="transaction_entry",
 )

 num_shares = models.PositiveIntegerField(null=False, blank=False)
 date_of_trade = models.DateField(null=False, blank=False)
 transaction_type = models.CharField(
 max_length=1,
 choices=TransactionType.choices,
 default=TransactionType.SELL,
 null=False,
 )
 price_per_share = models.FloatField(null=False, blank=False)

 def get_total_price(self):
 return self.num_shares * self.price_per_share

 --
>> 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/35d917c8-e321-42eb-8050-f7849c0374e8n%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/CAFOOHnP8Y285E9HztCq8LUcTwZ3G%2BDT2T%2BgB35j_JfdK8va6ow%40mail.gmail.com.


Re: using .annotate on a queryset and output field is a result of function

2021-06-17 Thread Nikeet NA
You can do it like this :

class TransactionEntry(models.Manager):
   def get_total_prices(self):
 return
self.queryset().defer("users").annotate.(total_price=F("num_shares")*F("price_per_share"))

On Thu, 17 Jun 2021 at 15:31, VISHESH MANGLA <
f20170...@pilani.bits-pilani.ac.in> wrote:

> what about overwriting the manager? How to make the manager auto-add those
> computed properties ?
>
> On Thursday, June 17, 2021 at 8:50:27 AM UTC+5:30 Nikeet NA wrote:
>
>> You cannot use properties in django orm , it does not allow that.
>>
>> TransactionEntry.objects.defer("users").annotate(total_price=F("num_shares")*F("price_per_share")).values('total_price')
>> On Thursday, 17 June 2021 at 03:23:01 UTC+5:30 VISHESH MANGLA wrote:
>>
>>> Hello,
>>>
>>> I wanted to know that how for the model below,  how can I get a queryset
>>> with  all the fields excluding the `user` and including the  output of
>>> get_output_field? Please avoid hardcoding.
>>> One way is
>>>
>>> `TransactionEntry
>>> .objects.defer("users").annotate(total_price=F("num_shares")*F("price_per_share"))`
>>>
>>> but that is undesirable. I just want to use that function on the model
>>> and not hard code the formula.
>>> Thanks,
>>>
>>>
>>>
>>> class TransactionEntry(models.Model):
>>> """Model to save data of users who want to buy/sell shares"""
>>>
>>> user = models.ForeignKey(
>>> to=Relative,
>>> on_delete=models.CASCADE,
>>> related_name="transaction_entry",
>>> )
>>>
>>> num_shares = models.PositiveIntegerField(null=False, blank=False)
>>> date_of_trade = models.DateField(null=False, blank=False)
>>> transaction_type = models.CharField(
>>> max_length=1,
>>> choices=TransactionType.choices,
>>> default=TransactionType.SELL,
>>> null=False,
>>> )
>>> price_per_share = models.FloatField(null=False, blank=False)
>>>
>>> def get_total_price(self):
>>> return self.num_shares * self.price_per_share
>>>
>>> --
> 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/35d917c8-e321-42eb-8050-f7849c0374e8n%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/CAFOOHnOj%2BhdAvGe9AZs-oQwrhN%3DP%3DwRy9072ki3nY4wQByRZoQ%40mail.gmail.com.


Re: Need to volunteer in a django project to emprove my knowledge

2021-06-17 Thread FLAVIEN HERI
thank you very much im available
Flavien

On 6/17/21, Nikeet NA  wrote:
> OK that interesting I can help.
>
> On Thursday, 17 June 2021 at 17:03:28 UTC+5:30 flavie...@gmail.com wrote:
>
>> Actually im not working on any django project but i was working on
>> geodjango in the past
>> Flavien
>>
>> On 6/17/21, Nikeet NA  wrote:
>> > What type of project are you working upon ?
>> >
>> > On Thursday, 17 June 2021 at 16:51:01 UTC+5:30 flavie...@gmail.com
>> wrote:
>> >
>> >> hi guys in term of improving my knowledge in building Django project,
>> >> i need to be a volunteer
>> >> I'm good in English and fluent in French
>> >>
>> >> My WhatsApp number:+243815357825 <+243%20815%20357%20825>
>> <+243%20815%20357%20825>
>> >> thank you so much
>> >> Flavien
>> >>
>> >> --
>> >> FLAVIEN HERI
>> >>
>> >> *Information management AscociateUNHCR-Kinshasa*
>> >> Tél:+243978587009 <+243%20978%20587%20009> <+243%20978%20587%20009>
>> >> Skype: flavien.heri1
>> >> Facebook: flavien semi
>> >>
>> >
>> > --
>> > 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 view this discussion on the web visit
>> >
>> https://groups.google.com/d/msgid/django-users/12f66979-6742-4552-b09e-eec6dc9e169an%40googlegroups.com
>> .
>> >
>>
>>
>> --
>> FLAVIEN HERI
>>
>> *Information management AscociateUNHCR-Kinshasa*
>> Tél:+243978587009 <+243%20978%20587%20009>
>> Skype: flavien.heri1
>> Facebook: flavien semi
>>
>
> --
> 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/6691c88c-14d5-40b1-91fe-7b8466c559a6n%40googlegroups.com.
>


-- 
FLAVIEN HERI

*Information management AscociateUNHCR-Kinshasa*
Tél:+243978587009
Skype: flavien.heri1
Facebook: flavien semi

-- 
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/CAG3GEnxF3HR-fqgU_9oXxRUg8-qdwWP6wtTCKGKDYMOz_1xmuw%40mail.gmail.com.


Re: Need to volunteer in a django project to emprove my knowledge

2021-06-17 Thread Williams Andy Inc
I currently have a django project going on incase you want to learn or
contribute or collaborate for learning.

https://swiss-social.herokuapp.com/

code https://github.com/swisscodes/social-app

anyone want to learn or collaborate msg me. we could do video learning by
zoom or google. can share my knowledge and learn from you

On Thu, Jun 17, 2021 at 3:00 PM Nikeet NA  wrote:

> OK that interesting I can help.
>
> On Thursday, 17 June 2021 at 17:03:28 UTC+5:30 flavie...@gmail.com wrote:
>
>> Actually im not working on any django project but i was working on
>> geodjango in the past
>> Flavien
>>
>> On 6/17/21, Nikeet NA  wrote:
>> > What type of project are you working upon ?
>> >
>> > On Thursday, 17 June 2021 at 16:51:01 UTC+5:30 flavie...@gmail.com
>> wrote:
>> >
>> >> hi guys in term of improving my knowledge in building Django project,
>> >> i need to be a volunteer
>> >> I'm good in English and fluent in French
>> >>
>> >> My WhatsApp number:+243815357825 <+243%20815%20357%20825>
>> <+243%20815%20357%20825>
>> >> thank you so much
>> >> Flavien
>> >>
>> >> --
>> >> FLAVIEN HERI
>> >>
>> >> *Information management AscociateUNHCR-Kinshasa*
>> >> Tél:+243978587009 <+243%20978%20587%20009> <+243%20978%20587%20009>
>> >> Skype: flavien.heri1
>> >> Facebook: flavien semi
>> >>
>> >
>> > --
>> > 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 view this discussion on the web visit
>> >
>> https://groups.google.com/d/msgid/django-users/12f66979-6742-4552-b09e-eec6dc9e169an%40googlegroups.com.
>>
>> >
>>
>>
>> --
>> FLAVIEN HERI
>>
>> *Information management AscociateUNHCR-Kinshasa*
>> Tél:+243978587009 <+243%20978%20587%20009>
>> Skype: flavien.heri1
>> Facebook: flavien semi
>>
> --
> 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/6691c88c-14d5-40b1-91fe-7b8466c559a6n%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/CAPCthNK3ZOoO77OSo6wYFatzo-Y0KPx8OD33Q5b6%3DaFgrYufVw%40mail.gmail.com.


Re: Need to volunteer in a django project to emprove my knowledge

2021-06-17 Thread Nikeet NA
OK that interesting I can help.

On Thursday, 17 June 2021 at 17:03:28 UTC+5:30 flavie...@gmail.com wrote:

> Actually im not working on any django project but i was working on
> geodjango in the past
> Flavien
>
> On 6/17/21, Nikeet NA  wrote:
> > What type of project are you working upon ?
> >
> > On Thursday, 17 June 2021 at 16:51:01 UTC+5:30 flavie...@gmail.com 
> wrote:
> >
> >> hi guys in term of improving my knowledge in building Django project,
> >> i need to be a volunteer
> >> I'm good in English and fluent in French
> >>
> >> My WhatsApp number:+243815357825 <+243%20815%20357%20825> 
> <+243%20815%20357%20825>
> >> thank you so much
> >> Flavien
> >>
> >> --
> >> FLAVIEN HERI
> >>
> >> *Information management AscociateUNHCR-Kinshasa*
> >> Tél:+243978587009 <+243%20978%20587%20009> <+243%20978%20587%20009>
> >> Skype: flavien.heri1
> >> Facebook: flavien semi
> >>
> >
> > --
> > 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 view this discussion on the web visit
> > 
> https://groups.google.com/d/msgid/django-users/12f66979-6742-4552-b09e-eec6dc9e169an%40googlegroups.com
> .
> >
>
>
> -- 
> FLAVIEN HERI
>
> *Information management AscociateUNHCR-Kinshasa*
> Tél:+243978587009 <+243%20978%20587%20009>
> Skype: flavien.heri1
> Facebook: flavien semi
>

-- 
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/6691c88c-14d5-40b1-91fe-7b8466c559a6n%40googlegroups.com.


Re: Need to volunteer in a django project to emprove my knowledge

2021-06-17 Thread FLAVIEN HERI
Actually im not working on any django project but i was working on
geodjango in the past
Flavien

On 6/17/21, Nikeet NA  wrote:
> What type of project are you working upon ?
>
> On Thursday, 17 June 2021 at 16:51:01 UTC+5:30 flavie...@gmail.com wrote:
>
>> hi guys in term of improving my knowledge in building Django project,
>> i need to be a volunteer
>> I'm good in English and fluent in French
>>
>> My WhatsApp number:+243815357825 <+243%20815%20357%20825>
>> thank you so much
>> Flavien
>>
>> --
>> FLAVIEN HERI
>>
>> *Information management AscociateUNHCR-Kinshasa*
>> Tél:+243978587009 <+243%20978%20587%20009>
>> Skype: flavien.heri1
>> Facebook: flavien semi
>>
>
> --
> 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/12f66979-6742-4552-b09e-eec6dc9e169an%40googlegroups.com.
>


-- 
FLAVIEN HERI

*Information management AscociateUNHCR-Kinshasa*
Tél:+243978587009
Skype: flavien.heri1
Facebook: flavien semi

-- 
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/CAG3GEny2iEH74BCQ1b-xTqBwUGn1JQZNvUUYZdw4eAV23ihMxg%40mail.gmail.com.


Re: Need to volunteer in a django project to emprove my knowledge

2021-06-17 Thread Nikeet NA
What type of project are you working upon ?

On Thursday, 17 June 2021 at 16:51:01 UTC+5:30 flavie...@gmail.com wrote:

> hi guys in term of improving my knowledge in building Django project,
> i need to be a volunteer
> I'm good in English and fluent in French
>
> My WhatsApp number:+243815357825 <+243%20815%20357%20825>
> thank you so much
> Flavien
>
> -- 
> FLAVIEN HERI
>
> *Information management AscociateUNHCR-Kinshasa*
> Tél:+243978587009 <+243%20978%20587%20009>
> Skype: flavien.heri1
> Facebook: flavien semi
>

-- 
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/12f66979-6742-4552-b09e-eec6dc9e169an%40googlegroups.com.


Need to volunteer in a django project to emprove my knowledge

2021-06-17 Thread FLAVIEN HERI
hi guys in term of improving my knowledge in building Django project,
i  need to be a volunteer
I'm good in English and fluent in French

My WhatsApp number:+243815357825
thank you so much
Flavien

-- 
FLAVIEN HERI

*Information management AscociateUNHCR-Kinshasa*
Tél:+243978587009
Skype: flavien.heri1
Facebook: flavien semi

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


Re: In need of help regarding HTML Submit button

2021-06-17 Thread Aritra Ray
Thank you, it worked!

On Tue, 15 Jun 2021 at 00:13, Nikeet NA  wrote:

> Change the type of button back to type='button" rather than type="submit"
>
> On Monday, 14 June 2021 at 22:39:27 UTC+5:30 arit...@gmail.com wrote:
>
>> Hi,
>> I'm facing an error with the Place Order button not working when the user
>> is choosing the default address. Kindly help me out in this regard and let
>> me know if any other files are needed.
>> Thank you in advance
>> Regards,
>> Aritra.
>>
>> class Address(BaseModel):
>> user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True, 
>> blank=True)
>> address = models.CharField(max_length=500, null=True)
>> phone = models.CharField(max_length=10, null=False)
>> city = models.CharField(max_length=100, null=True)
>> state = models.CharField(max_length=100, null=True)
>> pincode = models.CharField(max_length=100, null=False)
>> default = models.BooleanField(default=False, null=True, blank=True)
>>
>> def __str__(self):
>> return self.user.username
>>
>> class Meta:
>> verbose_name_plural = 'Addresses'
>>
>> 
>>  {% if default_address %}
>>  
>>  > id="use_default">
>>  Use default 
>> shipping address: {{ default_address.address|truncatechars:40 }}
>>  
>>  {% endif %}
>> 
>> 
>>  
>>  > >Back
>>  
>>  Place 
>> Order
>> 
>>
>> class CheckoutView(View):
>> def get(self, *args, **kwargs):
>> try:
>> order = Cart.objects.get(user=self.request.user, ordered=False)
>> form = CheckoutForm()
>> context = {
>> 'form': form,
>> 'order': order,
>> }
>>
>> shipping_address_qs = Address.objects.filter(
>> user=self.request.user,
>> default=True
>> )
>> if shipping_address_qs.exists():
>> context.update(
>> {'default_address': shipping_address_qs[0]})
>> return render(self.request, "checkout.html", context)
>> except ObjectDoesNotExist:
>> messages.info(self.request, "You do not have an active order")
>> return redirect(reverse('store:cart-page'))
>>
>> def post(self, *args, **kwargs):
>> form = CheckoutForm(self.request.POST)
>> try:
>> order = Cart.objects.get(user=self.request.user, ordered=False)
>> if form.is_valid():
>> use_default = form.cleaned_data.get(
>> 'use_default')
>> if use_default:
>> print("Using the default shipping address")
>> address_qs = Address.objects.filter(
>> user=self.request.user,
>> default=True
>> )
>> if address_qs.exists():
>> shipping_address = address_qs[0]
>> order.shipping_address = shipping_address
>> order.save()
>> else:
>> messages.info(self.request, "No default shipping 
>> address available")
>> return redirect('store:cart-page')
>> else:
>> address = form.cleaned_data.get('address')
>> pincode = form.cleaned_data.get('zip')
>> phone = form.cleaned_data.get('phone')
>> city = form.cleaned_data.get('city')
>> state = form.cleaned_data.get('state')
>> if form.is_valid():
>> shipping_address = Address(
>> user=self.request.user,
>> address=address,
>> pincode=pincode,
>> state=state,
>> city=city,
>> phone=phone
>> )
>> shipping_address.save()
>> order.shipping_address = shipping_address
>> order.save()
>>
>> set_default = form.cleaned_data.get(
>> 'set_default')
>> if set_default:
>> shipping_address.default = True
>> shipping_address.save()
>>
>> else:
>> messages.info(self.request, "Please fill in the 
>> required shipping address fields")
>> except ObjectDoesNotExist:
>> messages.warning(self.request, "You do not have an active order")
>> return redirect(reverse('store:cart-page'))
>> return redirect(reverse('store:payment-page'))
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails 

In need of urgent help regarding dynamic image display v

2021-06-17 Thread Aritra Ray
Hi,
I've been building a Django E-commerce website and I'm facing this problem.
I have created a Banner model which will take in images via
django.ResizedImage and then display it in the homepage. But I'm unable to
process them in CSS.
Kindly help me out.

PS: I'll have to process it as background-image orelse when passed as 
in html, we're getting extra wrapped spaces which aren't needed.

Below given are: views.py, models.py, index.html, css block.
Kindly help me out as it is urgent. Thank you for your support in advance.

Regards,
Aritra

class HomeView(ListView):
context_object_name = 'items'
template_name = "index.html"
queryset = Items.objects.all()

def get_context_data(self, **kwargs):
context = super(HomeView, self).get_context_data(**kwargs)
context['banners'] = Banner.objects.all()
return context

class Banner(BaseModel):
image = ResizedImageField(upload_to="banner", null=True, blank=True)



  {% for banner in banners %}

  {% endfor %}



  .banner-item-01 {
   padding:300px 0px;
   background-size: cover;
   background-image: url(var(--item));
   background-repeat: no-repeat;
   background-position: center center;
}

-- 
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/CAFecadvDi5V4%3DuetJhSZo1FSyOyGsvLH_s7K%2Bhc-vMLU%2BHLBpA%40mail.gmail.com.


Re: Allow field validation in ajax.

2021-06-17 Thread Eugene TUYIZERE
Dear NA,

still it does not wark

On Sun, 13 Jun 2021 at 03:20, Nikeet NA  wrote:

> You are not submitting your form which Inturn is not validating. For
> validations to run you need to submit a form.
>
> Give the submit button attribute type="submit", then add an event listener
> for form submit in your javascript.
> $("#ReportForm").on('submit', function(event) {
>// here event is submit type event object
>event.preventDefault() // this is added to prevent default
> execution of form submit event which will stop the page reload.
>// here event.target is your form so you can use that to get data
> as let data = new FormData(event.target)
> })
>
> On Saturday, 12 June 2021 at 22:09:26 UTC+5:30 eugenet...@gmail.com wrote:
>
>> Friends,
>>
>> The ajax codes below successfully save the records in the database
>> without page loading. But what I want is to validate the fields first
>> before saving. The codes do not validate the empty field. How can I include
>> that validation ? please help
>>
>> 
>> $(".submit_btn").click(function(){
>> var form=new FormData($("#ReportForm")[0]);
>> //AJAX CODE
>> var xhr=new XMLHttpRequest();
>> xhr.onreadystatechange=function(){
>> if(xhr.status==200){
>> console.log(xhr.responseText);
>> }
>> }
>> xhr.open("POST","{% url 'report_create' %}",true);
>> $("#progressbar").show();
>>
>> //UPDATING PROGRESS BAR
>> xhr.upload.addEventListener("progress",function(ev){
>> if(ev.lengthComputable){
>> var percentage=(ev.loaded/ev.total*100|0);
>> $("#progressbar").css({"width":""+percentage+"%"}).text("Uploading .."+
>> percentage+"%");
>> console.log(percentage);
>> if(percentage>=100){
>> location.reload()
>>
>> }
>> }
>> });
>>
>> xhr.send(form);
>> })
>> 
>>
>> Regards,
>> *Eugene*
>>
>>
>> --
> 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/d4c70f2f-2b3f-4d64-a94a-ee31b9ecdd03n%40googlegroups.com
> 
> .
>


-- 
*TUYIZERE Eugene*



*Msc Degree in Mathematical Science*

*African Institute for Mathematical Sciences (AIMS Cameroon)Crystal
Garden-Lime, Cameroon*

Bsc in Computer Science

*UR-Nyagatare Campus*

Email: eugene.tuyiz...@aims-cameroon.org
   eugenetuyiz...@gmail.com

Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38

-- 
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/CABxpZHt3F-aZxhuuWWLdoACJDZ6d9cqGzWLA2N4wS23M3juM3g%40mail.gmail.com.


Fwd: Django chart using chart.js

2021-06-17 Thread Eugene TUYIZERE
please assist

-- Forwarded message -
From: Eugene TUYIZERE 
Date: Thu, 17 Jun 2021 at 11:15
Subject: Django chart using chart.js
To: 


Team,

I have a table called Indicators. This includes indicator, target and
progress. Both target and progress are numbers. What I want is to display a
chart target and progress for every indicator. With the code below I only
get indicators I failed to display the bars (columns). Please assist

[image: image.png]

def chart(request):
dataset = Indicators.objects.values('indicator','target','progress')
indicator = list()
target = list()
progress = list()
for entry in dataset:
indicator.append(entry['indicator'])
target.append(entry['target'])
progress.append(entry['progress'])
target_series = {
'name': 'Target',
'data': target,
'color': 'blue',
}
progress_series = {
'name': 'Progress',
'data': progress,
'color': 'red'
}
chart = {
'chart': {'type': 'column'},
'title': {'text': 'Indicator Analysis'},
'xAxis': {'categories': indicator},
'series': [target_series,progress_series]
}
dump = json.dumps(chart)
-- 
*Eugene*




-- 
*TUYIZERE Eugene*



*Msc Degree in Mathematical Science*

*African Institute for Mathematical Sciences (AIMS Cameroon)Crystal
Garden-Lime, Cameroon*

Bsc in Computer Science

*UR-Nyagatare Campus*

Email: eugene.tuyiz...@aims-cameroon.org
   eugenetuyiz...@gmail.com

Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38

-- 
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/CABxpZHu7B7gbmmr6ixSk9cisTeU_3U6bM2fKa48%3DvtxQZr0mXQ%40mail.gmail.com.


Re: using .annotate on a queryset and output field is a result of function

2021-06-17 Thread VISHESH MANGLA
what about overwriting the manager? How to make the manager auto-add those 
computed properties ? 

On Thursday, June 17, 2021 at 8:50:27 AM UTC+5:30 Nikeet NA wrote:

> You cannot use properties in django orm , it does not allow that.
>
> TransactionEntry.objects.defer("users").annotate(total_price=F("num_shares")*F("price_per_share")).values('total_price')
> On Thursday, 17 June 2021 at 03:23:01 UTC+5:30 VISHESH MANGLA wrote:
>
>> Hello, 
>>
>> I wanted to know that how for the model below,  how can I get a queryset 
>> with  all the fields excluding the `user` and including the  output of 
>> get_output_field? Please avoid hardcoding.
>> One way is
>>
>> `TransactionEntry
>> .objects.defer("users").annotate(total_price=F("num_shares")*F("price_per_share"))`
>>
>> but that is undesirable. I just want to use that function on the model 
>> and not hard code the formula.
>> Thanks,
>>
>>
>>
>> class TransactionEntry(models.Model):
>> """Model to save data of users who want to buy/sell shares"""
>>
>> user = models.ForeignKey(
>> to=Relative,
>> on_delete=models.CASCADE,
>> related_name="transaction_entry",
>> )
>>
>> num_shares = models.PositiveIntegerField(null=False, blank=False)
>> date_of_trade = models.DateField(null=False, blank=False)
>> transaction_type = models.CharField(
>> max_length=1,
>> choices=TransactionType.choices,
>> default=TransactionType.SELL,
>> null=False,
>> )
>> price_per_share = models.FloatField(null=False, blank=False)
>>
>> def get_total_price(self):
>> return self.num_shares * self.price_per_share
>>
>>

-- 
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/35d917c8-e321-42eb-8050-f7849c0374e8n%40googlegroups.com.


Django chart using chart.js

2021-06-17 Thread Eugene TUYIZERE
Team,

I have a table called Indicators. This includes indicator, target and
progress. Both target and progress are numbers. What I want is to display a
chart target and progress for every indicator. With the code below I only
get indicators I failed to display the bars (columns). Please assist

[image: image.png]

def chart(request):
dataset = Indicators.objects.values('indicator','target','progress')
indicator = list()
target = list()
progress = list()
for entry in dataset:
indicator.append(entry['indicator'])
target.append(entry['target'])
progress.append(entry['progress'])
target_series = {
'name': 'Target',
'data': target,
'color': 'blue',
}
progress_series = {
'name': 'Progress',
'data': progress,
'color': 'red'
}
chart = {
'chart': {'type': 'column'},
'title': {'text': 'Indicator Analysis'},
'xAxis': {'categories': indicator},
'series': [target_series,progress_series]
}
dump = json.dumps(chart)
-- 
*Eugene*

-- 
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/CABxpZHtqCB2n%3D0FYAKinTcujUsosHkyHTSUS2%3DFML0-7pLjKsg%40mail.gmail.com.