Re: UPLOAD STATIC FILES

2023-05-29 Thread sum abiut
in your setting make sure you have STATIC_URL = '/static/' then in your template you load static at the top of your htmi file like this. {% load static %} to load any static files like css. do something like this {% static './cssfile.css'%} Then run the command. python manage.py collectstatic

Re: Django date time picker

2023-05-29 Thread sum abiut
You can use model forms and do something like this: 1) create your model. for instance class DatePickerModel(models.Model): start_date = models.DateTimeField() end_date = models.DateTimeField() 2) create your form # setup date picker start class DateInput(forms.DateInput): input_type

Re: DateTime widget in default CreateView form

2021-10-07 Thread sum abiut
You can use modelform. in your form.py you can do something like this # setup date picker start class DateInput(forms.DateInput): input_type = 'date' class Formname(forms.ModelForm): class Meta: model= yourmodel fields =

Re: Defining a custom email backend

2021-09-22 Thread sum abiut
, html_message=html_message) > its giving me error - send_mail() got an unexpected keyword argument > 'EMAIL_HOST_USER' > > Can you suggest anything about this ? > Thanks > > > On Thu, Sep 23, 2021 at 10:57 AM sum abiut wrote: > >> If you don't mind sharing your

Re: Defining a custom email backend

2021-09-22 Thread sum abiut
If you don't mind sharing your code here. cheers, On Thu, Sep 23, 2021 at 4:17 PM Sujata Aghor wrote: > Hello Everyone, > I want to use different values of - EMAIL_HOST_USER & EMAIL_HOST_PASSWORD > for each of my users. I will take those values from database and not from > settings.py > > In

iterate over query set

2021-07-26 Thread sum abiut
I am trying to get the values of the userid by iterating through the queryset. However not all the values are displayed. I am not sure why I am not getting all the values when I iterate through it. users - Users.objects.filter(depid=get_department[0].depid) print(users) #when i test it here it

Re: connection to an existing legacy database

2021-07-20 Thread sum abiut
It was simplet fix. department was set to managed =True, i set that to False and it fixed the problem. Cheers On Wed, Jul 21, 2021 at 1:43 AM Divyesh Khamele wrote: > > If you have any doubt I’ll provide you all the solutions (Dm for paid work) > On Tue, 20 Jul 2021 at 5:29 AM,

connection to an existing legacy database

2021-07-19 Thread sum abiut
I am trying to connect Django to an existing legacy database but I got this error message. I only get the message why I try to migrate. I follow the guide from the Django documentation . error message: django.db.utils.ProgrammingError:

Re: counting the same words within a song added by a user using Django

2021-07-11 Thread sum abiut
DEVELOPER > wrote: > >> so will it run smoothly? >> I mean there is no filter function there so will it filter a specific >> field and will give me count for the words? >> >> On Tue, Jul 6, 2021 at 9:40 PM sum abiut wrote: >> >>> You can to so

Re: Role based Authentication

2021-07-07 Thread sum abiut
>From the admin site you can create different groups and then assign specific users to specific groups. then filter users' roles based on the specific group that you have assigned them to. On Thu, Jul 8, 2021 at 3:53 AM Lalit Suthar wrote: > you can extend User model and have a role field in

Re: counting the same words within a song added by a user using Django

2021-07-06 Thread sum abiut
You can to something like this def count_songs(request): #get the field that you want to count the words in it field_name = model._meta.get_field('your_field) word_count =Counter(field_name) for key, value in word_count.items(): key = key value=value context={ 'key':key,

Re: hello i need a help

