Re: Extract values from form fields in templates

2009-02-20 Thread koranthala
On Feb 18, 11:33 pm, Karen Tracey wrote: > On Wed, Feb 18, 2009 at 8:52 AM, koranthala wrote: > > > Hi, > >    I am unable to extract values from form fields inside templates. > >    For example: > >      I have mutiple text fields in which one field says whether the > > second field is X or n

Re: Django

2009-02-20 Thread urukay
I think you need to write clean method for that form. If you meant anything else, then more information will be needed. http://docs.djangoproject.com/en/dev/ref/forms/validation/ Radovan Nalini-4 wrote: > > > While inputting an invalid username and password it should throw an > alert mes

Re: Admin filtering on a foreign key is "an unsorted mess" (not my words)

2009-02-20 Thread Daniel Roseman
On Feb 20, 4:32 am, Eric wrote: > Hi, I have an admin filter that filters all entries that have a > particular foreign key. Specifically, this foreign key is a "Code" > object that contains a "Code #" and a "Description". > > In the admin filter display, it shows all the codes I can filter by, >

Re: send_mail / mail_admins to qmail server

2009-02-20 Thread Reza Muhammad
On Feb 20, 2009, at 2:19 PM, Karen Tracey wrote: > ... > > > Or does it fail not because of the password? because I can connect to > the mail server from my regular email client with pretty much the same > setting. > > Pretty much the same? What's different? Do you specify anything > about sec

Re: Access extra parameters in forms.py

2009-02-20 Thread pete
Hi Malcolm, thanks for the reply. I've tried it with the fields indented like so: http://dpaste.com/122916/ I've commented out the browser choices and status fields etc to keep the amount of code down for the moment. I now get an error that assigned_to (line15) doesn't think that the variable

Overriding ID Field

2009-02-20 Thread burcu hamamcıoğlu
I want to define a custom id field, that holds a guid (uuid). But how can i override the default id field? I want it to modified as guid.. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Overriding ID Field

2009-02-20 Thread Masklinn
On 20 févr. 09, at 11:11, burcu hamamcıoğlu wrote: > I want to define a custom id field, that holds a guid (uuid). But > how can i override the default id field? I want it to modified as > guid.. > As indicated in the documentation, the 'id' field is only aurogenerated when a model has no

Re: Trouble with admin select related

2009-02-20 Thread Beres Botond
It doesn't work if you set up the list_select_related option explicitly in the ModelAdmin for Page? Or if you add the foreign key field to the list_display list. http://docs.djangoproject.com/en/dev/ref/contrib/admin/ Also have you tried just setting select_related() first, without any field opt

Re: Access extra parameters in forms.py

2009-02-20 Thread Daniel Roseman
On Feb 20, 9:01 am, pete wrote: > Hi Malcolm, thanks for the reply. > > I've tried it with the fields indented like so: >  http://dpaste.com/122916/ > > I've commented out the browser choices and status fields etc to keep > the amount of code down for the moment. > > I now get an error that assig

Re: Multiple different user profile objects - Django code design help

2009-02-20 Thread Beres Botond
To be honest I don't really see why you would need multiple user profile models, instead of having one user profile model, and each entry would define a different user profile. Of course I don't know the full details/requirementes of your project, and what exactly you are trying to do ... but I c

ManyToManyField admin save problem

2009-02-20 Thread Joshua Russo
Ok, so I believe I'm following the documentation properly for a ManyToManyField with the Through=xxx option here: http://docs.djangoproject.com/en/dev/ref/models/fields/#manytomanyfield class Pessoa(models.Model): Nome= models.CharField('Nome', max_length=100) Localidade = models

Re: ManyToManyField admin save problem

2009-02-20 Thread Joshua Russo
Here is the traceback: Environment: Request Method: POST Request URL: http://localhost:8000/admin/matriz/matriz/add/ Django Version: 1.0.2 final Python Version: 2.5.4 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites',

Re: login in django via plone

2009-02-20 Thread Alan
Hi there, thanks for your replies. Yes, Malcolm, I am reading this doc and following some discussion about ldap authentication, but Kevin got the right point. I will read more about backend authentication in django and then I will check in plone (even plone-list) about ideas besides the ones Kevin

Set a URL to be handled by PHP

