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 <anurag.choura...@gmail.com> 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

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 <anurag.choura...@gmail.com> 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 >

Re: ORA-01425

2010-12-02 Thread Ian
LATE('A' USING NCHAR_CS) ESCAPE TRANSLATE('\' USING NCHAR_CS)") I'd like to know whether this will work for autodetection. Thanks, Ian -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-

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 <anurag.choura...@gmail.com> 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

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

2010-12-01 Thread Ian Kelly
n we're comparing apples to oranges, since Django uses the .UTF8 setting. Thanks, Ian -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group,

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

2010-12-01 Thread Ian
tituting the appropriate values? $ export NLS_LANG=.UTF8 $ python >>> import cx_Oracle >>> conn = cx_Oracle.connect('username/passw...@dsn') >>> cursor = conn.cursor() >>> cursor.execute("SELECT PROBLEM_COLUMN FROM TERMINOLOGY_MAP WHERE ID = 206") >>>

Django-reviews: cannot set content-type

2010-11-17 Thread Ian
I'm using django-reviews (http://code.google.com/p/django-reviews/) and having trouble getting the content-type set for a review. Simple example: def check_review(request): if request.method == 'POST': reviewed_item = get_object_or_404(MyModel, pk=request.POST['object_pk'])

Re: Django 1.3 alpha 1 released

2010-11-11 Thread Ian Lewis
to improve specifically but, it was my impression that this conversation had been played out and that the API was pretty much decided. -- Ian http://www.ianlewis.org/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Oracle Database Other User Tables/Views

2010-10-20 Thread Ian
the proper interior quoting, e.g.: db_table = 'other_schema"."some_table' This is sufficient to trick Django into doing the right thing in most cases. Cheers, Ian -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this g

Re: Django Registration password reset problem

2010-10-06 Thread Ian Lewis
angoCon US 2010 September 7-9http://djangocon.us/ > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email

Re: Separating application media from project media

2010-10-01 Thread Ian Lewis
to a site_media directory so that you can serve them from a web server. It also allows you to manage uploaded media separately from static files. http://pypi.python.org/pypi/django-staticfiles/ -- Ian http://www.ianlewis.org/ -- You received this message because you are subscribed to the Google

Re: How to debug ORM filter stacking?

2010-09-25 Thread Ian Lewis
this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Ian http://www.ianlewis.org/ -- You received this message because you are subscribed to the Googl

Re: Bind variables in Oracle backend - how to use them?

2010-08-19 Thread Ian
ass in django/db/ backends/oracle/base.py, which is used within the "RETURNING INTO" clause of an insert statement to receive the primary key of the inserted object. Hope this helps, Ian -- You received this message because you are subscribed to the Google Groups "Django users&

Re: Bind variables in Oracle backend - how to use them?

2010-08-17 Thread Ian
Django ORM. A raw query is written entirely by the developer, so there is no reason for it to have an "extra" method. Cheers, Ian -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-u

Re: Django 1.3

2010-08-16 Thread Ian Lewis
Kenneth, >From my experience, South works well with mysql. However because sqlite doesn't provide support for some schema alterations such as dropping columns, it is as you said, pretty touchy. Ian On Mon, Aug 16, 2010 at 2:52 PM, Kenneth Gonsalves <law...@au-kbc.org> wrote: > On

Re: Bind variables in Oracle backend - how to use them?

2010-08-13 Thread Ian
s-none Note that Django placeholders always use the %s syntax regardless of backend, so you'll need to use that rather than the named syntax normally used with Oracle. HTH, Ian -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to t

Re: renaming database constraint names

2010-08-03 Thread Ian
straint > names in my Django schema to something more descriptive. If anyone has > any experience with that and has some suggestions on how to do it, I'd > love to hear from you. > > Thanks, > > Shirley In a dbshell: ALTER TABLE tablename RENAME CONSTRAINT old_name TO new_name

Re: create table

2010-07-19 Thread Ian Lewis
nterest:TextField > agree_open_info:BooleanField For this you'll need to create a model for your user profile and specify it in the AUTH_PROFILE_MODULE setting. You can then access a user's profile using the get_profile() method on the user. See: http://docs.dj

Re: Special characters and symbols in django?

2010-06-18 Thread Ian
If it is an NLS_LANG issue of some sort, then switching to a unicode build of cx_Oracle should hopefully clear it up. HTH, Ian -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@goog

Re: Special characters and symbols in django?

2010-06-18 Thread Ian
en't included in ISO-8859-1. If the column is NCLOB or NVARCHAR2, then Django should handle the encoding conversions for you. Ian -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.c

Re: How to pass a raw ORDER_BY command or function call to a results query object?

2010-06-17 Thread Ian Lewis
In this case you want to use extra(). Assuming jobs is a QuerySet or Manager instance: jobs = jobs.extra(select={greatest_time': 'GREATEST(startTime, queueTime)'}) jobs = jobs.extra(order_by=['-greatest_time']) On Thursday, June 17, 2010, Kyle wrote: > Without any

Re: how to use render_to_response, ajax and javascript variables

2010-06-17 Thread Ian McDowall
Ian On Jun 17, 9:37 am, Matt Hoskins <skaffe...@googlemail.com> wrote: > I was just copying Ian's choice of mimetype - see Ian's comment above > "I choose text/plain deliberately but you might choose text/json (or > something else)."... Although it's worth pointing out tha

Re: how to use render_to_response, ajax and javascript variables

2010-06-17 Thread Ian McDowall
e_member.first_name}}", "last_name":"{{one_member.last_name}}" }, {% endfor %} ]} I choose text/plain deliberately but you might choose text/json (or something else). if you embed HTML in JSON then you will need to be careful that the HTML does not itself contain

Re: Multiple AJAX sends within a views.py-function

2010-06-16 Thread Ian McDowall
work and possible bugs so I don't recommend it if there is any alternative. Cheers Ian On Jun 15, 8:45 pm, Christoph Siedentop <christophsieden...@gmail.com> wrote: > Hi Dmitry, hi Ian, > > thanks for the help. > > I got it to work. Here is what I am doing. >

Re: how to use render_to_response, ajax and javascript variables

2010-06-16 Thread Ian McDowall
to another if you wanted. I realise that this doesn't actually solve your problem of combining HTML and JSON in a response and I think one of the other comments addresses this but I wanted to make the point that JSON by itself is easy. Cheers Ian On Jun 16, 1:17 pm, Alex <alexle...@googlemail.

Re: Oracle cursor.execute problem

2010-06-15 Thread Ian
angoproject.com/simpleticket When creating the ticket, please be sure to indicate what version of Django you are using, and be specific about the conditions under which the bug appears. Currently all the test cases for queryset.only() are passed by the oracle backend. Thanks, Ian -- You received this mess

Re: Django architecture question

2010-06-15 Thread Ian McDowall
utility functions then they can be pulled out into separate modules. Once you realise that the views.py is only a convention then it just becomes a question of structuring a large Python app. Hope this helps, Ian McDowall On Jun 15, 5:55 am, Joel Klabo <joelkl...@gmail.com> wrote: > I a

Re: Multiple AJAX sends within a views.py-function

2010-06-14 Thread Ian McDowall
? Regards, Ian McDowall On Jun 11, 4:15 pm, Christoph <christophsieden...@gmail.com> wrote: > Hi, > > normally in views.py I have a function that takes a request and > returns a render_to_response or the like. I, however, would like it to > take a request and have Django reply wi

Re: Custom Form in a ModelFormset_Factory?

2010-05-18 Thread Ian Lewis
you have a link to any documentation that indicates > this (and other features) is an option? > > On May 18, 1:10 am, Ian Lewis <ianmle...@gmail.com> wrote: >> Pass the form class to modelformset_factory() in the form argument. >> The factory will then use the AuthorForm class

Re: Challenge with Annotate

2010-05-18 Thread Ian Lewis
rage field you were looking for? If not it might be easier to just write what you want as custom SQL. Ian On Tue, May 18, 2010 at 10:51 PM, Roland van Laar <rol...@micite.net> wrote: > On 05/18/2010 03:43 PM, Ian Lewis wrote: >> Roland, >> >> Instead

Re: Challenge with Annotate

2010-05-18 Thread Ian Lewis
Roland, Instead of using annotate, could you just add the avg_days_instock field as another key in the select argument to extra? Ian On Tue, May 18, 2010 at 9:03 PM, Roland van Laar <rol...@micite.net> wrote: > Hello, > > Question: How do I calculate the Average of a calculate

Re: Extend User

2010-05-18 Thread Ian Lewis
If you don't need the name, surname etc. then don't use them. They are optional fields. You can also implement a custom form or view when the user registers that can make sure the email has not been previously registered. If you need to add additional fields then you should create a custom

Re: Error was: cannot import name validators

2010-05-18 Thread Ian Lewis
validators is a module that was added in Django 1.2. You probably have the wrong version of Django installed or are using Django 1.1 with a django application that requires Django 1.2. On Tue, May 18, 2010 at 6:01 PM, Pankaj Singh wrote: >

Re: Custom Form in a ModelFormset_Factory?

2010-05-18 Thread Ian Lewis
Pass the form class to modelformset_factory() in the form argument. The factory will then use the AuthorForm class as the base form class when it creates the modelform class for the formset. modelFormset = modelformset_factory(Author, form=AuthorForm) On Tue, May 18, 2010 at 7:08 AM, Michael

Re: Oracle cursor.execute problem

2010-04-28 Thread Ian
ng to have to stick with creating a > specific Oracle connection to do this? That would be a bug. I've just checked in a fix, which will be included in Django 1.2 and the next 1.1.X release. If you're not willing to use trunk or wait for the release, my recommendation would be to use cu

Re: Oracle cursor.execute problem

2010-04-26 Thread Ian
most of the queries it runs but incorrect for PL/ SQL. The easiest fix is to add a space or a second semicolon at the end. Or you can do what Django does internally, which is to terminate the PL/SQL block with a forward-slash on its own line after the semicolon, as if the block were to be entere

Re: Oracle cursor.execute problem

2010-04-23 Thread Ian
e objects, and cursor variables all work. Ian -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubsc

Re: Oracle cursor.execute problem

2010-04-23 Thread Ian
On Apr 23, 2:44 pm, Ian <ian.g.ke...@gmail.com> wrote: > Django cursors universally use the 'format' dbapi paramstyle rather > than the 'named' style natively used by cx_Oracle [1].  To convert > your query, replace the parameter markers with %s and pass the > parameters as

Re: Oracle cursor.execute problem

2010-04-23 Thread Ian
style natively used by cx_Oracle [1]. To convert your query, replace the parameter markers with %s and pass the parameters as a list rather than a dictionary. If you instead want to work with the underlying cx_Oracle cursor directly, you can access that as cursor.cursor. However, this is not doc

Re: Retrieving an ID from a posted form

2010-04-22 Thread Ian Lewis
ur id is %d!" % myobj.id, email_address, recipients) I hope that's what you were looking for. Ian On Thu, Apr 22, 2010 at 11:39 PM, Nick <nickt...@gmail.com> wrote: > I am working on a form process with multiple levels of submission. The > first is a front facing form with a ge

Re: Oracle - DatabaseError: ORA-01830 with a legacy db

2010-04-18 Thread Ian
MESTAMP, or change the field to a DateField, and you should be okay. HTH, Ian -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send ema

Re: Getting error in Cloudwatch EC2 BOTO

2010-04-15 Thread Ian Lewis
Nitin, You will need to provide more information about the error you are getting and in what circumstances it is occurring if you would like someone to help you. Ian On Thu, Apr 15, 2010 at 2:10 PM, nitin shrimali <urs.dee...@gmail.com>wrote: > Hello guys > I am having error whe

Re: save_model admin

2010-04-13 Thread Ian Lewis
If you are talking about Django's admin couldn't you implement it by overriding save_model as your subject seems to suggest? http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.save_model

Re: many to many based upon common field

2010-04-13 Thread Ian Lewis
wizard, Would it make sense to use the intermediate table to hold the field? Using the stack overflow example: class Edi856(models.Model): pass class Order(models.Model): edi = models.ManyToManyField(Edi856, through='PoNum') def in_edi(self): '''Has the edi been

Re: CSRF and Caching

2010-04-13 Thread Ian Lewis
There is the possibility that the token could be cached in html if you are using the cache template tag. Otherwise the token shouldn't be cached. On Wed, Apr 14, 2010 at 3:31 AM, scoopseven wrote: > Is there any possibility that CSRF tokens could be cached by memcache >

Re: urllib2: post request to a django form

2010-04-13 Thread Ian Lewis
Try running the server locally using the devserver and posting to it. You can invoke python's debugger when the post is recieved on the server side by adding some code like the following: import pdb;pdb.set_trace() On Wed, Apr 14, 2010 at 7:30 AM, bfrederi wrote: > I'm

Re: Override Delete Function

2010-04-12 Thread Ian Lewis
Tom, You could try doing this clear logic in a pre_delete signal. You might have to test out the timing of when the signals get called but it should call pre_delete for all deleted models. In this case it would call pre_delete on model2 before model1 but you should be able to get what you are

Re: Django Newbie seeking for advice

2010-04-12 Thread Ian Lewis
Mr. Yu, On Tue, Apr 13, 2010 at 9:56 AM, Mister Yu wrote: > > 1. can you suggest an up-to-date(django 1.1) book which can guide a > newbie to a higher level? ebook is ok, free is more than ok :) > I think the semi-official Django book is where most people start. It's

Re: querying on a field equal to a manytomany object

2010-04-12 Thread Ian Struble
I think you are looking for the 'in' field lookup: http://docs.djangoproject.com/en/dev/ref/models/querysets/#in Item.objects.filter(genre__in=some_video.genre.all()) On Apr 12, 10:03 am, Nick Serra wrote: > Hey everyone, thanks for looking. I couldn't think of a good

Re: how to migrate data to django-tagging

2010-04-11 Thread Ian Struble
f forwards(self, orm): # ... replace the del_column tagging_tags and add_column tags w/ # Renaming field 'Tour.tagging_tags' to 'Tour.tags' db.rename_column('tours_tour', 'tagging_tags', 'tags') Best, Ian On Apr 11, 5:06 am, Andrey Torba <andreyto...@gmail.com>

Re: Creating sample users for testing

2010-03-23 Thread Ian McDowall
I had the same issue but I also wanted to create additional data for each user. It was straightforward to create a script to add users. I needed to import some bits to set up the Django environment and then I was able to create users with standard Django calls. Here is extracts from my code

Re: Facebook Connect

2010-03-15 Thread Ian Langworth
Try django-socialregistration. I've had success with it. On Mon, Mar 15, 2010 at 12:52, CrabbyPete wrote: > I am trying to integrate pyfacebook into a existing project, and its > driving me nuts. I just want users to be able to sign in with > facebook.  Anyone else try this

Re: Serving https with runserver

2010-03-01 Thread Ian Lewis
Ian On Mon, Mar 1, 2010 at 7:43 PM, Gonzalo Delgado <gonzalo...@gmail.com> wrote: > El 01/03/10 07:07, cool-RR escribió: >> Adnan, I'm really baffled by your response. No, my reasons for using >> SSL here is not because I'm afraid someone will sniff my data, We are >> ta

Re: Set language on per page basis

2010-02-25 Thread Ian Lewis
BTW: django-cms does something similar to what you are trying to do. You can check out it's implementation here: http://github.com/digi604/django-cms-2.0/blob/master/cms/middleware/multilingual.py 2010/2/25 Ian Lewis <ianmle...@gmail.com>: > In process_request you have access to th

Re: Set language on per page basis

2010-02-25 Thread Ian Lewis
In process_request you have access to the request object which knows the current path (request.path). You can use that to determine which language to show the page in. Or if you are determining the language based on a url parameter you can look at request.GET Ian On Thu, Feb 25, 2010 at 8:24 AM

Re: v1.2a change in ModelAdmin: save_model not called by add_view

2010-01-28 Thread Ian
Bug tracking system says it was fixed two weeks ago in trunk http://code.djangoproject.com/changeset/12206 - referenced by http://code.djangoproject.com/ticket/12696 -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: read only django admin

2010-01-28 Thread Ian
Despite the pedantic admonishments offered by others, there are use cases for readonly fields beyond primary keys. Metadata or implicit data that really shouldn't be changed isn't a "trust" issue, it's semantically different that application domain data. Anyway, I found this code has some issues

v1.2a change in ModelAdmin: save_model not called by add_view

2010-01-28 Thread Ian
I have an hook in a v1.1.1 admin app that sets some default values when adding an object - it works by overriding ModelAdmin.save_model Well, I just tried it with v1.2a and it fails, it looks like the call to save_model that preceded the calls to save_formset was removed. Without save_model, is

Re: Admin interface not working in Oracle

2010-01-26 Thread Ian
ng the oracle backend. I suspect there is something else going on here. I wonder if your admin site urlconf is correct. Note that when migrating, you need to change the regular expression also: r'^admin/ (.*)$' becomes simply r'^admin/'. Hope this helps, Ian -- You received this message because you ar

Re: Populating a model field with an implicit default values with request data from the admin interface

2010-01-26 Thread Ian
fields to blank=True in the model to defeat the validator, even though the semantics are that they shouldn't be blank (seems hacky, is there a better way?). On Jan 26, 11:50 am, Eugene Wee <crystalrecurs...@gmail.com> wrote: > Hi, > > On Wed, Jan 27, 2010 at 3:35 AM, Ian <spida..

Populating a model field with an implicit default values with request data from the admin interface

2010-01-26 Thread Ian
Given a model that looks like this class Article(models.Model): title = models.CharField(max_length=31) blurb = models.CharField(max_length=255) created_by = models.CharField(max_length=31) created_at = models.DateTimeField('Created Date') How would you populate the created_by

Re: NoReverseMatch:

2010-01-16 Thread Ian Lewis
Bhaskar, The error means that there is either no defined URL called 'tellfriend' or it requires some kind of argument, like a user id, to generate the URL. Having two separate forms with different actions is no problem. Fixing the URL reversing should clear up your issue. Ian On Sunday

Re: Django ugettext() got an unexpected keyword argument 'default' (template error)

2009-12-17 Thread Ian
ger than the database limit. I'm not sure how having a too long column name results in the particular error you're reporting, but if an untruncated column name is being passed to the database, that's a bug, and you should create a ticket for it. Ian -- You received this message because you are subs

Re: Couldn't create tables.

2009-12-11 Thread Ian
it failed. > > Here there are few questions to be answered. > - Why did the tables not get created ? Without the output of your syncdb, I have no way of answering that. > - How can i create them ? Just run syncdb again. Regards, Ian -- You received this message because you are subscr

Re: loaddata encoding problem

2009-12-01 Thread Ian
sets in the two schemas? > > Thanks, > Johan Hi Johan, Do you only have VARCHAR2 / CLOB columns in the tables, or are there any NVARCHAR2 / NCLOB columns (which Django creates by default)? If the latter, then what is the NLS_NCHAR_CHARACTERSET of each database? Also, the dumpdata o

Re: db error after migrating from postgres to oracle

2009-11-18 Thread Ian
'm not sure what the official status of the PostgreSQL backend is with regard to timezone-aware datetimes, although evidently it works. I would suggest taking a look at the django-timezones app. I haven't used it myself, but I believe it's supposed to handle time zone localization automatically by

Re: form with loop over fields?

2009-11-11 Thread Ian Lewis
andraeas, You can define a choice field that takes a callable as it's choices. That way you could use the current year and loop over the subsequent years to create the list you need. Just return a two tuple that can be used as the choices for a normal field in your function. class

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

2009-10-02 Thread Ian Kelly
affect other > part of the TextField methods ? It should be okay. The only relevant difference is at the database level, where NCLOB is stored in the national character set (which is guaranteed to be Unicode) and CLOB is stored in the database character set. Regards, Ian --~--~-~--

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

2009-09-30 Thread Ian Kelly
rring to. > I tested : > -http://www.djangosnippets.org/snippets/685/too. This is wholly unrelated, and I don't recommend using it unless you need full-text search support. Regards, Ian --~--~-~--~~~---~--~~ You received this message because you are su

Re: OT: Drawing lines in the browser

2009-08-18 Thread Ian McDowall
rcles etc.) in it. The SVG is just XMl and Django's templating works fine for that. There are some technical catches about the type of the document and namespaces but I can provide a worked example. The drawback is that not all browsers support SVG well. This appears to work well in recent ve

Re: problems with large data

2009-07-16 Thread Ian Kelly
? If str, what encoding is it? You mentioned that it fails around 4000 characters. Does it fail just in the 2001-4000 character range, just in the 4001+ character range, or both? Thanks, Ian --~--~-~--~~~---~--~~ You received this message because you are subscribe

Re: Reading data from database tied to another Django project?

2009-07-15 Thread Ian Clelland
andom_function_sql(self): return 'RAND()' That will let you define, in your P1 models, a complete table name like this: class Example(models.Model): ... fields ... class Meta: db_table = 'p2_database.table_name' And mysql will get the data from the right database. No raw SQ

Re: code of models from oracle to mysql

2009-07-15 Thread Ian Kelly
at inspectdb is not working properly for whatever it you > have in your original DB. DecimalField(decimal_places=-127, max_digits=126) is what the Oracle introspection returns for float columns, since that's how the database describes them. If you change them to FloatField you should be ok

Re: SelectMultiple with Static Choices in admin Interface

2009-07-13 Thread Ian Clelland
ings) You probably want to be excluding the recipients field from the model form, replacing it with another field which uses the multiple-select widget. Then you can pre-set the value in the widget before you render the form, and you can set the proper value for the CharField before you save the mo

Re: Nested views and urls patterns declaration order

2009-07-13 Thread Ian Clelland
yz" gets matched by the first regex, and passed to view_list_reservation (your inner view), rather than being passed to your outer view, as you would like. Try adding a '^' character to the front of your regular expressions, and see if the reque

Re: Reading data from database tied to another Django project?

2009-07-10 Thread Ian Clelland
join the tables from the two databases together, though -- avoiding foreign keys from P1 models to P2 models should be enough. Ian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Combining filters on related models

2009-07-09 Thread Ian Clelland
ruct such a query, without resorting to raw SQL? I've tried it a couple of ways with Q objects, with the same results... I'm using django 1.0, so I haven't investigated F objects at all, but I'm willing to upgrade if that's what it takes :) Thanks, Ian --~--~-~--~~~---

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

2009-07-03 Thread Ian Kelly
the latest trunk version if possible. If upgrading is not an option, then I suggest creating a synonym for the sequence with the name Django expects for the sequence. This is normally the name of the table plus "_SQ", unless that would be longer than the allowed 30 characters. H

Re: A problem about django apache mod_wsgi with oracle

2009-06-30 Thread Ian Kelly
with it ? Make sure you're using the same versions of Python, cx_Oracle, and the Oracle client in both instances. Also make sure that the server process's ORACLE_HOME environment variable is set. Hope this helps, Ian --~--~-~--~~~---~--~~ You received this messag

Smipple - Social Code Snippets

2009-06-29 Thread Ian Lewis
contributing any kind of snippets that they want. We'd love it if Ruby, PHP, Java, JavaScript or Perl developers would use the site as well! What kind of social sharing site would it be if there were only certain types of developers using it after all! Happy Coding, Ian

Re: Odd ModelForm problem

2009-06-24 Thread Ian Lewis
I'm not sure why it might work on one server but not on another unless the version of Django was different but as far as I know form.slug is not really guaranteed to exist. Normally it gets added to form.fields or somesuch by the forms metaclass. The actual data from the post request should also

Re: Processing multiple forms on one page

2009-06-24 Thread Ian Lewis
Oleg, You can set a parameter in your post request that allows you to differentiate between the two POST requests. But a more clean approach would be to just have the different forms POST to different urls(views) and the redirect back to the profile page if there is an error or do whatever. Ian

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

2009-06-15 Thread Ian Kelly
it's very easy to miss when perusing the source code. The backend DatabaseWrapper class (where the connection is stored) inherits from BaseDatabaseWrapper, which inherits from threading.local. Ian --~--~-~--~~~---~--~~ You received this message because you

Re: Amazon S3 for File Uploads

2009-06-12 Thread Ian Lewis
depend on what you want to do but personally I rolled my own based on Django 1.1's storage api which does a lot better job of streaming and chucking data for large files because existing options like the ones below weren't very robust . Ian On Sat, Jun 13, 2009 at 6:55 AM, Max Clark <max

Re: Question about ForeignKeys and subclasses

2009-06-03 Thread Ian Lewis
Rex, My appologies. Though the feature is in 1.0 I gave a link to the 1.1 documentation. Django 1.0 docs: http://docs.djangoproject.com/en/1.0/topics/db/models/#id7 2009/6/3 Ian Lewis <ianmle...@gmail.com> > Rex, > > Django parent model instances will also have a

Re: comments error

2009-06-03 Thread Ian Lewis
Looks like the next parameter doesn't really work though. See: http://groups.google.com/group/django-users/browse_thread/thread/109763039cef5c3d/470d678e46d7dfe0?hl=en=gst And: http://code.djangoproject.com/ticket/8968 2009/6/3 Ian Lewis <ianmle...@gmail.com> > Iperk, > > Is th

Re: comments error

2009-06-03 Thread Ian Lewis
Iperk, Is this perhaps what you are looking for? http://docs.djangoproject.com/en/dev/ref/contrib/comments/#redirecting-after-the-comment-post On Mon, Jun 1, 2009 at 6:38 AM, lperk wrote: > > Does someone know how to redirect posted comment to another page if > you have

Re: Question about ForeignKeys and subclasses

2009-06-03 Thread Ian Lewis
that. It's reasonable enough if you are dealing with a small number of instances. See: http://docs.djangoproject.com/en/dev/topics/db/models/#multi-table-inheritance Ian On Mon, Jun 1, 2009 at 3:49 PM, Daniel Roseman < roseman.dan...@googlemail.com> wrote: > > On Jun 1, 5:39 am, Rex <

Re: oracle with us7ascii encode character lost

2009-05-25 Thread Ian Kelly
above two steps don't solve the problem, try recompiling cx_Oracle with the WITH_UNICODE option. Hope that helps, Ian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send emai

Re: Connecting to Legacy Oracle Tables

2009-05-22 Thread Ian Kelly
ntly recognize views or synonyms correctly. If you have apps with models that need to be created, run manage.py sqlall on those apps, and pass the resulting sql into sqlplus or manage.py dbshell. You can also edit the generated sql by hand before runni

Storage API and Uploading to http based storage

2009-05-22 Thread Ian Lewis
supporting uploading directly via an UploadHandler or other data backend which requires the length as the upload handler provides the data in chunks. Any thoughts would be appreciated, Ian --~--~-~--~~~---~--~~ You received this message because you are subscribed

UploadHandlers and the Storage API

2009-05-21 Thread Ian Lewis
/running tests. The storage API currently handles writing itself in the save method by reading from a file like object, but you currently can't do the opposite where you are given chunks of data and you want to pass them along. Is there a particularly good way to solve this kind of problem? Ian

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

2009-05-15 Thread Ian Kelly
eld then > appears in the table. > > Thanks! > Mike Mike, There's no difference between the sql generated by sqlall and that generated by syncdb. Are you certain the table didn't already exist before you ran syncdb? Syncdb won't drop or alter a table that already exists. Regards, Ian --~

Re: database user vs schema owner

2009-04-30 Thread Ian Kelly
If you're using Django trunk or the 1.1 beta version, you can use the connection_created signal to run your alter session statement at connection time. Otherwise, you could do what we do: create synonyms for the tables inside the Django user's schema. Regards, Ian --~--~-~--~~---

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 <ernesto.la...@gmail.com> 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 p

Re: Django-Tagging not working with Oracle

2009-03-20 Thread Ian Kelly
n't clear before. I just meant that I changed this line: from tagging.forms import TagField to this: from tagging.fields import TagField Both forms.py and fields.py define a TagField class, and they're not the same thing. HTH, Ian --~--~-~--~~~---~--~~ You re

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

<    1   2   3   4   5   6   7   >