2021-07-05 Thread sum abiut
The error message is very clear send_mass_mail only expect 4 values but you are passing in more than four. You should only pass in four values. datatuple = ( ('f_subject', 'f_message','f_email', ['mygm...@gmail.com']), # second person ('f_subject', 'f_message','f_email', ['sec...@gmail.com']) )

Re: user profile in Django

2021-06-27 Thread sum abiut
You can use the user model, do something like that class user_register(models.Model): user = models.OneToOneField(User,on_delete=models.CASCADE) join_date = models.DateTimeField(default=timezone.now) To view the user profile, you can do something like this. def user_profile(request,

Re: Help

2021-06-27 Thread sum abiut
You have to be more clear on what you are working on. provide the code that you are having trouble with in order to get the appropriate assistance. You might want to take a look at this. https://django-hitcount.readthedocs.io/en/latest/# On Mon, Jun 28, 2021 at 5:54 AM ola neat wrote: > Halo

error save to model on a onto many relationship

2021-06-10 Thread sum abiut
I am running to some issue saving to models in a one to make relationship. The error is described Here . I would appreciate it if you could point me in the right direction. cheers, -- You

Re: Help!!!

2020-11-29 Thread sum abiut
Run these commands Python manage.py makemigrations Python manage.py migrate On Mon, 30 Nov 2020, 07:40 Kelvin Sajere, wrote: > I haven’t actually used repl.it, so I can’t really tell you what’s > happening. I basically just do things by creating a project, then using > manage.py to create apps

Re: Not null constraint error when adding a child record .

2020-07-09 Thread sum abiut
you need to pass the instance of the requisition id to your form before you can save it. You can try this: myrequistion=requistion.objects.get(id=requistion_id) form=RequistiondetailForm(request.POST, inctance= myrequistion) if form.is_valid() form.save()

Re: How to get data from django model to the excel sheet.

2020-07-06 Thread sum abiut
You can try this export data to excel file Sum, On Mon, Jul 6, 2020 at 7:00 PM Ashutosh Mishra wrote: > I want to get the data from the django model contans(name,age,photo) on a > excel sheet. > How can i do

send_mail creating a hyperlink

2020-01-22 Thread sum abiut
Hi, How do I create a hyperlink on the body of the email so that when the user receives the email they can click the link to access the website? For example, on the send_mail( subject, click here to access the site, to_address) cheers, -- You received this message because you are subscribed to

email api

2020-01-05 Thread sum abiut
Is there any other email API out there that I can use to send email in django other than sengrid? -- 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

Re: get user that is member of two different group

2020-01-02 Thread sum abiut
4 AM Lunga Baliwe wrote: > >> Hi there, >> maybe you can use something like >> User.objects.filter(groups__name__in=['test1', 'test2']). >> Also check https://docs.djangoproject.com/en/3.0/ref/models/querysets/#in for >> examples of using __in >> >> On Thu, Jan

Re: get user that is member of two different group

2020-01-02 Thread sum abiut
; On Thu, Jan 2, 2020 at 6:49 AM sum abiut wrote: > >> Hi, >> I have two separate groups, for example, test1, and test2. I want to get >> a user that is a member of group test1 and group test2. >> >> I've try User.objects.filter(groups__name='test1') to get use

get user that is member of two different group

2020-01-01 Thread sum abiut
Hi, I have two separate groups, for example, test1, and test2. I want to get a user that is a member of group test1 and group test2. I've try User.objects.filter(groups__name='test1') to get users of group test1. not sure how to check if a user belongs to group test1 and is also belong to group

change page title of password reset form

2020-01-01 Thread sum abiut
How do you change the default page header of the password reset form? I did something like below but the default page still doesn't change. admin.site.site_header = "testing" [image: image.png] -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Feeding a stored procedure (MySQL) into Django_Tables2 table

2019-12-24 Thread sum abiut
Can you show us your models. On Wed, 25 Dec 2019, 08:03 Gregory Vaks, wrote: > Hello all, > > I am using Django-Tables2 for front-end in my app as it nicely fits my > requirement for displaying information. > > My issue is that I need to display information from multiple models (MySQL > tables)

ModelChoiceField get selected value

2019-12-02 Thread sum abiut
How do I get the value of a selected model choice field? I have a model that has a field 'user' as a foreignKey and I am trying to figure out how to get the value of a user that was selected. I have a form that looks like below, [image: image.png] class update_entitlement_form(forms.ModelForm):

Re:

2019-11-26 Thread sum abiut
Check your url, you are passing a primary key in the edit_profile function but you are not indicating that in your url. On Mon, 25 Nov 2019, 05:50 Paras Jain, wrote: > its showing error like this: > TypeError at /edit_profile/ > > edit_profile() missing 1 required positional argument: 'pk' > >

Re: Django update field in many to many relationship

2019-02-14 Thread sum abiut
Thanks, The Leave_current_balance is from Leave_Balance model which why i haven't included it. I am not sure how to fix that. Sum On Fri, Feb 15, 2019 at 12:42 PM Simon Charette wrote: > Your DirectorForm model form doesn't include 'Leave_current_balance' in > it's Meta.fields > hence no form

Re: Django update field in many to many relationship

2019-02-14 Thread sum abiut
lance=form.fields['Leave_current_balance'] Exception Type: KeyError at /unitDirectorForm/25/ Exception Value: u'Leave_current_balance On Fri, Feb 15, 2019 at 11:49 AM sum abiut wrote: > Hi, > > I have two models many to many relationships, I am trying to update the > field using a form

Django update field in many to many relationship

2019-02-14 Thread sum abiut
Hi, I have two models many to many relationships, I am trying to update the field using a form. when a leave is submitted the director is notified by email. the director can login to the system to approve the leave using the form. once the leave is approved, I want to adjust the

django joining two models

2019-01-31 Thread sum abiut
Hi, i have three models LeaveBalance, NewLeave and User. I want to pull date from NewLeave and User, basically displaying the data of users that have apply for a leave. I had difficulty figuring out how to accomplish this. my views and model are below. The view is throwing an errror: Cannot

Re: Connecting Sql server to Django

2018-10-14 Thread sum abiut
You can try sqlalchemy https://docs.sqlalchemy.org/en/latest/dialects/mssql.html#module-sqlalchemy.dialects.mssql.pymssql using the pymssql driver, you can do something like this from sqlalchemy import create_engine def connect(request):

Using Django admin datepicker in a custom form

2018-06-26 Thread sum abiut
I am trying to use a django admin datepicker in a custom form. it is displaying alright but the year only begin in 2018 but no later than 2018. Please assist, below is my form.py #my form.py from django.forms.extras.widgets import SelectDateWidgetclass ContactForm(forms.ModelForm): class

Re: django display a row vale

2018-06-26 Thread sum abiut
Thanks, Here is my view.py and it works for me def display_data(request,id): selected_objects = minutes.objects.filter(pk__in=id) return render(request,'test.html',locals()) cheers, On Wed, Jun 27, 2018 at 8:15 AM, Ryan Nowakowski wrote: > On Tue, Jun 26, 2018 at 04:33:41PM +1100,

django display a row vale

2018-06-25 Thread sum abiut
Hi, i need some assistance, i have a table and want to be able to only display the values of a particular row when ever the particular row is selected. please point me to right direction. cheers -- You received this message because you are subscribed to the Google Groups "Django users" group.

balance brought forward

2018-05-24 Thread sum abiut
Hi, I am working on an accounting app and i needed direction on how to go about calculating the balance brought for a particular day. What i want to accomplish is being able to display the balance brought forward when the user select a date. i want to be able to display the transaction that

Re: serving admin files in Apache

2018-05-03 Thread sum abiut
l css, js, and images to the static root folder you specified > in settings.py > > On Thu, May 3, 2018 at 4:40 PM sum abiut <suab...@gmail.com> wrote: > >> Hi, >> I have recently setup my django app with Apache. The app files are serve >> alright but, however when i acc

serving admin files in Apache

2018-05-03 Thread sum abiut
Hi, I have recently setup my django app with Apache. The app files are serve alright but, however when i access the admin page it looks all over the place. Please advise how to i serve the admin files in Apache. Cheers, -- You received this message because you are subscribed to the Google

convert range of date from julian to gregorian date

2018-04-25 Thread sum abiut
Hi , I am trying to convert a range of date from julian to gregorian date here is what i have try stmt=stmt.where(and_(rate.columns.journal_ctrl_num==fund.columns.journal_ctrl_num,fund.columns.account_code==selected_acc,rate.columns.date_entered.between(convert,convert1)))

Re: displaying gregorian date in template

2018-04-24 Thread sum abiut
i want to do something like datetime.date.fromordinal(int(date_applied)) to convert date from julian to gregorian date, just wondering it this can be done in template? On Wed, Apr 25, 2018 at 1:56 PM, sum abiut <suab...@gmail.com> wrote: > Current i have a for loop >

Re: displaying gregorian date in template

2018-04-24 Thread sum abiut
Current i have a for loop Date {% for a in results %} {{a.date_applied}} {%endfor%) currently the date is in julian date. i wan to convert the date to gregorian date. Is there a way to do that in the template. On Wed, Apr 25, 2018 at 1:50 PM, sum abiut <suab...@gmail.com> wrote: &g

displaying gregorian date in template

2018-04-24 Thread sum abiut
I have a function that query the db and extract and display data on a template def bydate_display(request): if "selectdate" in request.POST and "selectdate1" in request.POST and "selectaccount" in request.POST: selected_date = request.POST["selectdate"] selected_date1 =

Re: Python Sqlalchemy filter by date range

2018-04-24 Thread sum abiut
Thanks heaps Larry On Tue, Apr 24, 2018 at 10:40 PM, Larry Martell <larry.mart...@gmail.com> wrote: > I think you are looking for the range function > > https://docs.djangoproject.com/en/dev/ref/models/querysets/#range > > > On Mon, Apr 23, 2018 at 11:54 PM sum abiut &

Python Sqlalchemy filter by date range

2018-04-23 Thread sum abiut
I have two date picker fields that i want the users to select from date to end date. and i want to display data between the two dates that was selected. From example form date: 2/14/2018 to date:3/15/2018. when the function is called i want to extract and display data between this two dates. i

Re: export sql query to excel

2018-04-16 Thread sum abiut
umns: > tmpColumns += 1 > sheet.cell(row = tmpRows, column = tmpColumns).value = str(getattr > (row,column)) > > excel_file_name = "myfilenamegoeshere.xlsx" > > full_path = "%s\\%s" % (dir_path, excel_file_name) > > wb.save(excel_file_name) > cursor

Re: export sql query to excel

2018-04-16 Thread sum abiut
utput, {'in_memory': True}) > # write file > output.seek(0) > response = HttpResponse(output.read(), > content_type='application/ms-excel') > response['Content-Disposition'] = "attachment; filename=%s" % > xls_name > return respon

Re: export sql query to excel

2018-04-16 Thread sum abiut
') > response['Content-Disposition'] = "attachment; filename=%s" % > xls_name > return response > > On Mon, Apr 16, 2018 at 2:05 AM, sum abiut <suab...@gmail.com> wrote: > > my code actually worked. I thought it was going to save the excel file to >

Re: export sql query to excel

2018-04-16 Thread sum abiut
the file to their desktop instead of exporting it to the server itself On Mon, Apr 16, 2018 at 3:27 PM, sum abiut <suab...@gmail.com> wrote: > I wrote a function to export sql query to an excel file, but some how the > excel file wasn't created when the function was call. ap

export sql query to excel

2018-04-15 Thread sum abiut
I wrote a function to export sql query to an excel file, but some how the excel file wasn't created when the function was call. appreciate any assistances here is my view.py def download_excel(request): if "selectdate" in request.POST: if "selectaccount" in request.POST:

Re: survey form

2018-03-26 Thread sum abiut
swer(models.Model): answer = models.ForeignKey(answer,on_delete=models.CASCADE) survey_answer = models.ForeignKey(SurveyAnswer,on_delete=models.CASCADE) Cheers On Wed, Mar 21, 2018 at 5:02 PM, sum abiut <suab...@gmail.com> wrote: > Thanks heaps Mike. > > > On Wed, Mar 21, 2018

Re: survey form

2018-03-21 Thread sum abiut
Thanks heaps Mike. On Wed, Mar 21, 2018 at 3:21 PM, Mike Dewhirst <mi...@dewhirst.com.au> wrote: > On 21/03/2018 1:17 PM, sum abiut wrote: > >> Hi, >> I am planning to build a survey app that allow the administator to add >> new questioner and the question to b

survey form

2018-03-20 Thread sum abiut
Hi, I am planning to build a survey app that allow the administator to add new questioner and the question to be answer by the users.But i am having trouble figuring how to get started. Just wondering if i need to have two models one for the answes and another model to store the questions. I need

Re: import file from view.py

2018-03-14 Thread sum abiut
ile in views.py and use it for getting the > relevant values. Hope this helps. > > Thanks, > Mahesh. > > On Tue, Mar 13, 2018 at 21:06 sum abiut <suab...@gmail.com> wrote: > >> I have a conf file containing the parameter of hostmane,db,usernam,pass, >> db

import file from view.py

2018-03-13 Thread sum abiut
I have a conf file containing the parameter of hostmane,db,usernam,pass, db i want to import that file from view.py and use parameter from the conf file to connect to a db. i did something this from appname.conf import but it doesn't seem to work, appreciate any assistance. cheers -- You

Re: django mathfiters

2018-02-28 Thread sum abiut
: > > And how are you checking if it’s None? I would do it like this: > > {% if c %} > > {{ a|add:c }} > > {% else %} > > {{ a }} > > {% endif %} > > > > *From:* django-users@googlegroups.com [mailto:django-users@ > googlegroups.com <djang

Re: template parse error

2018-02-22 Thread sum abiut
Thanks heaps Daniel, it was the spaces On Thu, Feb 22, 2018 at 10:57 PM, Daniel Roseman wrote: > On Thursday, 22 February 2018 06:16:32 UTC, suabiut wrote: >> >> Could not parse the remainder: '=="1"' from 'selected_value=="1"' >> >> >> i got the above error when passing

template parse error

2018-02-21 Thread sum abiut
Could not parse the remainder: '=="1"' from 'selected_value=="1"' i got the above error when passing the select value. I have no clue what i am missing. please assist {%if selected_value=="1"%} Cheers, -- You received this message because you are subscribed to the Google Groups "Django

Re: django mathfiters

2018-02-21 Thread sum abiut
gt; > > *From:* django-users@googlegroups.com [mailto:django-users@ > googlegroups.com] *On Behalf Of *sum abiut > *Sent:* Wednesday, February 21, 2018 4:43 PM > *To:* django-users@googlegroups.com > *Subject:* Re: django mathfiters > > > > Thanks for your response. Yes the value w

Re: django mathfiters

2018-02-21 Thread sum abiut
. Thanks On Thu, Feb 22, 2018 at 9:15 AM, Matthew Pava <matthew.p...@iss.com> wrote: > Check the value of b.value. Make sure it isn’t None. > > > > *From:* django-users@googlegroups.com [mailto:django-users@ > googlegroups.com] *On Behalf Of *sum abiut > *Sent:* Wednes

django mathfiters

2018-02-21 Thread sum abiut
Hi, How to you a zero in mathfilter for example, if the value of c is zero the total is not display. instead of displaying 42 it display nothing. {%for b in pay%} {% with a=42 c=b.value%} {{ a|add:c }} {% endwith %} -- You received this message because you are subscribed to the Google

Re: modelform selection options

2018-02-17 Thread sum abiut
the form, but the drop down list elements are not showing. cheers, On Fri, Feb 16, 2018 at 11:00 AM, sum abiut <suab...@gmail.com> wrote: > I have a model.py > class selection(models.Model): > select=( > (A','A'), > ('B','B'), > ('C','C'),

modelform selection options

2018-02-15 Thread sum abiut
I have a model.py class selection(models.Model): select=( (A','A'), ('B','B'), ('C','C'), ) options=models.CharField(max_length=7,choices=select) and form.py class order(forms.ModelForm): class Meta: model=selection fields=('Pay_options,) I want to

Re: How do I move a project from one computer to another?

2018-02-12 Thread sum abiut
It depends on where you want to house your app.if you need to house your app on the new machine. Just pip install from your requirements.txt file, then copy your django project to your new machine. On 13/02/2018 11:10 AM, "Tom Tanner" wrote: > I have a Django

Re: How to fetch data from sql server and display on django web pages

2018-02-12 Thread sum abiut
You may want to check out sqlalchemy they provide a pretty good documentation on what you are aftering http://docs.sqlalchemy.org/en/latest/dialects/mssql.html >From you view you can defile a function like so. view.py from sqlalchemy import* from django.shortcuts import render def

modelform not loading from template

2018-02-08 Thread sum abiut
Hi, i have a hard time figuring out why this form in not loaded on the template. There is no error but the form is not loading. Please advise what i am missing here. view.py def addcontact(request): if request.method=='POST': form =ContactForm(request.POST) if

Re: import eror views

2018-02-05 Thread sum abiut
shows us your url.py On Tue, Feb 6, 2018 at 12:11 AM, sarvit sarvit wrote: > hello > please help for dibog > Traceback (most recent call last): > File "c:\Users\saeid\Desktop\sade\env\Post\Post\urls.py", line 20, in > > from . import views > ImportError:

Re: view user profile access restriction

2018-01-29 Thread sum abiut
Thanks heaps , I noticed that. On 29/01/2018 8:28 PM, "Daniel Roseman" wrote: On Monday, 29 January 2018 05:57:55 UTC, suabiut wrote: > > I manage to fixed it. I have created two instances (profile_info and info) > in my view, i use the first instance to access the

Re: view user profile access restriction

2018-01-28 Thread sum abiut
* def loggin(request): if request.user.is_authenticated: profile_info=request.user.profile info=request.user return render(request,'dashboard.html',locals()) cheers, On Mon, Jan 29, 2018 at 3:17 PM, sum abiut <suab...@gmail.com> wrote: > Thanks heaps th

Re: view user profile access restriction

2018-01-28 Thread sum abiut
profile, sender=User) On Mon, Jan 29, 2018 at 1:02 PM, Dylan Reinhold <dreinh...@gmail.com> wrote: > There are a bunch of ways to do it. > Show us your view, if it's a function based view, just do your select on > (username=request.user) > > Dylan > > On Sun, Jan 28, 2018

view user profile access restriction

2018-01-28 Thread sum abiut
Hi, i have a django app that i want the users to be able to view only their user profile once they have login. currently any user that login is able to view other users profile as well. Appreciate is you could point me to the right direction. cheers, -- You received this message because you are

Re: url issues

2018-01-28 Thread sum abiut
Thanks heaps manage to fix it. On Fri, Jan 26, 2018 at 6:34 PM, wrote: > def login(request): > return render(request,'login.html') > > On Friday, January 26, 2018 at 6:33:07 AM UTC+5:30, suabiut wrote: >> >> Hi, >> i am having some issues with my url pattern. i

Re: django-payslip

2018-01-22 Thread sum abiut
ed in your URL map: /admin/ and > /payslip/ as per their respective documentation. So far so good. > > But you are accessing / with your browser. Hence the 404 error. Try > accessing /payslip/ > > Best regards, > > On Jan 22, 2018 12:29 AM, "sum abiut" <suab...@gm

django-payslip

2018-01-21 Thread sum abiut
Hi, Has anyone from list have any experience with django-payslip before. I follow direction from https://pypi.python.org/pypi/django-payslip/0.2.2 But i got the error below trying to load the page. Please advise [image: Inline image 1] cheer, -- You received this message because you are

Re: How do I exactly change from SQLite to MySQL ?

2018-01-14 Thread sum abiut
You can install mysql on your local machine and then later migrate your db to Heroku, will be much easy. On Mon, Jan 15, 2018 at 1:09 AM, Daniel Cîrstea wrote: > Hello. I am new to Django and I am trying to use it for my bachelor > thesis. Thing is, I want to use

Re:

2017-12-11 Thread sum abiut
You may also want to try django-oscar out. https://github.com/django-oscar/django-oscar cheers, On Sun, Dec 10, 2017 at 6:46 AM, Etienne Robillard wrote: > Hi Chaitanya, > > If you're not afraid of getting your hands dirty by playing with > django-hotsauce, you could try

Re: Django select filter

2017-09-12 Thread sum abiut
our view, then return the > response in json format. you can now collect it from your ajax response, > use javascript to dynamically update your table. > On Sep 13, 2017 12:43 AM, "sum abiut" <suab...@gmail.com> wrote: > >> Hi, >> I am working on an app which has

Django select filter

2017-09-12 Thread sum abiut
Hi, I am working on an app which has a dropdown/select option which contain months of the year. What i want to accomplished is when the user click on the drop down and select a particular month of the year the app should display a table filter by that particular selected month. Please point

Re: django filter

2017-08-29 Thread sum abiut
I did that but the approved leave is still showing on the table. Cheers On Tue, Aug 29, 2017 at 2:44 PM, sum abiut <suab...@gmail.com> wrote: > Thanks heaps Muhammad. > Sum > > On Tue, Aug 29, 2017 at 10:13 AM, Muhammad M <mwebbi...@gmail.com> wrote: > >> Hi S

Re: django filter

2017-08-28 Thread sum abiut
t; class Leave (models.Model): > #other fields go here... > approved = models.BooleanField ( ) > > In app/views.py, handle the query like this: > unapproved_leaves = Leave.objects.filter (approved=False) > > Then, do with the returned queryset as you wish. > > Bes

django filter

2017-08-28 Thread sum abiut
Hi all, i am working on an eleave system where staff apply for annual leave and their leave manager approved the leave online. currently i have a table that shows all the leave for each department. what i want to accomplished is to only show the leave that are not yet approved on the table. Any

Math filter

2017-07-18 Thread sum abiut
Hi, needed direction maths filters on django templates. for example how to you perform this on a template. a*b +b*c i did a|mul:b|add:b|mul:cbut got a wrong answer. Please point me to right direction. cheers, -- You received this message because you are subscribed to the Google

replacing existing file with new uploaded file

2017-07-11 Thread sum abiut
Hi all, need some directions, i need direction replacing file with newly uploaded file. The upload function is working but i want to replace a file every time i upload a new one. my model.py class uploadfile(models.Model): description = models.CharField(max_length=255, blank=True)

[no subject]

2017-06-26 Thread sum abiut
Hi all, I have this function where i i use mssqlalchmy to to fetch data from a mssql database. I am fetching data from a column but what i am interested in, is just to get a data from last field/row on that column. is there are way to get that done from template?. this what i have done from the

passing data to template

2017-06-15 Thread sum abiut
Is it possible to pass data from two different django functions to a one template in a single for loop? Cheers, -- 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

display a field from last updated row

2017-06-15 Thread sum abiut
Hi, i am having trouble trying to figure this out. I have a table something as below. i want to write an sqlalchemy that query the table and then display the email address from the row that was last updated. Please point me to the right direction to help me accomplished that. fname lname

Re: passing data to template

2017-06-14 Thread sum abiut
Hi Mike, Thank heaps for direction. Appreciate your help. Cheers, On Thu, Jun 15, 2017 at 1:52 PM, Mike Dewhirst <mi...@dewhirst.com.au> wrote: > On 15/06/2017 12:07 PM, sum abiut wrote: > >> I try to perform a division on the tuple but i am getting an error. I >> have a

Re: passing data to template

2017-06-14 Thread sum abiut
}} {{a.1}} {{a.1/a.0}} {%endfor%} On Thu, Jun 15, 2017 at 8:47 AM, sum abiut <suab...@gmail.com> wrote: > Thanks heaps. appreciate your help, pointing me to right direction. > > > > > On Thu, Jun 15, 2017 at 5:28 AM, ludovic coues <cou...@gmail.com> wrote: &g

Re: passing data to template

2017-06-14 Thread sum abiut
ndfor%} > > > `{{results|pprint}}` is pretty clear. You have a list of tuple. Tuples > have no named member so a.nat_balance return a None value. > {{ a.0 }} in your django template is the equivalent of a[0] in python. > > If you want dict-like object, your problem is with SQ

Re: passing data to template

2017-06-13 Thread sum abiut
736146, 0.0), (736178, 0.0), (736208, 185.0), >> (736240, -285.68), (736269, 0.0), (736299, 0.0), (736332, 44.32), (736361, >> 0.0), (736389, 0.0), (736422, 0.0), (736451, -40.0), (736481, 0.0)] >> >> >> On Tue, Jun 13, 2017 at 5:33 PM, ludovic coues <cou...@gmail.co