2009-02-20 Thread Sylvain
Hi everybody, I'm looking for a way to handle a given URL with PHP. For the moment, the root URL is handled by mod_python as explained in the docs : SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE myproject.settings PythonPath

Re: Overriding ID Field

2009-02-20 Thread burcu hamamcıoğlu
I defined this field in my model like this. id = models.SlugField(max_length = 36, default = (lambda: str(uuid.uuid4())), db_index = True,primary_key=True,unique = True) But when i try to add a object from admin interface, I got an error message like "Please correct the errors below. " But there

Re: Overriding ID Field

2009-02-20 Thread Veeravendhan sakkarai
You just define your primary key field in the models, you can over come. Also we can auto generate UUID. like the autoincrimint id field. On Fri, Feb 20, 2009 at 3:41 PM, burcu hamamcıoğlu wrote: > I want to define a custom id field, that holds a guid (uuid). But how can i > override the defau

Re: login in django via plone

2009-02-20 Thread Alan
Thinking about Kevin's idea (2). What if I make plone export to the right mysql table (auth_user, DATABASE_NAME 'myapps' for example) the fields: id | username | first_name | last_name | email | password | is_staff | is_active | is_superuser | last_login | date_joined

Re: Set a URL to be handled by PHP

2009-02-20 Thread Matt McCants
Hey there, Try setting the Handler to None just like you do with your media directory. With a basic PHP setup it should process the php files in that directory. SetHandler None ~Matt On Fri, 2009-02-20 at 03:46 -0800, Sylvain wrote: > Hi everybody, > > I'm looking for a way to handl

Re: Access extra parameters in forms.py

2009-02-20 Thread pete
Hi Daniel, This has got me closer but i'm now just getting an empty select box appearing on in the form, with no data in. class NewBugForm(forms.Form): assigned_to = forms.CharField(max_length=50,widget=forms.Select (choices=[]), initial='Anyone',required=False) def __init__(self, *args, **

Template rendering error

2009-02-20 Thread Timothy
Hi Folks, in views: return render_to_response('tliste/import.html', {'data': allWrongData}) allWrongData is a list of Dictonaries of lists for instance [{"key" : ["Text one", "Text two"]}, {"key1" : ["Text three", "Text for"]}]... In the template I try: {% for item in data %} {{ item }}

Re: (Solved) Template rendering error

2009-02-20 Thread Timothy
Solved: wrong Syntax dots are needed {{ item.key.0 }} works Sorry Timothy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroup

grouping save() queries into a single query

2009-02-20 Thread Alessandro Ronchi
is it possible to group different model save() to avoid the multiplication of db connections and queries? I need to make a lot of save() of different new models and it should be very useful to find a way to group them and commit together. Is there any way to make persistant connections? I'm usin

Removing fields in a form subclass

2009-02-20 Thread David Zhou
Suppose I had this form: class BaseForm(forms.Form): field1 = forms.CharField(...) field2 = forms.Charfield(...) And then in a subclass, I had: class SubForm(BaseForm): field1 = forms.EmailField(...) What's a good way to remove field2 in SubForm? Setting field2 = None didn't work.

Re: Writing custom model fields with Multi-table inheritance

2009-02-20 Thread gordyt
Howdy Viktor, On Feb 1, 1:36 pm, Viktor wrote: > Hi, > > did you got any response or did you managed to solve your problem? > I've just started to search for a UUIDField, and it would be great to > have proper uuid columns for postgres. > > If so do you plan to commit it to django_extensions? S

how to save a file from a remote server?

2009-02-20 Thread ondrey
Hi, In my view I need to save locally a file (image) from a different server so I can further process it. But I can't figure out how to do it. Can someone help me with that? To be more concrete, the file is provided by a WMS (Web Map Service) server, so I have a URL (roughly something like http

Re: Template rendering error

2009-02-20 Thread Alex Koshelev
Do you read an attribute resolution rules [1]? [1]: http://docs.djangoproject.com/en/dev/topics/templates/#variables On Fri, Feb 20, 2009 at 5:53 PM, Timothy <83...@gmx.de> wrote: > > Hi Folks, > > in views: > > return render_to_response('tliste/import.html', {'data': > allWrongData}) > > allWr

Re: Removing fields in a form subclass

