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 = ('datefield

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: 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 O

Re: updating data in a row

2015-01-12 Thread sum abiut
https://django-tables2.readthedocs.org/en/latest/) > > Is this all of the functionality that you'll need? Have you considered > looking at the built-in admin, which provides this functionality with > little to no coding required? > > -James > > On Sun, Jan 11, 2015 at 6:59 PM

Re: updating data in a row

2015-01-12 Thread sum abiut
Hi James, Thanks heaps for your help. your help is very much appreciated . I manage to fix my issue. I wouldn't have done it without your help. :) Cheers. On Tue, Jan 13, 2015 at 10:24 AM, sum abiut wrote: > Hi James, > > I have already coding the two views my problem is upd

Re: updating data in a row

2015-01-12 Thread sum abiut
table}} On Tue, Jan 13, 2015 at 10:58 AM, sum abiut wrote: > Hi James, > > Thanks heaps for your help. your help is very much appreciated . I manage > to fix my issue. I wouldn't have done it without your help. :) > > Cheers. > > On Tue, Jan 13, 2015 at 10:24 A

passing variables

2015-01-12 Thread sum abiut
How to you pass variable from one template to another template? 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 django-users+unsubscr...@googlegroups.com

Re: updating data in a row

2015-01-12 Thread sum abiut
e URL listed in your error has a double slash at > the end. > > -James > On Jan 12, 2015 4:49 PM, "sum abiut" wrote: > >> I am having a slight issue. click on the edit to working fine but when i >> make change ans click save. i get this error >> >> >

filter

2015-01-15 Thread sum abiut
Hi, I am trying to two column and display some result if two conditions are meet but i am getting this error: The view eLeave.views.FMKD1_leave_to_authorize didn't return an HttpResponse object. It returned None instead. I can seems to figure out the issue, here is my view.py file def FMKD1_lea

Re: filter

2015-01-15 Thread sum abiut
quot; to True it won't work, try it like this > > if new_leave.exists() and a.exists(): > return ... > > > On Thu, Jan 15, 2015 at 8:40 PM, sum abiut wrote: > >> >> >> Hi, >> I am trying to two column and display some result if two conditions are >&

Re: filter

2015-01-15 Thread sum abiut
re you expecting to see? What are you actually seeing? > > On Thu, Jan 15, 2015 at 9:48 PM, sum abiut wrote: > >> Ok thanks, >> >> i just released that i have made a mistake. so basically here are my >> template.html and view.py >> i think there is a mistake in

Re: filter

2015-01-19 Thread sum abiut
Thanks very much for all the help I am getting from you guys. your help is very much appreciated. cheers, On Mon, Jan 19, 2015 at 8:32 PM, Abraham Varricatt < abraham.varric...@googlemail.com> wrote: > In addition to the other answers, I will suggest that you re-think your > view logic - you ha

sending email

2015-01-19 Thread sum abiut
Hi, I am trying to send an email to several users once a form is submit. I have done the view.py to update the database once the form is submitted and is working fine. what i want to accomplish when the form is submitted is to update the database and at the same time send out email when a user clic

Re: sending email

2015-01-21 Thread sum abiut
Thanks, I am trying to send email to the users that their email address is stored in the database on the auth_user table. can someone please point me to the right direction. Cheers, On Thu, Jan 22, 2015 at 3:03 PM, Collin Anderson wrote: > Hi, > > Yes, this is possible. Something like: > > fro

Re: sending email

2015-01-25 Thread sum abiut
Hi Collin, Thank you very much for your help. its works perfectly. The next thing i want to do is to send an email to a specific user that i select on a table. when an authorized user select a user to approve his or her leave i want an email to be send to the user. so basically when i click on the

forloop

2015-01-26 Thread sum abiut
Hi, i am getting an error as below when iterating throw rows. Basically what i want to do is iterate through number of rows. When on the last row i want to compare a column then send out an email. here is the error that i am getting: global name 'forloop' is not defined here is my view.py: d

Re: forloop

2015-01-26 Thread sum abiut
Thank you for your email. I am iterating all the row to find out which row was recently added. basically when a row is added to it become last. so i am trying to comparing a column on the last row. which is the row that was recently add if the condition of the column is exist. that is when i send o

Re: forloop