Re: passing data to template

2017-06-13 Thread sum abiut
will not solve your problems but that will give you a lot more > information about what data have been passed to your template. > > On 13 Jun 2017 6:53 am, "sum abiut" <suab...@gmail.com> wrote: > >> Hi, >> I need some help, i am using Django as my web framew

passing data to template

2017-06-12 Thread sum abiut
Hi, I need some help, i am using Django as my web framework and sqlalchemy to query my database. When i pass data template its not showing on the template. can someone point me to the right direction. The post date is loaded on the template but the Net Balance is not loaded. Don't know what i am

Re: template drop down menu

2017-06-06 Thread sum abiut
gt; if you're patient. > > Might be easier to find some simple tutorials than wade through my code, > but hey, it's there to look at if you want to see a working demo (almost, > that site isn't live yet so can't point you at it running alas). > > Regards, > > Bernd. > > su

Re: template drop down menu

2017-06-06 Thread sum abiut
e data > according to the value of the select. With no request to your server, > data will be updated really fast. That solution work really well for > small to medium amount of data. > > 2017-06-06 7:40 GMT+02:00 sum abiut <suab...@gmail.com>: > > Hi, > > need some

template drop down menu

2017-06-05 Thread sum abiut
Hi, need some directions, i need to query the my database and display the result of the query in the table. to do that i want to use a drop down menu and get the users to select options from the drop menu on the template. for example if a user select a word from the drop down menu i want to