2009-02-20 Thread Alex Koshelev
Try this: del SubForm.fields['fields2'] On Fri, Feb 20, 2009 at 6:15 PM, David Zhou wrote: > > Suppose I had this form: > > class BaseForm(forms.Form): >field1 = forms.CharField(...) >field2 = forms.Charfield(...) > > And then in a subclass, I had: > > class SubForm(BaseForm): >fie

Re: Removing fields in a form subclass

2009-02-20 Thread David Zhou
Do you mean del self.fields['field2'] in SubForm's __init__? -- dz On Fri, Feb 20, 2009 at 10:39 AM, Alex Koshelev wrote: > Try this: > > del SubForm.fields['fields2'] > > > On Fri, Feb 20, 2009 at 6:15 PM, David Zhou wrote: >> >> Suppose I had this form: >> >> class BaseForm(forms.Form): >>

Re: Removing fields in a form subclass

2009-02-20 Thread Alex Koshelev
No. Place this code right after the SubForm definition. On Fri, Feb 20, 2009 at 6:42 PM, David Zhou wrote: > > Do you mean del self.fields['field2'] in SubForm's __init__? > > -- dz > > > > On Fri, Feb 20, 2009 at 10:39 AM, Alex Koshelev > wrote: > > Try this: > > > > del SubForm.fields['fields

Re: Removing fields in a form subclass

2009-02-20 Thread Alex Koshelev
Oh, sorry. Of course `base_field` instead. class SubForm(BaseForm): field1 = forms.EmailField(...) del SubForm.base_fields['fields2'] On Fri, Feb 20, 2009 at 6:45 PM, Alex Koshelev wrote: > No. Place this code right after the SubForm definition. > > > On Fri, Feb 20, 2009 at 6:42 PM, David

Connecting to Oracle

2009-02-20 Thread Brandon Taylor
Hi everyone, I'm having a hell of a time getting connected to Oracle... We're running Intel MacBooks, OS X 10.5.6, Python 2.6.1, Django Trunk, Oracle InstantClient 10_2. We have tried using cx_Oracle-5.0 and 4.4.1. cx_Oracle seems to compile and install successfully, but, when we attempt to run

Passing data back into forms

2009-02-20 Thread huw_at1
Hi, I have an app which starts with a form. Following user input and submission I generate another form as a table where results are rows in the table and the number of results varies. Each row has a checkbox so that the user can select rows to further process on submitting this form. My question

Re: Removing fields in a form subclass

2009-02-20 Thread David Zhou
Is the base_fields diciontary documented somewhere or is this more of a behind the scenes attribute that the Form metaclass converts field attributes to? -- dz On Fri, Feb 20, 2009 at 10:47 AM, Alex Koshelev wrote: > Oh, sorry. Of course `base_field` instead. > > class SubForm(BaseForm): >

Re: Add value to request header?

2009-02-20 Thread Brandon Taylor
Hi Malcom, Thanks for the response. I thought the same about the request headers being read only, and hadn't heard of something modifying the request header, only the response. b On Feb 18, 5:02 pm, Malcolm Tredinnick wrote: > On Wed, 2009-02-18 at 07:16 -0800, Brandon Taylor wrote: > > Hi eve

testing validation of form in unit testing

2009-02-20 Thread Vitaly
Hi all I have a test that validate processed data to form with FileField. My steps in it direct me right to one problem. here is it. 'file' is 'Required field' What I do is process simple data right to form, not request.POST and request.FILES. I have tried process in data SimpleUploadedFile but

Query over related models