2015-01-26 Thread sum abiut
won't be true. > > On Mon, Jan 26, 2015 at 5:38 PM, sum abiut wrote: > > Thank you for your email. I am iterating all the row to find out which > row > > was recently added. basically when a row is added to it become last. so > i am > > trying to comparing

iterate

2015-01-26 Thread sum abiut
is it possible to iterate through a number of rows to find out which row was the earliest to be enter. 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

Re: forloop

2015-01-27 Thread sum abiut
based on the object that you asked about initially. I don't think > that does what you want, as it will send out an email every time no matter > what, not just every time that obj.department == 'GOV' (which is probably > the check you want instead). > > -James > > O

Re: forloop

2015-01-27 Thread sum abiut
Thanks James, I have figure out how to do that. thanks again for your help. On Wed, Jan 28, 2015 at 9:33 AM, sum abiut wrote: > Hi James, > Thanks very much for shearing your intellect, i really appreciate your > help. It works perfectly well. i want the users who receive the email to

Re: sending email

2015-01-27 Thread sum abiut
Can someone please guide me here. i am kinda lost, the other part is ok just the email part i am really lost, please help here is my view.py the email part is not working def coporateservices_authorized_Leave(request, id): if request.method == 'POST': a=newleave.objects.get(id=id)

Re: sending email

2015-02-01 Thread sum abiut
n your send_mail call, you are encapsulating to_emails inside of > another list, like this send_mail(..., [to_emails]). Something tells me you > probably don't need to do that, since to_emails is already a list, but I > could be wrong there as well. > > -James > > > >

Re: sending email

2015-02-02 Thread sum abiut
ls.IntegerField(default=20) username =models.ForeignKey(User, default =1) On Mon, Feb 2, 2015 at 8:44 PM, monoBOT wrote: > > 2015-02-02 6:51 GMT+01:00 sum abiut : > >> >> to_emails = [a.admins.all()] > > > You are asking for item admins here: &g

Re: sending email

2015-02-02 Thread sum abiut
dels.TextField() > authorization_date =models.DateField(null=True) > corporate_services_authorization =models.CharField(max_length=45) > authorized_by1=models.CharField(max_length=45) > remarks1=models.TextField(default ="") > authoriztaion1_dat

Re: sending email

2015-02-02 Thread sum abiut
iables rather than concatenating them using the + > notation. For example: > > "Your Leave Application have been approved by {}".format(a.authorized_by1) > > It is more conventional and will make it easier to start passing in > strings for translation later, if needed. &g

survey Site

2015-02-05 Thread sum abiut
Hi, I am planning to build a survey site using django just wondering if django is the best option to get survey done. 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

Re: SMTPAuthenticationError sending email via smtp.gmail

2015-02-09 Thread sum abiut
Have you tried SendGrid mail. create a sendgrid account and used it instead of gmail. On Tue, Feb 10, 2015 at 12:30 PM, François Schiettecatte < fschietteca...@gmail.com> wrote: > It does not really have to do with Django, it has to do with OAuth which > Google just started enforcing in gmail, y

allow certain users to access certain views

2015-02-18 Thread sum abiut
Hi, I have an app that i am trying to allow only certain users to access specific views. For example all users can view the home page but for a certain link. i only want to allow the HR manager to access it. Could you please point me to right direction. Cheers -- You received this message becau

Re: allow certain users to access certain views

2015-02-19 Thread sum abiut
le to everyone. > > Alternatively, you can tweak the user.is_staff attribute to True for those > that need extra access, and use that as your permission check if you don't > need anything fancy. > > -James > On Feb 18, 2015 9:49 PM, "sum abiut" wrote: > >

extracting data from three tables

2015-02-19 Thread sum abiut
Hi, I have three models that i want to extract data from them. The models are join using foreign key. i am not sure how to do that in django. Can someone please point me to the right path. Cheers -- You received this message because you are subscribed to the Google Groups "Django users" group.

importing csv data into database

2015-03-31 Thread sum abiut
Hi, Could someone please advise this i am trying to import data from csv file or write to database but i am confuse on how to start. i am using sqllite database. Cheers, -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this g

Re: importing csv data into database

2015-03-31 Thread sum abiut
on in its setUp() method. This testcase would > create a separate test database, import the data into it, run your test > functions, and then clear the test database. This approach would also let > you, for example, deliberately insert malformed info into the data and > verify that y

