NameError:

2022-04-08 Thread tech george
Hello, I've been struggling with the below error, what might be the problem? I have used the same ForeignKey in other models.. all works ok, except this. Please advise. *Models:* class CustomUser(AbstractUser): user_type_data = ((1, "AdminHOD"), (2, "Pharmacist"), (3, "Doctor"), (4, "Pharm

Re: NameError:

2022-04-09 Thread tech george
tients model. > > Regards, > > Antonis > > On 08/04/2022 20.49, tech george wrote: > > Hello, > > I've been struggling with the below error, what might be the problem? > > I have used the same ForeignKey in other models.. all works ok, except > thi

Calculated Fields

2022-04-10 Thread tech george
Hello, I am trying to calculate fields directly from a model but no luck. I want to get total_price from quantity, reoder_level and unit price. My code is abelow, Please advise. class Stock(models.Model): unit_price = models.DecimalField(max_digits=10, decimal_places=2, default='0', blank=Tru

Re: Calculated Fields

2022-04-10 Thread tech george
t; -- > (Unsigned mail from my phone) > > > > ---- Original message > From: tech george > Date: 11/4/22 03:50 (GMT+10:00) > To: django-users@googlegroups.com > Subject: Calculated Fields > > Hello, > > I am trying to calculate fields directl

Re: Calculated Fields

2022-04-11 Thread tech george
.DecimalField(max_digits=10, decimal_places=2, > default='0', blank=True, null=True) > quantity = models.IntegerField(default='0', blank=True, null=True) > reorder_level = models.IntegerField(default='0', blank=True, null=True) > > @property >

Calculations Between Models

2022-04-19 Thread tech george
Hello, I have a model Staff and LeaveReportStaff, I wanted to get leave_balance between Total_Leave_Days and leave_days. Please advise the best way forward. class Staff(models.Model): Total_Leave_Days = models.PositiveIntegerField(default=0) course = models.ForeignKey(Course, on_delete=m

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 = mode

Models Culculations

2022-08-03 Thread tech george
Hello, Please help with the below, I am trying to get dispense_quantity from Dispense Model and subtract it from the quantity on Stock Model. Then after that get something like this; @property def closing_stock(self): return (self.quantity - self. quantity_issued ) class Stock(models.Mod

Negative Stock Prevention

2022-08-29 Thread tech george
Hello, Please help crack the below code, I want to prevent negative stock, and if the stock is == 0, deduct it from reorder_level instead. Currently, the stock goes negative. models.py class Stock(models.Model): quantity = models.IntegerField(default='0', blank=True, null=True) reorder_l

Re: Negative Stock Prevention

2022-08-31 Thread tech george
> instance.quantity? Also, presumably you want to check if quantity is > greater than or equal to qu rather than 0. > Try changing `if quantity > 0` to `if instance.quantity >= qu` > > > On Tuesday, August 30, 2022 at 3:44:51 PM UTC+1 Ryan Nowakowski wrote: > >> O

Re: Negative Stock Prevention

2022-08-31 Thread tech george
Hello, Sorry the error is: django.db.utils.IntegrityError: CHECK constraint failed: quantity On Thu, Sep 1, 2022 at 3:45 AM Ryan Nowakowski wrote: > I don't see any error. Did you forget to post it? > > On August 31, 2022 5:57:32 AM CDT, tech george > wrote: >> &g

Re: Negative Stock Prevention

2022-08-31 Thread tech george
ep 2022, 02:45 Ryan Nowakowski, wrote: > >> I don't see any error. Did you forget to post it? >> >> On August 31, 2022 5:57:32 AM CDT, tech george >> wrote: >>> >>> Hello, >>> >>> Sorry for the late reply. >>> >>>

Filter by date range

2022-09-09 Thread tech george
Hello friends! I am trying to give users an easier way to filter data by date range. My views.py code is as below, but unfortunately, it is hiding data without applying the filter whenever I try to use if, else statements. Please advise what I might be doing wrong. views.py ef referralsReports

Re: Filter by date range

2022-09-09 Thread tech george
filter(date__range=[fromdate,todate]) > if you have any problem with performance hit database use select_related > or used m2m field use prefect_related > https://docs.djangoproject.com/en/4.1/ref/models/querysets/ > > best! > > On Fri, Sep 9, 2022 at 7:48 AM tech george

Re: Filter by date range

2022-09-10 Thread tech george
'todate'? > > On Sat, 10 Sept 2022 at 13:27, tech george wrote: > >> Hello Carlos, >> >> I have used the code below as you advised by when I filter the table >> comes blank: >> >> query_results = Prescription.objects.filter(date__rang >>

Re: Filter by date range

2022-09-11 Thread tech george
.@gmail.com> wrote: > Either there's no data for that month or your query is wrongly formatted. > Probably you can try your query in the shell first. > > On Sun, 11 Sept 2022 at 02:12, tech george wrote: > >> Hello Muhammad, >> >> I'm choosing dates b

Re: Filter by date range

2022-09-11 Thread tech george
I managed to solve the issue. I was using the wrong keyword to fetch the dates. Thanks for the support. On Mon, Sep 12, 2022 at 9:03 AM tech george wrote: > Hello, > > I have tried debugging as below and it returned data; > > search_results = > Prescript

Re: group

2022-09-28 Thread tech george
Please add me: +254724164862 On Wed, Sep 28, 2022 at 7:13 PM Prince Adedotun wrote: > Add me also... > > 08167422287 > > On Mon, 26 Sept 2022, 18:49 yassin kamanyile, > wrote: > >> Add me +255763023477 >> >> On Mon, 26 Sept 2022, 15:53 Abdulfarid Olakunle, >> wrote: >> >>> Hello fellow develo

Export filtered data

2023-01-19 Thread tech george
Hello, I have been trying to export filtered table data to excel but was unlucky. I can filter the table by date range successfully but can export the filtered data. Below is my view.py. Please help def export_sickoff_export(request): if request.method=="POST": start_date = requ

Multiple Media_Root

2020-11-22 Thread tech george
Hello, I am developing an E-Commerce website and I wanted to have a separate upload folder for my slides and separate folders for other sections of my site. Is there a way i can go about it other than using the ascending and Descending order? Please advise. See section of my view.py page. [ima

Re: Multiple Media_Root

2020-11-23 Thread tech george
Thanks for the guide, Let me try this option then i'll let you know in case I get stuck. On Mon, Nov 23, 2020 at 4:41 PM Mbah Victor wrote: > Plz can u send me a review of what you what > > Victor > > On Sun, Nov 22, 2020, 8:05 PM tech george wrote: > >> Hell

RE: Page Resoltuon

2020-12-01 Thread tech george
Hello, I am working on this webapp using a pre designed template. But my project is too stretched out and can't seem to make it look like the actual template. Please advise. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Re: Python Django Training

2020-12-07 Thread tech george
I want in too On Mon, 7 Dec 2020, 16:43 Hector Berrones, wrote: > I am interested. > > On Mon, Dec 7, 2020, 2:09 AM narendra thapa > wrote: > >> hello please add me also in training group? >> >> >> On Fri, Feb 21, 2020 at 7:27 PM Bharati Nilam >> wrote: >> >>> Hi, >>> I also from Hyderabad and

DoesNotExist at /

2020-12-27 Thread tech george
Hello, I am getting the error as shown below when uploading my django project to share hosting. How can I resolve it? Please advise. DoesNotExist at / Currency matching query does not exist. Request Method: GET Request URL: http://fullcart.co.ke/ Django Version: 3.0.7 Exception Type: DoesNotEx

Re: DoesNotExist at /

2020-12-28 Thread tech george
Hi, Yes I does. On Mon, 28 Dec 2020, 18:41 AMRIT SHAHI, wrote: > Is your hosting support python > > On Mon, Dec 28, 2020, 12:49 PM tech george wrote: > >> Hello, >> >> I am getting the error as shown below when uploading my django project to >>

Re: DoesNotExist at /

2020-12-28 Thread tech george
Hi, Let me go through the dock and see if I'll get a breakthrough. Thanks On Mon, 28 Dec 2020, 18:41 Prashanjeet Halder, wrote: > There's no built-in filter as currency in django template language you can > custom create one. > > *As Demonstrated Here: LINK >

Re: Product Categories

2021-05-23 Thread tech george
Thanks Work, Let me try that. Regards. On Sat, 22 May 2021, 21:48 N'BE SORO, wrote: > Ok use: > > # In Python > # print(category.get_ancestors()) > # In Jinja category.get_ancestors > > Le sam. 22 mai 2021 à 18:14, Patrick Café a > écrit : > >> OK than