Re: Setting Django to not quote table names

2013-03-06 Thread Ian Kelly
On Wed, Mar 6, 2013 at 1:38 AM, Ian wrote: > In the meanwhile, the commonly used workaround for this is to include the > schema in the db_table declaration like so: The other workaround which is mentioned in the ticket I linked but which I completely neglected to include

Re: ORM, Oracle and UTF-8 encoding problem.

2013-01-09 Thread Ian Kelly
On Wed, Jan 9, 2013 at 11:40 PM, Jani Tiainen wrote: > If we just force using force_unicode everything works except in older > versions of cx_Oracle (our server had 5.0.4 or something) connection strings > can't be unicode for some reason. Sure, that's why the check exists in

Re: ORM, Oracle and UTF-8 encoding problem.

2013-01-09 Thread Ian Kelly
On Wed, Jan 9, 2013 at 3:55 AM, Jani Tiainen wrote: > Server is running Oracle Database 10g Release 10.2.0.5.0 - 64bit Production. > (EE edition) > > and charset info: > NLS_CHARACTERSETWE8ISO8859P1 > NLS_NCHAR_CHARACTERSET AL16UTF16 Sorry, I meant your web server

Re: Syncdb Error With Oracle Database - IntegrityError Exception

2012-08-31 Thread Ian Kelly
On Fri, Aug 31, 2012 at 10:03 PM, Jon Blake wrote: > Querying column timestamp of view user_objects for tables, sequences and > triggers appears to confirm my understanding of what base.py does. I'll drop > and recreate my user account, and try again. I'll advise how this

Re: Oracle: blank, null, and empty_strings_allowed

2012-06-20 Thread Ian Kelly
On Wed, Jun 20, 2012 at 12:31 PM, André Pang wrote: > I honestly don't mind whether Django decides to do this or not, since I can > always hack our local tree to enforce this at the database level, but I > thought it's an idea worth discussing. In my case, I found a couple

Re: Randomly clearing database tables

2011-10-05 Thread Ian Kelly
On Tue, Oct 4, 2011 at 2:28 PM, msbuck wrote: > Below is the settings. I am fairly new to python unit testing so my > understanding of things could be better. But right now, if I select > Run As -> Python Unit Test will my project is selected, it runs all of > my Django tests

Re: Django 1.2.3, Oracle with Character Set WE8MSWIN1252 - 'utf8' codec can't decode bytes

2010-12-02 Thread Ian Kelly
On Thu, Dec 2, 2010 at 5:52 PM, Anurag Chourasia wrote: > Hi Ian, > Can't tell you how much this helps :-) > Setting the variable using ctypes before the import of cx_Oracle does the > trick for me. > Appreciate the time you spent in helping resolve this. > Is there

Re: Django 1.2.3, Oracle with Character Set WE8MSWIN1252 - 'utf8' codec can't decode bytes

2010-12-02 Thread Ian Kelly
On Thu, Dec 2, 2010 at 5:34 PM, Anurag Chourasia wrote: > Hi Ian, > I just tried the ctypes solution that you mentioned in your previous email > but it does not work for me. In your transcript, it appears that Django has already been loaded when you call the ctypes

Re: Django 1.2.3, Oracle with Character Set WE8MSWIN1252 - 'utf8' codec can't decode bytes

2010-12-02 Thread Ian Kelly
On Thu, Dec 2, 2010 at 3:23 PM, Ian Kelly <ian.g.ke...@gmail.com> wrote: > Weird.  From what I can tell, this seems to have something to do with > Cygwin, or at least I'm able to replicate it in that environment. > Setting NLS_LANG in or out of process and changing the registry

Re: Django 1.2.3, Oracle with Character Set WE8MSWIN1252 - 'utf8' codec can't decode bytes

2010-12-02 Thread Ian Kelly
On Thu, Dec 2, 2010 at 1:21 PM, Anurag Chourasia wrote: > Hi Ian, > Here is the information requested by you. > $ python > Python 2.5.2 (r252:60911, Dec  2 2008, 09:26:14) > [GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)] on cygwin > Type "help", "copyright",

Re: Django 1.2.3, Oracle with Character Set WE8MSWIN1252 - 'utf8' codec can't decode bytes

2010-12-02 Thread Ian Kelly
On Thu, Dec 2, 2010 at 6:43 AM, Anurag Chourasia wrote: > Hi Ian, > Yes.I set the NLS_LANG in my shell to UTF8 before trying this. > Query using Django model still fails (direct query using cx_Oracle works > fine) > Regards, > Anurag Okay, so it would appear that