generating pdf report with django-easy-pdf

2015-04-22 Thread sum abiut
Hi, I am trying to generate pdf reports using django-easy-pdf but some how i am not geting the data. here is what i get. i only get the header but not the data. i think i am missing something from class viewpdfreport that i can't seem

Re: generating pdf report with django-easy-pdf

2015-04-22 Thread sum abiut
7;re using, I suspect you need > to add the govstaff variable to your context within the get_context_data() > method in your view class. Otherwise your template has no idea what data > you are trying to display. > > -James > On Apr 22, 2015 6:16 PM, "sum abiut" wrote: &g

Re: importing csv data into database

2015-04-23 Thread sum abiut
gs, **callback_kwargs <http://10.0.142.35:8000/readcsvfile/#> /var/www/html/webapp/csvapp/views.py in readcsvfile data.FirstName=row[1], <http://10.0.142.35:8000/readcsvfile/#> Cheers, Sum On Wed, Apr 1, 2015 at 1:51 PM, sum abiut wrote: > Thanks guys, > appreciate your he

Re: importing csv data into database

2015-04-25 Thread sum abiut
t;> And then re-run this again? When you hit the offending row of data, it >> should pop you into the python debugger >> <https://docs.python.org/2/library/pdb.html>. type 'print row' >> and you should see what the problem is. If not type 'next' and

Re: importing csv data into database

2015-04-26 Thread sum abiut
r', 'surprise', 'fanatical devotion to the pope',) n > clearly creates a 3-item tuple. But so does > weapons = 'fear', 'surprise', 'fanatical devotion to the pope', > and in fact > weapons = 'fear', > creates a 1-item

Re: importing csv data into database

2015-04-26 Thread sum abiut
1600 Pennsylvania Avenue > > Then data.FirstName is going to be > > ('Barack',) > > Which is a single-element tuple. When it gets turned into a string, it > becomes ('Barack',) > > On Sun, Apr 26, 2015 at 4:25 AM, sum abiut wrote: > >> i am imp

Re: importing csv data into database

2015-04-26 Thread sum abiut
wow! Thanks heaps Mario :) . it works like a champ, Thank you James and Andrew for the directions. you guys were a great help. Cheers On Mon, Apr 27, 2015 at 12:10 PM, Mario Gudelj wrote: > Remove comma from each line inside the for loop. > On 27/04/2015 10:44 am, "sum abiut"

upload csv file from different directories

2015-04-29 Thread sum abiut
Hi I am writing an app that upload csv file and write csv data to models. So far everything is working fine. What i want to do now is to be able get the users to be able to upload csv files from different directories. I cannot seem to figure this out, i need directions. form the function* csvimpo

Fwd: upload csv file from different directories

2015-05-02 Thread sum abiut
-- Forwarded message -- From: sum abiut Date: Thu, Apr 30, 2015 at 2:18 PM Subject: upload csv file from different directories To: django-users@googlegroups.com Hi I am writing an app that upload csv file and write csv data to models. So far everything is working fine. What i

datepicker

2015-05-26 Thread sum abiut
Hi, Is there a way to implement jquery datepicker with Django models. I am looking at http://jqueryui.com/datepicker/ but i am finding very difficult to apply it to django models. any help will be very much appreciated. Cheers -- You received this message because you are subscribed to the Google

Re: generating pdf report with django-easy-pdf

2015-06-09 Thread sum abiut
Thanks Jose, i will try that out and see how it goes. Cheers, Sum On Mon, Jun 1, 2015 at 9:44 AM, Jose Aguirre wrote: > > *You need to add the get method this:* >> > > def get(self, request, *args, **kwargs): > > """ > Handles GET request and returns HTTP response. > """ > cont

Pulling data from two table

2015-01-08 Thread sum abiut
Hi, can someone please help. i am trying to pull data from two table in django and display the results. can someone please point me to the right direction. kind regards, Sum A -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Re: Pulling data from two table

2015-01-08 Thread sum abiut
> what models are they associated with? > > On Thu, Jan 8, 2015 at 6:01 PM, sum abiut wrote: > >> Hi, >> can someone please help. i am trying to pull data from two table in >> django and display the results. can someone please point me to the right >> direction. >

Re: Unable to install django on ubuntu 12.04

