Re: django on rhel5 with both python2.4 and python2.7 confusion

2014-05-16 Thread Kelvin Wong
I haven't used mod_python in such a long time that I don't recall the configuration details. Off the top of my head, you might want to check how to add the Python 2.7 site-packages folder to the path that mod_python searches for python modules like Django. Also, check this out on SO. http://st

Re: Can't get i18n/setLang to match any urls

2014-05-16 Thread Kelvin Wong
The L in setLang should be setlang as in the L is lowercase >From my Django log "POST /i18n/setlang/ HTTP/1.1" 302 0 K On Wednesday, May 14, 2014 2:45:43 PM UTC-7, Shawn H wrote: > > I'm beginning the process of adding some translations to one public page, > and I can't get my setLang url to

Re: Django RequestFactory() secure not working

2014-05-16 Thread Kelvin Wong
If you print out your code you will see that you are adding a key-value to the WSGI environ: # print factory.post('/', secure=True) , POST:, COOKIES:{}, META:{ ... 'PATH_INFO': u'/', ... 'REQUEST_METHOD': 'POST', ... 'SERVER_PROTOCOL': 'HTTP/1.1', 'secure': True, ... 'wsgi.url_scheme':

Re: Registration in 1.8

2014-05-16 Thread Kelvin Wong
OP is new to Django. There are tons of old blog posts, working code, etc dealing with registration and basic app set-ups using 1.4. Also Django-registration works with 1.4, does it work with 1.6? K On Sunday, May 11, 2014 1:41:48 AM UTC-7, Lee wrote: > > What's the value in starting with 1.4?

Re: saving an istance of an object then trying to save it and it does not save

2014-05-16 Thread Mario Gudelj
That should work. Do you get any errors? On 16/05/2014 8:53 pm, "Coulson Thabo Kgathi" wrote: > if o get an object like this > > p = Plot.objects.get(plot_plot_identifier='123323423') > > then do > p.selected=1 > p.save() > > this does not save dont know why. > the is no where the field is being

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

2014-05-16 Thread Jason S
Not naive, its good to troubleshoot from the beginning. I've double checked that the files are in the paths, I had a play with the settings, even temporarily setting them to 777 to be sure its not a permission fault. Then i realised that I was in the project/static directory, i ensured the file

Re: Make a model form field not required

2014-05-16 Thread Brendan Edwards
Works like a charm, but I don't completely understand why that is necessary. When I defined the text input as hidden and disabled, it overwrote the initial settings of that field? what exactly does this line do? def __init__(self, *args, **kwargs): forms.ModelForm.__init__(self

Re: Multiple Model Form Generation

2014-05-16 Thread G Z
I tried it it doesn't work because they keys don't associate when you click save. On Friday, May 16, 2014 2:25:06 PM UTC-6, G Z wrote: > > Does that work if they all have forignekey associations with each other? > > On Thursday, May 15, 2014 4:12:34 PM UTC-6, Brendan Edwards wrote: >> >> Why not

Re: Multiple Model Form Generation

2014-05-16 Thread G Z
Does that work if they all have forignekey associations with each other? On Thursday, May 15, 2014 4:12:34 PM UTC-6, Brendan Edwards wrote: > > Why not just do this? (Sorry for the crappy indentation.. tab doesn't work >> on here for some reason) >> >> models.py: >> >> >>> class SignUpForm(form

Importing Existing Oracle Databases

2014-05-16 Thread G Z
Hello, I've been looking online how to build a model in models.py of an existing outside database. We developed and application in python, and I need to import its data from an oracle database. However I tried this before by establishing the fields in models.py to what the database says and run

How do I execute custom sql in a test right after the database is created?

2014-05-16 Thread John Rambo
First of all I know that is bound to break a lot of other things. I changed the core so references to tables are PostgreSQL fully qualified table name (e.g. "family"."person" instead of family_person). So far it had been doing what I want except I can't run tests because the schemas are not cre

Re: Is Django the best for my web app ?

2014-05-16 Thread Mark Phillips
Amelie, You are asking the right questions, although perhaps on the wrong list. ;-) One good reason for using a framework like django is that you don't have to worry so much about the "plumbing" of your applicationthere are a lot of really smart people doing that for you. The price you pay is

