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 code. The en

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 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 key > all have no ef

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", "copyr

Re: ORA-01425

2010-12-02 Thread Ian
7; 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 ema

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 the clie

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

2010-12-01 Thread Ian Kelly
;) >>>> cursor.fetchone()[0] > 'Registro guardado con \xe9xito' It's not clear to me which setting you used here. Was this using the .UTF8 NLS_LANG as I requested? If so, then in fact this is also coming back incorrectly, because that is not UTF-8. If not, then we're

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

2010-12-01 Thread Ian
g 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']) rev

Re: Django 1.3 alpha 1 released

2010-11-11 Thread Ian Lewis
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 group, send email to

Re: Oracle Database Other User Tables/Views

2010-10-20 Thread Ian
er 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

Re: Django Registration password reset problem

2010-10-06 Thread Ian Lewis
this list aren't paid to do so, and mostly have >> > full-time jobs. >> >> > So a little patience will make it more likely people will help you. >> >> > regards >> >  Steve >> > -- >> > DjangoCon US 2010 September 7-9http://djan

Re: Separating application media from project media

2010-10-01 Thread Ian Lewis
opies them 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

Re: How to debug ORM filter stacking?

2010-09-25 Thread Ian Lewis
l 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 Google Groups "Django users

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" group

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

2010-08-17 Thread Ian
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-us...@googlegroups

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 wrote: > On Mon, 2010-08-16 at

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

2010-08-13 Thread Ian
ngo 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 this group, send

Re: renaming database constraint names

2010-08-03 Thread Ian
ngo 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; HTH, Ian -- You recei

Re: create table

2010-07-19 Thread Ian Lewis
ield > 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.djangoproject.com/en/dev/topics/auth/#s

Re: Special characters and symbols in django?

2010-06-18 Thread Ian
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...@googlegroups.com. To unsubsc

Re: Special characters and symbols in django?

2010-06-17 Thread Ian
uded 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.com

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 filtering, I can execute the fo

Re: how to use render_to_response, ajax and javascript variables

2010-06-17 Thread Ian McDowall
some point. Cheers Ian On Jun 17, 9:37 am, Matt Hoskins 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 po

Re: how to use render_to_response, ajax and javascript variables

2010-06-17 Thread Ian McDowall
rst_name":"{{one_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

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

2010-06-16 Thread Ian McDowall
t of extra 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 wrote: > Hi Dmitry, hi Ian, > > thanks for the help. > > I got it to work. Here is what I am doing. > > Django gets a request for &qu

Re: how to use render_to_response, ajax and javascript variables

2010-06-16 Thread Ian McDowall
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 wrote: > Hi, > &

Re: Oracle cursor.execute problem

2010-06-15 Thread Ian
n 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 message because you are sub

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 wrote: > I am working on a simple site right

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 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 with multiple responses. Is there >

Re: Custom Form in a ModelFormset_Factory?

2010-05-18 Thread Ian Lewis
o any documentation that indicates > this (and other features) is an option? > > On May 18, 1:10 am, Ian Lewis wrote: >> Pass the form class to modelformset_factory() in the form argument. >> The factory will then use the AuthorForm class as the base form class >>

Re: Challenge with Annotate

2010-05-18 Thread Ian Lewis
27;)) ... Would that get you the group by and average 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 wrote: > On 05/18/2010 03:43 PM, Ian Lewis wrote: >> Roland, >> >&g

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 wrote: > Hello, > > Question: How do I calculate the Average of a calculated field. > >

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 profile

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: > pan...@pankaj-laptop:~/django_projects/pankaj$ python >

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 Davi

Re: Oracle cursor.execute problem

2010-04-28 Thread Ian
k 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 cursor.callf

Re: Oracle cursor.execute problem

2010-04-26 Thread Ian
ut 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 entered into sqlplus. In that

Re: Oracle cursor.execute problem

2010-04-23 Thread Ian
r in the query.  The string-formatting link is a not really > germane .. Despite the '%s', it's purely a placeholder syntax, not a formatting system. The params don't have to be strings, because they don't actually get interpolated into the query at any point. Ints, floats

Re: Oracle cursor.execute problem

2010-04-23 Thread Ian
On Apr 23, 2:44 pm, Ian 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 a list rath

Re: Oracle cursor.execute problem

2010-04-23 Thread Ian
han the 'named' 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.

Re: Retrieving an ID from a posted form