2015-01-08 Thread sum abiut
Its permission issue. you need to login as root and then try install again. enjoy, Sum On Fri, Jan 9, 2015 at 8:21 AM, Alex Mandel wrote: > On 01/08/2015 12:06 PM, nitin katyal wrote: > > As per the Django installation guide, I have installed pip using "sudo > > apt-get install python-pip". Pi

Re: Pulling data from two table

2015-01-08 Thread sum abiut
you trying to make? or what information do you want to > display? > > On Thu, Jan 8, 2015 at 6:50 PM, sum abiut wrote: > >> Hi Vijay, >> Thank you for your email. Here is my models. i want to be able to pull >> out all the data from both table and display them. i am a bit

updating data in a row

2015-01-08 Thread sum abiut
Hi, i am trying to update data in a row from an existing database but i keep getting this error. update_form() takes exactly 2 arguments (1 given) can someone advise what i am missing here. here are my code: view.py def update_form(request, id): if request.method == 'POST': a=newl

Re: updating data in a row

2015-01-08 Thread sum abiut
? > > -James > On Jan 8, 2015 6:49 PM, "sum abiut" wrote: > >> >> Hi, >> i am trying to update data in a row from an existing database but i keep >> getting this error. >> >> update_form() takes exactly 2 arguments (1 given) >> &

Re: Pulling data from two table

2015-01-08 Thread sum abiut
"staff" and > "leave") and fields in underscore (first_name instead of First_Name, etc) > > On Thu, Jan 8, 2015 at 11:41 PM, sum abiut wrote: > >> Hi, >> i am trying to pull out all the information in both model. i can pull out >> inform

Re: updating data in a row