2009-02-20 Thread Peter Müller
Hi These are my two (related) models: class Attachment(models.Model): post = models.ForeignKey('Post') name= models.CharField(max_length=255) class Post(models.Model): text = models.TextField() I want to select all Posts where text contains "Some Text" or Attachment.name (which is rel

Re: how to save a file from a remote server?

2009-02-20 Thread Jacob Kaplan-Moss
On Fri, Feb 20, 2009 at 9:25 AM, ondrey wrote: > In my view I need to save locally a file (image) from a different > server so I can further process it. But I can't figure out how to do > it. Can someone help me with that? http://docs.python.org/library/urllib.html#urllib.urlretrieve Jacob --~

Re: Query over related models

2009-02-20 Thread Jacob Kaplan-Moss
On Fri, Feb 20, 2009 at 9:43 AM, Peter Müller wrote: > I want to select all Posts where text contains "Some Text" or > Attachment.name (which is related to one post) contains "Some Text". > Is there a way to do this with Django's ORM? This is covered in the "Making queries" documentation (http:/

Re: Access extra parameters in forms.py

2009-02-20 Thread Daniel Roseman
On Feb 20, 2:40 pm, pete wrote: > Hi Daniel, > > This has got me closer but i'm now just getting an empty select box > appearing on in the form, with no data in. > > class NewBugForm(forms.Form): >   assigned_to = forms.CharField(max_length=50,widget=forms.Select > (choices=[]), initial='Anyone',

Oracle connection issue

2009-02-20 Thread Brandon Taylor
Hi everyone, I'm using Oracle instantclient_10_2 (Intel), cx_Oracle-5.0.1, OS X 10.5.6 (Intel), Python 2.6.1 and Django trunk. My built-in server will start up correct, but, when I attempt to get objects for a model, I receive the following error: InterfaceError: Unable to acquire Oracle enviro

Problem outputting date in template as timestamp

2009-02-20 Thread Sean Brant
I am trying to render a timestamp in my template with date:"U" but the timestamps are days off. I wrote up a simple test case that fails. Do you think this is a bug or a user error? I am running rev: 9846. from django.test import TestCase class SimpleTest(TestCase): def test_template_timesta

Re: Django/Apache/wsgi problems -- help!

2009-02-20 Thread Polat Tuzla
Also the /admin/ url gives > an internal error, which in apache's errlog shows a traceback > that ends in "OperationalError: no such table: django_session". This is most probably due to the fact that you did not set your DB_NAME variable with the full path of your .db file. And sqlite3 is creatin

Re: testing validation of form in unit testing

2009-02-20 Thread Briel
You don't give a lot information about what is happening, so I'm stabbing a bit in the dark here... I would guess your problem is that you have created a form which has a filefield that is required. Even though you probably upload a file and maybe even pass it to the form, you are not doing it in

Re: Grouping a list of entries by month name

2009-02-20 Thread Martin Lundberg
In my case I wanted to get something like this: January 2008 Post name Post name December 2007 Post name Post name I can't figure out how to do it the way your are saying. I thought about doing: {% for entry in monts %} {% ifchanged %}{{ entry.pub_date|date:"F Y" }}{%

PostgreSQL case sensitive icontains

2009-02-20 Thread Alessandro Ronchi
with postgreSQL I get case sensitive filters also with icontains. Is there nothing I can do to solve this problem? -- Alessandro Ronchi Skype: aronchi http://www.alessandroronchi.net SOASI Soc.Coop. - www.soasi.com Sviluppo Software e Sistemi Open Source Sede: Via Poggiali 2/bis, 47100 Forlì (F

Re: send_mail / mail_admins to qmail server

2009-02-20 Thread Karen Tracey
On Fri, Feb 20, 2009 at 3:55 AM, Reza Muhammad wrote: > > On Feb 20, 2009, at 2:19 PM, Karen Tracey wrote: > > ... > > >> > > Or does it fail not because of the password? because I can connect to >> the mail server from my regular email client with pretty much the same >> setting. >> > > Pretty mu

Re: Oracle connection issue

2009-02-20 Thread Matt Boersma
Brandon, Usually that error arises from cx_Oracle when the ORACLE_HOME environment variable isn't set. Try doing "manage.py shell" and looking at what's in os.environ--if you don't see ORACLE_HOME set to the correct location there, try fixing that first. Matt On Fri, Feb 20, 2009 at 9:41 AM, B

Re: Access extra parameters in forms.py

2009-02-20 Thread pete
Fantastic! that fixed it. Thank you soo much, been driving me crazy for days now, Pete On Feb 20, 4:40 pm, Daniel Roseman wrote: > On Feb 20, 2:40 pm, pete wrote: > > > > > Hi Daniel, > > > This has got me closer but i'm now just getting an empty select box > > appearing on in the form, with

Re: testing validation of form in unit testing

2009-02-20 Thread Vitaly
Here's the code that process all steps in unittest with checking validation form: http://dpaste.com/123059/ What I have tryed is to collect data myself as fixture to test the form validation. Thanks On Feb 20, 7:00 pm, Briel wrote: > You don't give a lot information about what is happening, s

django admin manytomany

2009-02-20 Thread May
I have a manytomany relationship between publication and pathology. Each publication can have many pathologies. When a publication appears in the admin template, I need to be able to see the many pathologies associated with that publication. Here is the model statement: class Pathology(models.Mod

Re: Trouble with admin select related

2009-02-20 Thread Karen Tracey
On Thu, Feb 19, 2009 at 7:10 PM, Trey wrote: > > I'm not sure if other people have stumbled onto this but I am having a > LOT of trouble getting the admin to use select related. > You know select_related is a performance optimization, right? It doesn't affect results in any way, just the number

Re: Problem outputting date in template as timestamp

2009-02-20 Thread garagefan
server date incorrect? I asked a similar question a while ago... turns out the server i'm using from godaddy was set for Arizona and was an additional 20 some minutes off... On Feb 20, 11:49 am, Sean Brant wrote: > I am trying to render a timestamp in my template with date:"U" but the > timesta

Re: Writing custom model fields with Multi-table inheritance

2009-02-20 Thread Karen Tracey
On Fri, Feb 20, 2009 at 10:21 AM, gordyt wrote: > > Howdy Viktor, > > On Feb 1, 1:36 pm, Viktor wrote: > > Hi, > > > > did you got any response or did you managed to solve your problem? > > I've just started to search for a UUIDField, and it would be great to > > have proper uuid columns for pos

Re: Connecting to Oracle

2009-02-20 Thread Karen Tracey
On Fri, Feb 20, 2009 at 10:52 AM, Brandon Taylor wrote: > > Hi everyone, > > I'm having a hell of a time getting connected to Oracle... > > We're running Intel MacBooks, OS X 10.5.6, Python 2.6.1, Django Trunk, > Oracle InstantClient 10_2. > > We have tried using cx_Oracle-5.0 and 4.4.1. cx_Oracle

Re: Problem outputting date in template as timestamp

2009-02-20 Thread Sean Brant
> I asked a similar question a while ago... turns out the server i'm > using from godaddy was set for Arizona and was an additional 20 some > minutes off... I checked my server and the timezone is set to US/CENTRAL and my settings file is set to America/Chicago. So that should be the same. Plus t

django apache authentication strange behavior with apache indexing.

2009-02-20 Thread Jlcarroll
I posted this a couple of days ago and didn't get a response. Thought that I might try again. I am creating a private genealogy web page of pictures/obituaries/data files/census records etc... all just a set of files within a directory structure. I just want Apache to index the directory's conten

Using a community Django Development system

2009-02-20 Thread DoJoe
Can anyone share their experiences and setup details for using a Django development server? I'd like to setup a system using Ubuntu, MySQL and Perforce (version ctrl) so that a small group of developers can develop from one single system. If anyone can either point me to some existing information

Re: PostgreSQL case sensitive icontains

2009-02-20 Thread Karen Tracey
On Fri, Feb 20, 2009 at 12:00 PM, Alessandro Ronchi < alessandro.ron...@soasi.com> wrote: > > with postgreSQL I get case sensitive filters also with icontains. I do not see this behavior: Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyrig

URL field for only public addresses

2009-02-20 Thread tow
I have a need for a subclass of the URL form field, in a slightly woolly way. I need it to only allow addresses which are *public*; that is, addresses which will have the same behaviour no matter where I am on the internet. (Yes, I know strictly you can never guarantee this for any number of reas

Multiple form validation

2009-02-20 Thread flagg
Ok this is driving me nuts. I have two form objects that manipulate two models. I am trying to run the is_valid() method on both and then save the form data to the DB. def all_valid(form1, form2): return form1.is_valid() and form2.is_valid() def addorder(request): today = date.today()

Re: Django/Apache/wsgi problems -- help!

2009-02-20 Thread Stephen Waterbury
Polat, Thank you, thank you!! That solved all the problems I had. I was really at a loss to know where to look -- perhaps I hadn't found the right docs, but this was the first time I had seen the things you suggested. One more question: in what sense did you mean that MEDIA_ROOT "is for file u

Re: Multiple form validation

2009-02-20 Thread Karen Tracey
On Fri, Feb 20, 2009 at 1:21 PM, flagg wrote: > > Ok this is driving me nuts. I have two form objects that manipulate > two models. I am trying to run the is_valid() method on both and then > save the form data to the DB. > > def all_valid(form1, form2): >return form1.is_valid() and form2.i

django newbie question

2009-02-20 Thread nixon66
If this is the wrong list to post a newbie question please let me know. I'm getting an error message while trying to populate the tables created by the models and not sure why. Here are the models from django.db import models class County(models.Model): name = models.CharField(max_length=80)

admin permissions i18n

2009-02-20 Thread eleom
Hello, does somebody know if there's a way to localize admin permission names, so that, for example, in the user change form, instead of 'Can add ' a localized version of it is showed? I've searched documentation and the open tickets, but I have not found anything talking about this. (Ticket #65

Re: django newbie question

2009-02-20 Thread Alex Gaynor
On Fri, Feb 20, 2009 at 2:06 PM, nixon66 wrote: > > If this is the wrong list to post a newbie question please let me > know. I'm getting an error message while trying to populate the tables > created by the models and not sure why. Here are the models > > from django.db import models > > class C

Re: Oracle connection issue

2009-02-20 Thread Brandon Taylor
Hi Matt, Ok, I modified manage.py to add two environ variables: import os oracle_home = '/Users/bft228/Library/Oracle/instantclient_10_2' os.environ['ORACLE_HOME'] = oracle_home os.environ['DYLD_LIBRARY_PATH'] = oracle_home Now I'm getting an error: DatabaseError: ORA-12505: TNS:listener does n

"SuspiciousOperation" Error While Deleting an Uploaded File

2009-02-20 Thread Ty
When I login to the administration and try to delete a file I get a "SuspiciousOperation" error. Here's the traceback: http://dpaste.com/123112/ Here's my full model: http://dpaste.com/hold/123110/ Any help would be appreciated. --~--~-~--~~~---~--~~ You received

Re: django newbie question

2009-02-20 Thread eleom
Well, as the error message says, you must pass a County instance in the argument 'county'. Now you are passing the name of the county, not the county itself. So, your last line should be l = Company(name='xyz corp', address='56 b. street', client='G corp', city = 'Walla Walla', county=c, dollar_a

Re: "SuspiciousOperation" Error While Deleting an Uploaded File

2009-02-20 Thread garagefan
Apache permissions must be set on the directory. I was having the same issue before I set the directory group to be Apache and gave it RWX privileges On Feb 20, 2:21 pm, Ty wrote: > When I login to the administration and try to delete a file I get a > "SuspiciousOperation" error. Here's the trac

Re: "SuspiciousOperation" Error While Deleting an Uploaded File

2009-02-20 Thread Ty
That's the thing... (and I probably should have mentioned this) I'm developing on Windows XP using the "manage.py runserver" command to serve the files. On Feb 20, 2:26 pm, garagefan wrote: > Apache permissions must be set on the directory. I was having the same > issue before I set the director

open sourced Django apps from Washington Times

2009-02-20 Thread Ramdas S
Saw this link. Seems interesting http://opensource.washingtontimes.com/blog/post/coordt/2009/02/washington-times-releases-open-source-projects/ -- Ramdas S +91 9342 583 065 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Googl

Re: django newbie question

2009-02-20 Thread nixon66
Ahh!!! The light goes on. Thanks for the quick response. One additional question. How would you handle this if you are typing data into the admin and wanted to put in the county? On Feb 20, 2:22 pm, eleom wrote: > Well, as the error message says, you must pass a County instance in > the argumen

Re: django newbie question

2009-02-20 Thread nixon66
eleom, Thanks for the catch with country county in my model. On Feb 20, 2:22 pm, eleom wrote: > Well, as the error message says, you must pass a County instance in > the argument 'county'. Now you are passing the name of the county, not > the county itself. So, your last line should be > > l =

Re: Django/Apache/wsgi problems -- help!

2009-02-20 Thread Polat Tuzla
I'm glad to hear that everything is solved. > One more question:  in what sense did you mean that MEDIA_ROOT > "is for file uploads"?  I have not begun working on file uploads > yet, but I will need that, and I see there is documentation on it > which talks about several configurable options.  Di

Re: django newbie question

2009-02-20 Thread Alex Gaynor
On Fri, Feb 20, 2009 at 2:34 PM, nixon66 wrote: > > eleom, > > Thanks for the catch with country county in my model. > > On Feb 20, 2:22 pm, eleom wrote: > > Well, as the error message says, you must pass a County instance in > > the argument 'county'. Now you are passing the name of the county,

Re: django newbie question

2009-02-20 Thread nixon66
Alex, Thanks Ron On Feb 20, 2:37 pm, Alex Gaynor wrote: > On Fri, Feb 20, 2009 at 2:34 PM, nixon66 wrote: > > > eleom, > > > Thanks for the catch with country county in my model. > > > On Feb 20, 2:22 pm, eleom wrote: > > > Well, as the error message says, you must pass a County instance in

Re: Oracle connection issue

2009-02-20 Thread Brandon Taylor
OK, I am pretty sure I found out where to put the tns_names.ora file: $ORACLE_HOME/network/admin But, I'm confused as to how to specify the database name. From the Django Oracle docs (http://docs.djangoproject.com/en/dev/ref/ databases/?from=olddocs#id9) they have the SID as the DATABASE_NAME set

Re: Using a community Django Development system

2009-02-20 Thread Jacob Kaplan-Moss
On Fri, Feb 20, 2009 at 12:09 PM, DoJoe wrote: > Can anyone share their experiences and setup details for using a > Django development server? I just ran across http://lethain.com/entry/2009/feb/13/the-django-and-ubuntu-intrepid-almanac/ the other day; maybe it'll help you out a bit. Jacob --~

Re: Oracle connection issue

2009-02-20 Thread Matt Boersma
Good, that's progress actually! So now cx_Oracle is finding the oracle libs correctly and giving up when it can't figure out how to connect to the database you've specified. So it needs to use one of Oracle's naming mechanisms to resolve the database location, such as LDAP or Oracle's own TNSNAM

Re: Oracle connection issue

2009-02-20 Thread Matt Boersma
Sorry, ignore my previous reply since you figured it out. It sounds like you have the tnsnames.ora and environment set up correctly. (Basically, in settings.py, you should either specify just DATABASE_NAME, so Oracle will use the tnsnames.ora or other lookup mechainism based on that, or else spec

Re: Multiple different user profile objects - Django code design help

2009-02-20 Thread Gok Mop
On Feb 20, 6:07 am, Beres Botond wrote: > To be honest I don't really see why you would need multiple user > profile models, > instead of having one user profile model, and each entry would define > a different > user profile. What do you mean by "one user profile model, and each entry would def

Re: Writing custom model fields with Multi-table inheritance

2009-02-20 Thread gordyt
> This sounds like a problem that has been fixed.  Are you running with a > recent enough trunk or 1.0.X branch checkout so that you have this fix: > > http://code.djangoproject.com/changeset/9664 Karen I'm running build 9846. I'm going to put together a very minimal example to illustrate the pr

Re: Oracle connection issue

2009-02-20 Thread Ian Kelly
On Feb 20, 12:50 pm, Brandon Taylor wrote: > OK, I am pretty sure I found out where to put the tns_names.ora file: > $ORACLE_HOME/network/admin > > But, I'm confused as to how to specify the database name. From the > Django Oracle docs (http://docs.djangoproject.com/en/dev/ref/ > databases/?from=

Re: Trouble with admin select related

2009-02-20 Thread Trey
This was actually the admin overriding the select related in my manager with an empty one, which does not follow FK=null. Adding this to my Admin class I was able to force the select_related to behave. def queryset(self, request): return super(PageAdmin, self).queryset(request).selec

Re: "SuspiciousOperation" Error While Deleting an Uploaded File

2009-02-20 Thread Ty
Turns out the problem was the FileField value. It can't start with a forward slash, it has to be relative. On Feb 20, 2:28 pm, Ty wrote: > That's the thing... (and I probably should have mentioned this) I'm > developing on Windows XP using the "manage.py runserver" command to > serve the files.

Re: Oracle connection issue

2009-02-20 Thread Brandon Taylor
Hi Matt, Thanks for the reply. Well, I can get connected via sqlplus and I can: desc activities... not sure what's up from the Django side. The user I'm connecting with has correct privileges; my Oracle person has triple-checked. If I try to run a syncdb, I get the Oracle environment handle erro

Beginner URL question.

2009-02-20 Thread JoeG
I've tried to find this on Google but I don't know the terminology so I don't know what to search for. It's more of an html question than a Django one but since I'm trying to learn Django, I thought I'd give this group a try. I'm developing a fiscal calendar application. The URL will be http://

Re: Oracle connection issue

2009-02-20 Thread Brandon Taylor
Hi Ian, Here's her's the quick model I wrote to try to select *something*: class TestCategory(models.Model): name = models.CharField(max_length=255) class Meta: db_table = 'ACTIVITY_CODE.CATEGORIES' If I connect via dbshell from my project, I can do: select * from categories; a

file validation in admin form

2009-02-20 Thread Michael Repucci
I'm totally new to Django and authorized/secure web apps, and really loving it for this. But I've got a few really novice questions. I've got a model with a FileField, to which users can upload an arbitrary file. In the model docs for the FileField it says, "Validate all uploaded files." And I'm n

Re: Oracle connection issue

2009-02-20 Thread Matt Boersma
Could it be the case that your Django/Oracle user has the correct privileges, but the tables aren't in the user's default schema/tablespace? Django queries won't prepend the schema name, ever, so you need to ensure that either the tables were created or owned by the connecting user, or that synon

Re: Oracle connection issue

2009-02-20 Thread Brandon Taylor
Ok, now I am absolutely confounded... I ran: manage.py inspectdb > models.py Then I tried to get objects from the models THAT IT CREATED FOR ME - same friggin' error! What in the world is up with this thing? I'm at a loss. b On Feb 20, 3:08 pm, Brandon Taylor wrote: > Hi Ian, > > Here's her'

Re: Oracle connection issue

2009-02-20 Thread Brandon Taylor
Alright, this is what I *am* able to do... manage.py shell (from my project folder) from my_project.models import * categories = Categories.objects.all() print categories (and I get 11 Category objects - woohoo!) from django.db import connection print connection.queries [{'time': '0.007', 'sql'

Re: Oracle connection issue

2009-02-20 Thread Ian Kelly
On Feb 20, 2:08 pm, Brandon Taylor wrote: > Hi Ian, > > Here's her's the quick model I wrote to try to select *something*: > > class TestCategory(models.Model): >     name = models.CharField(max_length=255) >     class Meta: >         db_table = 'ACTIVITY_CODE.CATEGORIES' Don't include the schem

Re: Oracle connection issue

2009-02-20 Thread Matt Boersma
Ah...I think specifying db_table as "ACTIVITY_CODE.CATEGORIES" is the problem. We don't really have schema support in Django (yes, there's a bug recorded for this issue), and unfortunately the approach of specifying "schema.table" as the table name will not work. You'll probably have to do somet

Re: Oracle connection issue

2009-02-20 Thread Brandon Taylor
here's the inspectdb models.py file: from django.db import models class Subtypes(models.Model): id = models.DecimalField(decimal_places=0, max_digits=38, db_column='ID', primary_key=True) # Field name made lowercase. type_id = models.DecimalField(decimal_places=0, null=True, max_digits=3

Re: Oracle connection issue

2009-02-20 Thread Ian Kelly
On Feb 20, 2:25 pm, Brandon Taylor wrote: > however attempting to retrieve the Category objects from a view > results in: > DatabaseError: ORA-00942: table or view does not exist > > Thoughts? You can definitely use views with Django (although inspectdb will blissfully ignore them). We do that

NoReverseMatch for a named URL

2009-02-20 Thread Philippe Clérié
I am working through the examples in Pratical Django Projects. I am using Django 1.02 on Ubuntu Intrepid. I expected to find problems because of version differences but in general I've been able to work out a solution. This one has got me stumped. You see the named url that is at fault is diff

Re: Oracle connection issue

2009-02-20 Thread Brandon Taylor
Actually I was referring to my action in views.py to get the Category objects: from activity_codes.models import * (this is the auto-generated models.py) def home(request): categories = Categories.objects.all() return render_to_response('test.html', {'categories' : categories}) On Feb

Re: Overriding ID Field

2009-02-20 Thread burcu hamamcıoğlu
I solved it , thanks :) 20 Şubat 2009 Cuma 14:08 tarihinde Veeravendhan sakkarai < veeravend...@gmail.com> yazdı: > > You just define your primary key field in the models, you can over come. > Also we can auto generate UUID. like the autoincrimint id field. > > > > On Fri, Feb 20, 2009 at 3:41 PM

Re: Oracle connection issue

2009-02-20 Thread Brandon Taylor
I think I may have found the culprit (?), but I have no idea how to fix this. In my project folder, there is a file called sqlnet.log. Here's the last entry: Fatal NI connect error 12505, connecting to: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) (HOST=devportal2.dcs.its.utexas.edu)(PORT=1521))(CONNECT

  1   2   >