Re: String Concatenate

2022-04-20 Thread Jason
https://tapadoo.com/what-every-programmer-should-know-about-phone-numbers/ might be useful On Wednesday, April 20, 2022 at 1:44:38 PM UTC-4 shahee...@gmail.com wrote: > > > On Wed, 20 Apr 2022, 11:05 Kasper Laudrup, wrote: > >> On 20/04/2022 11.33, Ankit Chaurasia wrote: >> > from django.db

Re: String Concatenate

2022-04-20 Thread Shaheed Haque
On Wed, 20 Apr 2022, 11:05 Kasper Laudrup, wrote: > On 20/04/2022 11.33, Ankit Chaurasia wrote: > > from django.db import models > > class Customer(models.Model): > > name = models.CharField(max_length=20) > > phone = models.IntegerField() > > I want to concatenate name + last digit of

Re: Calculations Between Models

2022-04-20 Thread Derek
Not sure what the "@aproperty" are here for, but in your views.py file, you could do this calculation, passing in the ID of the staff record: from .models import Staff, LeaveReportStaff def get_leave_balance(staff_id): total_leave_days = Staff.objects.get(pk=staff_id) leave_reports =

Fetching Data Between Models

2022-04-20 Thread tech george
I have a model Staff and LeaveReportStaff, I wanted to get leave_balance between Total_Leave_Days and leave_days. I already used Foreignkey for staff but I'm not sure if it is right to use Foreignkey again. Please advise the best way forward. class Staff(models.Model): Total_Leave_Days =

Re: String Concatenate

2022-04-20 Thread Kasper Laudrup
On 20/04/2022 11.33, Ankit Chaurasia wrote: from django.db import models class Customer(models.Model):     name = models.CharField(max_length=20)     phone = models.IntegerField() I want to concatenate name + last digit of phone number. It makes no sense to store a phone number as an

String Concatenate

2022-04-20 Thread Ankit Chaurasia
Hello Team, I need some help, Please see below my Model. from django.db import models class Customer(models.Model): name = models.CharField(max_length=20) phone = models.IntegerField() I want to concatenate name + last digit of phone number. -- You received this message