2015-01-08 Thread sum abiut
uot; argument > > def update_form(request): > > in that case you can pass the id in the POST body of the request > > > On Fri, Jan 9, 2015 at 12:50 AM, sum abiut wrote: > >> hi James, >> here is the url.py >> >>url(r'^update_form/$'

Re: updating data in a row

2015-01-11 Thread sum abiut
Exception Type: TypeError at /update_form/ Exception Value: update_form() takes exactly 2 arguments (1 given) thanks, On Fri, Jan 9, 2015 at 4:46 PM, James Schneider wrote: > What URL are you visiting and can you post the traceback? > On Jan 8, 2015 9:25 PM, "sum abiut" wrot

Re: updating data in a row

2015-01-11 Thread sum abiut
mapping then you need to include the id of the > newleave in the URL you are accessing, for example > > http://10.0.X.X:8000/update_form/1/ > > On Sun, Jan 11, 2015 at 7:27 PM, sum abiut wrote: > >> Hi James, >> >> I am try to visit this url http://10.0.X

Re: updating data in a row

2015-01-11 Thread sum abiut
I want to be able to click on a row, update it and then click on another row update it and so on. On Mon, Jan 12, 2015 at 12:58 PM, sum abiut wrote: > Thanks very much Vijay its works. But it doesn't really solve my problem, > because i want to be able to edit more than one rows in

Re: updating data in a row

2015-01-11 Thread sum abiut
5 at 12:30 AM, sum abiut wrote: > >> I want to be able to click on a row, update it and then click on another >> row update it and so on. >> >> On Mon, Jan 12, 2015 at 12:58 PM, sum abiut wrote: >> >>> Thanks very much Vijay its works. But it doesn't re

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 django-livestore, a fo

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 MySQL insted of SQLite. How do

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 subscr

Re: django-payslip

2018-01-22 Thread sum abiut
/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" wrote: > > Hi, > Has anyone from

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 can't seem to figure out >>

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: view user profile access restriction

2018-01-28 Thread sum abiut
if kwargs["created"]: user_profile = Profile(user=user) user_profile.save() post_save.connect(create_profile, sender=User) On Mon, Jan 29, 2018 at 1:02 PM, Dylan Reinhold wrote: > There are a bunch of ways to do it. > Show us your view, if it's a fu

Re: view user profile access restriction

2018-01-28 Thread sum abiut
ed view.py* 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 wrote: > Thanks heaps that wo

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 information from my > Profile

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: cannot import name 'views' > > --

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 form.is_valid():

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 connectto_db(

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 project that I want to work on with

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 wr

Re: modelform selection options

2018-02-17 Thread sum abiut
ynum.num}} {%endfor%} i manage to load the form, but the drop down list elements are not showing. cheers, On Fri, Feb 16, 2018 at 11:00 AM, sum abiut wrote: > I have a model.py > class selection(models.Model): > select=( > (A','A

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: django mathfiters

2018-02-21 Thread sum abiut
. Thanks On Thu, Feb 22, 2018 at 9:15 AM, Matthew Pava 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:* Wednesday, February 21, 2018 4

Re: django mathfiters

2018-02-21 Thread sum abiut
o-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 was actually None. how to

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 us

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 the select value. I hav

Re: django mathfiters

2018-02-28 Thread sum abiut
I would do it like this: > > {% if c %} > > {{ a|add:c }} > > {% else %} > > {{ a }} > > {% endif %} > > > > *From:* django-users@googlegroups.com [mailto:django-users@ > googlegroups.com ] *On Behalf Of *sum abiut > *Sent:* Wednesday, February 21, 20

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 recei

Re: import file from view.py

2018-03-14 Thread sum abiut
s.py and use it for getting the > relevant values. Hope this helps. > > Thanks, > Mahesh. > > On Tue, Mar 13, 2018 at 21:06 sum abiut wrote: > >> I have a conf file containing the parameter of hostmane,db,usernam,pass, >> db >> >> i want to import that file fr

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 s

Re: survey form

2018-03-20 Thread sum abiut
Thanks heaps Mike. On Wed, Mar 21, 2018 at 3:21 PM, Mike Dewhirst 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 be answer by the users.But i am ha

Re: survey form

2018-03-26 Thread sum abiut
delete=models.CASCADE) class QuestionAnswer(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 wrote: > Thanks heaps Mike. > > > On Wed, Mar

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: s

Re: export sql query to excel

2018-04-15 Thread sum abiut
ble to download the file to their desktop instead of exporting it to the server itself On Mon, Apr 16, 2018 at 3:27 PM, sum abiut 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. appreciate any &g

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 wrote: > > my code actually worked. I thought it was going to save the excel file to > > 'C:\ex

Re: export sql query to excel

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

Re: export sql query to excel

2018-04-16 Thread sum abiut
t; # this process is fast, for my surprise > for row in rows: > tmpRows += 1 > tmpColumns = 0 > for column in columns: > tmpColumns += 1 > sheet.cell(row = tmpRows, column = tmpColumns).value = str(getattr > (row,column)) > > excel_file_name = "myfilenamegoeshere.xls

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 jus

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 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 wrote: > >> I have tw

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

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 wrote: > I have a function t

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 wrote: > Current i have a for loop > > > Date > > {

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))) result_proxy=connection.

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 Groups

Re: serving admin files in Apache

2018-05-03 Thread sum abiut
he static root folder you specified > in settings.py > > On Thu, May 3, 2018 at 4:40 PM sum abiut wrote: > >> 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 >>

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 happen

subtracting recent data from previous data

2016-06-20 Thread sum abiut
Hi, I need some help with an app that i am working on. i have a csv file that one of our user is uploading and populating data in the database every month. here is an example of what it looks like a clear picture is attached. *Revenue* *Amount* * Month* * Year* USD Int on FT Deposit 2035

connecting to mssql database

2016-08-17 Thread sum abiut
Hi, i am having a very hard time figuring out how to connect to a mssql database. i've try following this guide but nothing seems to be working. please help http://www.tivix.com/blog/getting-django-working-with-mssql-pyodbc/ https://pypi.python.org/pypi/django-pyodbc-azure cheers, -- You recei

Re: connecting to mssql database

2016-08-17 Thread sum abiut
ing? > > On Wed, 17 Aug 2016 at 14:15 sum abiut wrote: > >> >> Hi, >> i am having a very hard time figuring out how to connect to a mssql >> database. i've try following this guide but nothing seems to be working. >> please help >> >>

Re: connecting to mssql database

2016-08-17 Thread sum abiut
ImproperlyConfigured("Django %d.%d is not supported." % DjangoVersion[:2]) django.core.exceptions.ImproperlyConfigured: Django 1.10 is not supported. is this something has to do with version issue? cheers On Thu, Aug 18, 2016 at 8:44 AM, sum abiut wrote: > I am getting the error

  1   2   >