Re: Django csv export from two objects

2014-05-16 Thread Daniel Roseman
On Friday, 16 May 2014 12:34:52 UTC+1, hito koto wrote: > > Hi, > > I would like to export the csv file as follows: > > No name > date > time of attendance > time of leavework > 01 > hito > 2014/5/16 10:31:50 20:30 > 01 > hito > 2014/5/16 10:56:23 20:30 01 > hito > 2014/5/16 10:19:59 20:30

Re: Django csv export from two objects

2014-05-16 Thread hito koto
Hi, I would like to export the csv file as follows: No name date time of attendance time of leavework 01 hito 2014/5/16 10:31:50 20:30 01 hito 2014/5/16 10:56:23 20:30 01 hito 2014/5/16 10:19:59 20:30 02 charry 2014/5/16 10:18:40 20:30 02 charry 2014/5/16 10:12:52 20:30 02 charry 2014/5

saving an istance of an object then trying to save it and it does not save

2014-05-16 Thread Coulson Thabo Kgathi
if o get an object like this p = Plot.objects.get(plot_plot_identifier='123323423') then do p.selected=1 p.save() this does not save dont know why. the is no where the field is being modified anywhy not even on the save methon of the Plot model and there are no signals modifying the field at

Re: Django csv export from two objects

2014-05-16 Thread Daniel Roseman
On Friday, 16 May 2014 10:40:50 UTC+1, hito koto wrote: > > Hello, > > I want to export csv from the two objects > I have the erroe is here: > Exception Type: AttributeError Exception Value: > > 'QuerySet' object has no attribute 'id' > > > > > This is my the views.py : > > def export_excel(re

Re: Make a model form field not required

2014-05-16 Thread Sergej Peleshok
Now you just redefine fields with required=True by default. You need update widgets in __init__. class startRound(forms.ModelForm): class Meta: model = parentRounds def __init__(self, *args, **kwargs): forms.ModelForm.__init__(self, *args, **kwargs) self

Django csv export from two objects

2014-05-16 Thread hito koto
Hello, I want to export csv from the two objects I have the erroe is here: Exception Type: AttributeError Exception Value: 'QuerySet' object has no attribute 'id' This is my the views.py : def export_excel(request): response = HttpResponse(mimetype='application/vnd.ms-excel; charset

Re: Is Django the best for my web app ?

2014-05-16 Thread Amelie Bacle
Thanks again, I can see that the community of Django is very helpful now :). So if I understood well, I can just do a regular js script with AJAX that will execute a bash command on my python script ? I read that it may be dangerous, is that right ? And what about Python CGI ? Sorry if I ask

Re: Adding Forms with ModelForm and Writing Data

2014-05-16 Thread Venkatraman S
ctx = { 'customers':customers } to ctx = { 'customers':customers , 'form': form } On Wed, May 14, 2014 at 11:22 AM, G Z wrote: > so I changed my code into 3 parts. If I understood the documentation right >> this should create a form based on the Customer model in models.py and >> display i

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

2014-05-16 Thread Venkatraman S
Naive Q: did you check if the js files exist there? On Thu, May 15, 2014 at 5:23 PM, Jason S wrote: > 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 appropri

Re: Is Django the best for my web app ?

2014-05-16 Thread Venkatraman S
Honestly, django may be an overkill for you, as something lightweight like Flask might do the magic for this particular usecase. Or even a simple html with js should do without any added framework shebang. BUT, django, comes with an awesome community and loads of packages that might help you a t

Re: django and oracle

2014-05-16 Thread Jani Tiainen
On Thu, 15 May 2014 00:07:47 -0700 (PDT) "J. D." wrote: > > 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