How Notify Current user ,your insurance is going expiry within 5 days in django

2022-03-01 Thread Gautam Ankul



I am stuck in one problem and i want to notify current logged user for it's 
insurance will be expired within 5 days ago.



class Vehicle(models.Model): vehicle_no = models.CharField(max_length=100, 
blank=False, null=False) chasis_no = models.CharField(max_length=100, 
blank=False, null=False, unique=True) make = 
models.CharField(max_length=100, blank=False, null=False) insurance_no = 
models.CharField(max_length=100, blank=False, null=False) insurance_date = 
models.DateField(blank=False, null=False) insurance_expiry_date = 
models.DateField(blank=False, null=False)


Please help me to find exact solution


-- 
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/dbab5e24-c394-49f1-8f9e-c7ff38bbf8ffn%40googlegroups.com.


how to filter by month from template

2022-02-22 Thread Gautam Ankul
HERE STACKOVER FLOW LINK OF QUESTIONS
:https://stackoverflow.com/questions/71232795/how-to-filter-by-month-from-template

-

I'm attempting to channel a datetime field by month and year. Though no one 
can really say why while entering both month and year I get back a vacant 
set returned.

Model
class SpareParts(models.Model): vehicle = models.ForeignKey(Vehicle, 
on_delete=models.CASCADE) amount = models.IntegerField(blank=False, 
null=False) date = models.DateField(blank=False, null=False) 

And i want to filter on the basis of vehicle and month vise and here is 
mine view VIEWS.py
def view_spare(request): sparepart = SpareParts.objects.all() 
vehicle_filter = request.POST.get('vehicle') # get the value of the date 
field month_filter = request.POST.get('month') # get the value of the date 
field if vehicle_filter: if month_filter: sparepart = 
sparepart.filter(vehicle=vehicle_filter,date__month=month_filter).aggregate(Sum('amount'))
 
return 
render(request,'invoice/spare_parts_list.html',{'sparepart':sparepart}) 

and i want render the whole month sum of amount in template

-- 
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/746d4862-f349-4ccd-be54-5b894a115c02n%40googlegroups.com.


Re: TypeError: fromisoformat: argument must be str

2022-02-08 Thread Gautam Ankul
Same issue in mine project but when database name change and delete all
migration file then it is resolve

On Tue, 8 Feb, 2022, 3:45 PM Sammeeey,  wrote:

> I have posted my issue to the Django Forum.
> Please find it in the respective thread
> 
>
> --
> 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/e9703ec6-d93e-4ccb-a428-9189dc3bf525n%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/CALKR2n3byUygtxkGAj3bpwPU7YSXYLD6yDnPinE3C_Md3wf8jg%40mail.gmail.com.


[no subject]

2022-02-02 Thread Gautam Ankul
How to use fee due notifications in django something helpe

-- 
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/CALKR2n1UW%3DFFdq1NAbEJADyhCxOtg-_g68mtpu-mqPaC7tGLfw%40mail.gmail.com.


How to filter and get all vendor details using category

2021-12-08 Thread Gautam Ankul
Here is my models

class Vendor(models.Model):
category_id = models.ForeignKey(
Category,
blank=True,
null=True,
verbose_name=u"Category id",
on_delete=models.CASCADE,
)
vendor_id = models.CharField(
unique=True, max_length=50, blank=False, null=False, verbose_name=u"Vendor 
Id",
)
vendor_name = models.CharField(
max_length=50, blank=False, null=False, verbose_name=u"Vendor name"
)
vendor_password = models.CharField(
max_length=50, blank=False, null=False, verbose_name=u"Vendor password"
)
vendor_avg_rating = models.DecimalField(
validators=[MinValueValidator(0.0), MaxValueValidator(5.0)],
max_digits=3,
decimal_places=2,
blank=True,
null=True,
verbose_name=u"Vendor average rating",
)
vendor_tokens = models.TextField(
default="[]", blank=True, null=True, verbose_name=u"Vendor tokens",

for category:

class Category(models.Model):
category_name = models.CharField(
max_length=50, blank=False, null=False, verbose_name=u"Category name"
)

def __str__(self):
return self.category_name

class Meta:
verbose_name_plural = "Categories"

and serializer is here

class VendorSerializer(serializers.ModelSerializer):
class Meta:
model = Vendor
fields = ["vendor_id","vendor_name","vendor_location"]

and i want that type of result:

{
"ErroeCode": "0",
"status": 200,
"message": "Get vendor details successfully",
"Items": [
{
"vendor_id": "1",
"vendor_name": "ankul gautam"
},
{
"vendor_id": "2",
"vendor_name": "deepak kush"



-- 
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/f655e8c6-cc5e-404a-883d-b715118c6a1bn%40googlegroups.com.