Re: Django 1.2.3, Oracle with Character Set WE8MSWIN1252 - 'utf8' codec can't decode bytes

2010-12-01 Thread Ian Kelly
On Wed, Dec 1, 2010 at 7:58 PM, Anurag Chourasia wrote: > This is using cx_Oracle and it works fine > === cx_Oracle.version > '5.0.3' cursor.execute("select to_term from terminology_map where id=316") cursor.fetchone()[0] >

Re: Django 1.1, cx_oracle 5.0.2, Oracle 9i, NCLOB Textfield

2009-10-02 Thread Ian Kelly
On Oct 1, 6:26 pm, alphacc wrote: > I installed 9i at home and did some more test. > With the same application  running (and updating the same field) I > discovered that the limit is not the same for my database. > It is now 1246 Characters. > I started a new application (a

Re: Django 1.1, cx_oracle 5.0.2, Oracle 9i, NCLOB Textfield

2009-09-30 Thread Ian Kelly
On Sep 30, 11:35 am, Thomas wrote: > Hello, > > OS : windows > Python : 2.6.2 > > I have an issue with Textfield in django models. > The textfield are created as NCLOB in the Oracle 9i DB. > When I try to save a textfield from the django admin it works fine if > the limit of

Re: problems with large data

2009-07-16 Thread Ian Kelly
On Jul 16, 7:51 am, Petry wrote: > Hello, > > I am working on a project where I have to store a large amount of > content, (html) in a record from a table, I am using Oracle as the > database > > What is very strange ... is put a text reasonably small, (around 2000 >

Re: code of models from oracle to mysql

2009-07-15 Thread Ian Kelly
On Jul 15, 7:07 am, Karen Tracey wrote: > On Wed, Jul 15, 2009 at 4:18 AM, pho...@gmail.com wrote: > > > the code of models: > >    mgsyxs = models.DecimalField(decimal_places=-127, null=True, > > max_digits=126, db_column='MGSYXS', blank=True) # Field name

Re: Django doesn't recognize the sequences/triggers in existing Oracle DB

2009-07-03 Thread Ian Kelly
On Jul 3, 6:13 am, Wanpeng wrote: > Hello, > I am writing my first app in Django. I already have existing > tables/sequences/triggers in Oracle. so I used "inspectdb" to generate the > models for django. Here's one model for example: > > class Instructors(models.Model): >

Re: A problem about django apache mod_wsgi with oracle

2009-06-30 Thread Ian Kelly
On Jun 30, 2:55 am, "arli...@gmail.com" wrote: > I can use the oracle with django admin runserver, > but when i use apche with mod_wsgi , apache error log : > ImproperlyConfigured: Error loading cx_Oracle module: DLL load failed: > What's wrong with it ? Make sure you're

Re: Django + Apache + mod_wsgi + Oracle -> threading problems?

2009-06-15 Thread Ian Kelly
On Jun 15, 11:11 am, Miles wrote: > Connections aren't thread safe - you have to ensure every thread gets > its own connection. You can create a new connection every request or > use a thread-local to cache connections. The latter is what Django does, although it's very easy

Re: oracle with us7ascii encode character lost

2009-05-25 Thread Ian Kelly
On May 25, 1:07 pm, Andrási László (g) wrote: > Hi, > > We have a problem with an Oracle DB version 10g Release 10.2.0.1.0., Django > latest svn version and cx_Oracle 5.0.1-2 > > "select * from nls_database_parameters where parameter='NLS_CHARACTERSET';" > returns  

Re: Connecting to Legacy Oracle Tables

2009-05-22 Thread Ian Kelly
On May 22, 10:59 am, Christina wrote: > Hi all, > > I'm trying to set up a new Django app that will have several models > based on existing Oracle tables.  I'm running Django 1.0.2, python > 2.5.1 and cxOracle 5.0.1. > > These tables are in a different schema than the

Re: Oracle 10g Release 2 ignored 'primary_key=True'

2009-05-15 Thread Ian Kelly
On May 15, 1:23 am, modelmike wrote: > How do I use 'primary_key=True' with Oracle 10g R2 to create a primary > key on a custom field instead of on the default ID field? > > 'python manage.py sqlall ' shows that Django's SQL > generation correctly assigns the PRIMARY KEY

Re: database user vs schema owner

2009-04-30 Thread Ian Kelly
On Apr 30, 12:30 pm, Jason Geiger wrote: > Hello. I'm using Oracle and I would like to have a restricted user for > Django that can only do DML. Is there a way to specify a schema that > would prefix all "naked" table references so that this user can find > the tables as it

Re: More DJango Tagging Oracle Issues

2009-03-23 Thread Ian Kelly
On Mar 23, 1:52 pm, Brandon Taylor <btaylordes...@gmail.com> wrote: > Hi Everyone, > > Is anyone having issues with Django Tagging (svn) not updating tags on > an existing model? I'm running cx_Oracle-4.4.1 - thanks to (Ian Kelly) > and Django Trunk. Hmm. I tried runni

Re: Crazy error with utf-8 & apache (please help!)

2009-03-20 Thread Ian Kelly
On Mar 20, 3:00 pm, elm wrote: > Thanxs for the advice Ian!!! > > But unfortunately I haven't been succesful. > > I have set the NLS_LANG to .UTF8 in the directive at the > apache conf file: > > >     SetHandler python-program >     PythonHandler

Re: Django-Tagging not working with Oracle

2009-03-20 Thread Ian Kelly
On Mar 20, 1:52 pm, Brandon Taylor wrote: > Hmm. Well, I guess the only thing left to ask is what version of > Django and Tagging you're running? > > I'm using Oracle 10g, cx_Oracle-5.0.1, Django and Tagging from svn. > Other than that, I'm at a loss :) The same, but

Re: Crazy error with utf-8 & apache (please help!)

2009-03-20 Thread Ian Kelly
On Mar 20, 11:16 am, Ian Kelly <ian.g.ke...@gmail.com> wrote: > As far as I know, the NLS_LANG environment variable is the only way to > specify the client encoding in cx_Oracle.  If that can't be relied > upon within your Apache process, then I think you would need to run

Re: Django-Tagging not working with Oracle

2009-03-20 Thread Ian Kelly
On Mar 20, 12:08 pm, Brandon Taylor wrote: > Nope, still not working. If you're not defining tags = TagField() in > the model, how are you defining it? As a CharField? I'd like to see > how your model is set up. > > Of course, if I create a CharField and call it tags, it

Re: Crazy error with utf-8 & apache (please help!)

2009-03-20 Thread Ian Kelly
On Mar 20, 6:51 am, elm wrote: > > Are you sharing the web server with web applications written using > > something else, such as PHP? If PHP is playing with the language > > settings, you might be hitting an ordering problem. That is, it works > > if any PHP code gets

Re: Django-Tagging not working with Oracle

2009-03-20 Thread Ian Kelly
On Mar 20, 8:26 am, Brandon Taylor wrote: > Hi Ian, > > Thanks for the response. The test case is adding the TagField() to any > model. > > Here's an excerpt from my model class: > > #models.py > from django.db import models > from django.contrib import admin > from

Re: Crazy error with utf-8 & apache (please help!)

2009-03-19 Thread Ian Kelly
On Mar 19, 4:55 pm, elm wrote: > I have bee trying to deal with an erratic error for the last 3 day. I > hope you can rescue me!!! > > After experiencing erratic errors that appeared from time to time on a > larger project (i.e. ViewDoesNotExist) I have reduced my

Re: Django-Tagging not working with Oracle

2009-03-19 Thread Ian Kelly
On Mar 19, 9:21 am, Brandon Taylor wrote: > Hi Everyone, > > I'm using the svn checkout of Django-Tagging and Django-Trunk. Tagging > is working perfectly for me with any other database except, of course, > Oracle, which is what I need it to work in. > > I can't get the

Re: about checking if CharField value is empty

2009-03-14 Thread Ian Kelly
On Mar 14, 8:04 am, Sergio wrote: > wow, that's interesting. I was not aware if this. > > So, coming to the real question, here is my use case which raised this > questions: > > I've a class in the model with two CharFields. When validating data > inputs, I need to check

Re: Oracle connection without tnsnames.ora

2009-03-05 Thread Ian Kelly
On Mar 5, 2:29 pm, "robertmalik...@googlemail.com" wrote: > Edit settings.py and; > DATABASE_NAME = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=db_hostname) > (Port=1521))(CONNECT_DATA=(SID=db_sid)))' > > Replace the db_sid with your database sid and db_hostname the

Re: Oracle connection issue

2009-02-20 Thread Ian Kelly
On Feb 20, 3:26 pm, Brandon Taylor wrote: > Yes, I'm just using the built-in server for local development. I've > restarted it dozens of times, cleared my browser cache, etc. > > Is the built-in server not compatible with Oracle? If not, I'll just > get an

Re: Oracle connection issue

2009-02-20 Thread Ian Kelly
On Feb 20, 3:14 pm, Brandon Taylor wrote: > 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: >  

Re: Oracle connection issue

2009-02-20 Thread Ian Kelly
On Feb 20, 3:01 pm, Brandon Taylor wrote: > 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 =

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

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 =

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