julian date to normal date conversion

2017-06-05 Thread sum abiut
i am using python,and django as my web framework. I use sqlalchemy to connect to MSSQL data that is running Epicor database. Epicor is using julian * date. How to you convert julian date to normal date* *cheers,* -- You received this message because you are subscribed to the Google Groups

django 1.11 login user

2017-05-04 Thread sum abiut
Hi, i have try to login user using the guide from https://docs.djangoproject.com/en/1.11/topics/auth/default/ but get an error. Can someone advise what i am doin wrong here he is my view.py #Authentication user def login(request): username=request.POST['username']

Re: send email with django

2017-04-19 Thread sum abiut
Have you install the sendgrid backend? what is the error message you are getting On Thu, Apr 20, 2017 at 8:48 AM, shahab emami wrote: > but that doesn't work for me too. > > i sign up in sendgrid and this is my new settings.py > > EMAIL_HOST = 'smtp.sendgrid.net' >

Re: send email with django

2017-04-19 Thread sum abiut
I am also using sendgrid it works very well. On Thu, Apr 20, 2017 at 6:56 AM, shahab emami wrote: > but it's free for 30 days. what i have to do after 30 days? > > On Wednesday, April 19, 2017 at 6:18:38 PM UTC+4:30, Thiago Luiz Parolin > wrote: >> >> i am using sendgrid

Re: python django fields and row calculation

2017-04-05 Thread sum abiut
y work through the > applications for the user in the order in which they have been received? > ... > > cheers > L. > > > -- > The most dangerous phrase in the language is, "We've always done it this > way." > > - Grace Hopper > > On 5 A

Re: python django fields and row calculation

2017-04-04 Thread sum abiut
his > way." > > - Grace Hopper > > On 5 April 2017 at 10:49, sum abiut <suab...@gmail.com> wrote: > >> Hi, >> >> I am working on an leave management system and I am having a some >> difficulties trying to figure out how to accomplished this scenar

  1   2   >