Make a model form field not required

2014-05-15 Thread Brendan Edwards
Hi, I am having some issues with making my form/model fields not required. Currently this is the code that I have: forms.py: class startRound(forms.ModelForm): player_2 = forms.CharField(widget=forms.TextInput(attrs={'disabled':'True', 'hidden':'True', 'id':'player_2'})) player_3 =

Re: Django export CSV file of two objects

2014-05-15 Thread hito koto
Hi, i also write the views but the column was freaking After output to excel in this code. def export_excel(request): response = HttpResponse(mimetype='application/vnd.ms-excel; charset="Shift_JIS"') response['Content-Disposition'] = 'attachment; filename=file.csv' writer =

Re: Multiple Model Form Generation

2014-05-15 Thread Brendan Edwards
> > Why not just do this? (Sorry for the crappy indentation.. tab doesn't work > on here for some reason) > > models.py: > > >> class SignUpForm(forms.ModelForm): >> class Meta: >> model = Customer >> > > class VmForm(forms.ModelForm): > class Meta: >

Re: Multiple Model Form Generation

2014-05-15 Thread Brendan Edwards
Why not just do this? (Not sure if this is the most efficient way..) models.py: > class SignUpForm(forms.ModelForm): > class Meta: > model = Customer > class VmForm(forms.ModelForm): class Meta: model = Vms class VmSpecForm(forms.ModelForm):

Re: Programatically reverse an url to other language

2014-05-15 Thread Tomas Ehrlich
Hi, use ugettext_lazy for translation of urls, models and other stuff which is loaded before language is determined (it's usually done in Middleware or later in view, otherwise all strings will be translated into default language). You can also write: url(_(r'^about$'), views.about,

Programatically reverse an url to other language

2014-05-15 Thread Jorge Cardoso Leitão
Hi. I'm trying to reverse urls to other languages and I'm having some difficulties: Consider a new project in python 3.3 Django 1.6.4 with the adittional settings LOCALE_PATHS = (BASE_DIR + '/locale',) LANGUAGE_CODE = 'en-us' LANGUAGES = ( ('en-us', 'English'), ('de',

Re: Multiple Model Form Generation

2014-05-15 Thread G Z
> > so I changed it a bit after doing some more research however formb, and > formc don't display, if I change the 'formb' to 'form' it will overwrite > the first one and only display the second one. > This is how i read the forignekey associate between multiple forms to be. > from

Multiple Model Form Generation

2014-05-15 Thread G Z
I want to call three models into one form on my page but it doens't like the way that i am doing it. Any help would be awesome if i call them idividually it just displaces the last one i call. from django import forms from .models import Customer, Vms, Vmspecs class

Re: csrf question

2014-05-15 Thread G Z
solved it from django.shortcuts import render from django.http import HttpResponse from vmware.models import Customer from django.shortcuts import render_to_response from vmware.models import Vms from .forms import SignUpForm from vmware.models import Vmspecs from django.views.decorators.csrf

Re: csrf question

2014-05-15 Thread G Z
What do you mean, If i take it out of the ctx dictionary how do I pass it. if I just declare the @csrf_protect I still get the token error trying to post my form, infact the csrf issue is the only thing I have left to fix. How are you supposed to do the csrf token because im following the

Re: Is Django the best for my web app ?

2014-05-15 Thread Mark Phillips
Amelie, Django may be overkill for your application. However, it is very easy to use, and takes care of all the little, and big, details of getting a web application to work. The documentation is very good, and the community is very helpful. Good luck! Mark On May 15, 2014 6:13 AM, "Amelie

Re: csrf question

2014-05-15 Thread donarb
On Wednesday, May 14, 2014 11:35:46 PM UTC-7, G Z wrote: > > So I read the documentation on passing csrf tokens, however its giving me > an issue i think its because im trying to pass it as a dictonary variable > with my form and customers. > > This is from the documentation > > from

Re: Is Django the best for my web app ?

2014-05-15 Thread Amelie Bacle
Ok thanks for your answers. Yeah maybe that best suits not here, I meant is Django able to do what I plan to do before I start studying the framework and loss time. Let's see the tutorial then ! On Thursday, May 15, 2014 11:33:05 AM UTC+2, Amelie Bacle wrote: > > Hello everyone, > > I have to

Re: Django authentication by email

2014-05-15 Thread Brian Schott
Django-allauthhttps://github.com/pennersr/django-allauth — Sent from Mailbox On Thu, May 15, 2014 at 7:58 AM, Frankline wrote: > Hi all, > I am thinking of developing a web application where users will have to > login by their email address instead of using their usernames.

Handling multiple jQuery-Ajax requests from Template to Veiw in parallel

2014-05-15 Thread Subhamoy Sengupta
Hi, From my Django application's template, I need to post some data to the same Django application's view, and there is a method in view that should perform further operations with them. From my JavaScript, I am trying to send a bunch of requests at the same time, like this:

Re: Django authentication by email

2014-05-15 Thread Vibhu Rishi
Hi, django-allauth will work for your needs. Give it a try. http://django-allauth.readthedocs.org/en/latest/ V. On Thu, May 15, 2014 at 5:26 PM, Frankline wrote: > Hi all, > > I am thinking of developing a web application where users will have to > login by their email

Re: Django authentication by email

2014-05-15 Thread Venkatraman S
On Thu, May 15, 2014 at 5:26 PM, Frankline wrote: > Hi all, > > I am thinking of developing a web application where users will have to > login by their email address instead of using their usernames. > > Now I know I can do this by writing my own auth backend, but I'm just >

Django authentication by email

2014-05-15 Thread Frankline
Hi all, I am thinking of developing a web application where users will have to login by their email address instead of using their usernames. Now I know I can do this by writing my own auth backend, but I'm just curious how the rest of you handle this. Do you normally use third party packages to

Why some static files work, but others don't?

2014-05-15 Thread Jason S
Hi, I've just created a really basic django site, its got the tutorial polls and thats about it. I've added in the metro UI and added it to the static files directory under the appropriate app. I've also used the collectstatic command and it picks up the files. But both with Apache and using

Re: Is Django the best for my web app ?

2014-05-15 Thread Tom Evans
On Thu, May 15, 2014 at 10:33 AM, Amelie Bacle wrote: > Hello everyone, > > I have to do a web application at my work. I use to program with Python > every day but never for web application. So I wanted to know if Django is > the best choice for my problem. Here it is, in

Re: Is Django the best for my web app ?

2014-05-15 Thread Avraham Serour
follow the django tutorial On Thu, May 15, 2014 at 12:33 PM, Amelie Bacle wrote: > Hello everyone, > > I have to do a web application at my work. I use to program with Python > every day but never for web application. So I wanted to know if Django is > the best choice

Re: csrf question

2014-05-15 Thread Bob Gailer
On May 15, 2014 2:36 AM, "G Z" wrote: > > So I read the documentation on passing csrf tokens, however its giving me an issue i think its because im trying to pass it as a dictonary variable with my form and customers. > > This is from the documentation > > from

Is Django the best for my web app ?

2014-05-15 Thread Amelie Bacle
Hello everyone, I have to do a web application at my work. I use to program with Python every day but never for web application. So I wanted to know if Django is the best choice for my problem. Here it is, in my application there will be only one form (with some file uploading). After the

Re: django and oracle

2014-05-15 Thread J. D.
On Wednesday, 14 May 2014 21:08:11 UTC+4, Avraham Serour wrote: > > it looks like your error occurs when using django ORM with oracle, but in > the beginning of your email you mention that you don't want to use it, so > what's the problem here? > > I want to reuse established connection with

Django export CSV file of two objects

2014-05-15 Thread hito koto
Hello, I want to export file from database and from two objects; I'm use MYSQL, I have two objects: 1, attendance object: 2. get_work object: I now can export one object's datas; So, i how can export datas of two objects; My the views.py is here: def export_excel(request): response =

Re: Django Form Question, Last Post Wasn't Formatted Correctly So I Deleted and Made a New One.

2014-05-15 Thread G Z
thanks On Wednesday, May 14, 2014 5:37:31 PM UTC-6, Jason Arnst-Goodrich wrote: > > You're passing two different dictionary parameters there. Try something > like this: > > ctx = { 'customers':customers, 'form': form } > return render_to_response('index.html', ctx) > > On

csrf question

2014-05-15 Thread G Z
So I read the documentation on passing csrf tokens, however its giving me an issue i think its because im trying to pass it as a dictonary variable with my form and customers. This is from the documentation from django.views.decorators.csrf import csrf_protectfrom django.shortcuts import