2010-04-22 Thread Ian Lewis
ct, "Your 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 wrote: > I am working on a form process with multiple levels of submission. The > first is a front facing form with a gener

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

2010-04-18 Thread Ian
ld 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 email to django-users+unsubs

Re: Getting error in Cloudwatch EC2 BOTO

2010-04-14 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 wrote: > Hello guys > I am having error when performing Cloudwatch in

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 processed?''

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 > causing chaos on a django

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 attempting to re-route us

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 look

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 available online and curre

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 title for > this one.

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,

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 (with

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 and any recommendation

Re: Serving https with runserver

2010-03-01 Thread Ian Lewis
Ian On Mon, Mar 1, 2010 at 7:43 PM, Gonzalo Delgado 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 >> talking here

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 : > In process_request you have access to the request object which kno

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 em

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 b

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 th

Re: Admin interface not working in Oracle

2010-01-26 Thread Ian
ere 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 are subscr

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

2010-01-26 Thread Ian
updated_by 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 wrote: > Hi, > > On Wed, Jan 27, 2010 at 3:35 AM, Ian wrote: > > How wou

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 fie

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

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

2009-12-17 Thread Ian
. 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 subscribed to the

Re: Couldn't create tables.

2009-12-11 Thread Ian
e 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 subscribed to the Google Groups &

Re: loaddata encoding problem

2009-12-01 Thread Ian
chemas? > > 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 output should be in utf-8. Can

Re: db error after migrating from postgres to oracle

2009-11-18 Thread Ian
uires naive datetimes. I'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

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 LazyChoiceFiel

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

2009-10-01 Thread Ian Kelly
thods ? 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 --~--~-~--~~~---~--~~ You received

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

2009-09-30 Thread Ian Kelly
gt; 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 subscribed to

Re: OT: Drawing lines in the browser

2009-08-18 Thread Ian McDowall
s 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 ver

Re: problems with large data

2009-07-16 Thread Ian Kelly
t 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 subscribed to the Goog

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

2009-07-15 Thread Ian Clelland
")]) def random_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

Re: code of models from oracle to mysql

2009-07-15 Thread Ian Kelly
rking 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 okay. Ian --~--~-

Re: SelectMultiple with Static Choices in admin Interface

2009-07-13 Thread Ian Clelland
be selected all of the time, because of the python representation of unicode strings) 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 be

Re: Nested views and urls patterns declaration order

2009-07-13 Thread Ian Clelland
like "ue/reservations/xyz" 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 requests are passed to t

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

2009-07-10 Thread Ian Clelland
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 t

Combining filters on related models

2009-07-09 Thread Ian Clelland
Is there any way to construct 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,

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

2009-07-03 Thread Ian Kelly
rtunately, the Oracle backend doesn't currently offer a way to specify an alternative name for the sequence. However, in Django 1.1 we have changed the way AutoField values are retrieved to use a "RETURNING" clause, which in addition to being m

Re: A problem about django apache mod_wsgi with oracle

2009-06-30 Thread Ian Kelly
'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 message because yo

Smipple - Social Code Snippets

2009-06-28 Thread Ian Lewis
from 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 Co

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 n

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
y 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 are subscribed t

Re: Amazon S3 for File Uploads

2009-06-12 Thread Ian Lewis
would 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, M

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 > Rex, > > Django parent model instances will also have a property equal to the > lowercase

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&lnk=gst And: http://code.djangoproject.com/ticket/8968 2009/6/3 Ian Lewis > Iperk, > > Is this perhaps wh

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 your own form for sendi

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:3

Re: oracle with us7ascii encode character lost

2009-05-25 Thread Ian Kelly
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 email

Re: Connecting to Legacy Oracle Tables

2009-05-22 Thread Ian Kelly
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 running it, if you need finer-grain control. Hope that helps,

Storage API and Uploading to http based storage

2009-05-21 Thread Ian Lewis
for 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 subscr

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?

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

2009-05-15 Thread Ian Kelly
tly inserted as the table's primary key.  No ID field 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

Re: database user vs schema owner

2009-04-30 Thread Ian Kelly
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 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 running the same model you posted be

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 django.c

Re: Django-Tagging not working with Oracle

2009-03-20 Thread Ian Kelly
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 received this message because you are s

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

2009-03-20 Thread Ian Kelly
On Mar 20, 11:16 am, Ian Kelly 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 > Django either as a CGI or

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 will show up. > Even over

<    1   2   3   4   5   6   7   >