Re: Oracle backend and passing data as is.

2016-05-18 Thread Jani Tiainen

Hm.

I was able to figure out what it was and do have hack around that. 
OracleParam class does certain checks, mainly it chekcs if param is 
date/time/timedelta or true/false. Otherwise it converts everything to 
string.


And that's where backend thinks that WKTAdapter coming from Oracle GIS 
backend is actually a string and runs some conversion.


So instead of that I should be able to say "raw value, don't touch". 
Only way I managed to do it currently was to introduce "bind_parameter" 
method on my WKTAdapter which just returns raw object.


This solution works but it feels a bit of wrong since I guess bind 
parameter isn't exactly meant for that.



On 18.05.2016 10:54, Aymeric Augustin wrote:
Yes, we have a lot of code in this area. It isn’t particularly 
complex, but it isn’t always easy to tell what problem a particular 
line of code solves either. I’m afraid “educated guesses” are your 
best option at this point.


Conditionally skipping some type conversions on sufficiently modern 
cx_Oracle / Oracle versions would be nice :-)


--
Aymeric.

On 18 May 2016, at 06:49, Jani Tiainen > wrote:


Unfortunately problem seem to lie somewhere in standard Oracle 
backend and it's way to handle arguments and argument types. Most 
probably it's FormatStylePlaceholderCursor object that does it.


On 18.05.2016 00:09, Claude Paroz wrote:

Hello Jani,

I'm not familiar with the Oracle backend, but you probably have to 
play with the
OracleSpatialAdapter / WKTAdapter stuff to achieve what you need. 
Good luck!


Claude

Le mardi 17 mai 2016 14:53:28 UTC+2, Jani Tiainen a écrit :

I'm toying around Oracle and latest cx_Oracle feature that allows
putting real objects through cx_Oracle to database. One use case
is GIS
which is way faster than trying to transfer WKT over queries.

I just have one problem - how I can tell in the backend that one
particular query parameter and it's must be kept as is, and it's
type
set automatically (or not to set at all on Django side).

Currently I always end up having "Expecting MDSYS.SDO_GEOMETRY got
NCHAR" error.

-- 


Jani Tiainen

--
You received this message because you are subscribed to the Google 
Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, 
send an email to django-developers+unsubscr...@googlegroups.com 
.
To post to this group, send email to 
django-developers@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/1da65293-721c-4790-ae76-b146d580d22d%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
You received this message because you are subscribed to the Google 
Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, 
send an email to django-developers+unsubscr...@googlegroups.com 
.
To post to this group, send email to 
django-developers@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/573BF445.2070109%40gmail.com 
.

For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google 
Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-developers+unsubscr...@googlegroups.com 
.
To post to this group, send email to 
django-developers@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/AFBAE5CE-64B2-4CBA-B254-3E39B84FA7AB%40polytechnique.org 
.

For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Django 
developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at 

Re: Oracle backend and passing data as is.

2016-05-18 Thread Aymeric Augustin
Yes, we have a lot of code in this area. It isn’t particularly complex, but it 
isn’t always easy to tell what problem a particular line of code solves either. 
I’m afraid “educated guesses” are your best option at this point.

Conditionally skipping some type conversions on sufficiently modern cx_Oracle / 
Oracle versions would be nice :-)

-- 
Aymeric.

> On 18 May 2016, at 06:49, Jani Tiainen  wrote:
> 
> Unfortunately problem seem to lie somewhere in standard Oracle backend and 
> it's way to handle arguments and argument types. Most probably it's 
> FormatStylePlaceholderCursor object that does it.
> 
> On 18.05.2016 00:09, Claude Paroz wrote:
>> Hello Jani,
>> 
>> I'm not familiar with the Oracle backend, but you probably have to play with 
>> the 
>> OracleSpatialAdapter / WKTAdapter stuff to achieve what you need. Good luck!
>> 
>> Claude
>> 
>> Le mardi 17 mai 2016 14:53:28 UTC+2, Jani Tiainen a écrit :
>> I'm toying around Oracle and latest cx_Oracle feature that allows 
>> putting real objects through cx_Oracle to database. One use case is GIS 
>> which is way faster than trying to transfer WKT over queries. 
>> 
>> I just have one problem - how I can tell in the backend that one 
>> particular query parameter and it's must be kept as is, and it's type 
>> set automatically (or not to set at all on Django side). 
>> 
>> Currently I always end up having "Expecting MDSYS.SDO_GEOMETRY got 
>> NCHAR" error. 
>> 
>> -- 
>> 
>> Jani Tiainen 
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-developers+unsubscr...@googlegroups.com 
>> .
>> To post to this group, send email to django-developers@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-developers 
>> .
>> To view this discussion on the web visit  
>> https://groups.google.com/d/msgid/django-developers/1da65293-721c-4790-ae76-b146d580d22d%40googlegroups.com
>>  
>> .
>> For more options, visit https://groups.google.com/d/optout 
>> .
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-developers+unsubscr...@googlegroups.com 
> .
> To post to this group, send email to django-developers@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/django-developers 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-developers/573BF445.2070109%40gmail.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/AFBAE5CE-64B2-4CBA-B254-3E39B84FA7AB%40polytechnique.org.
For more options, visit https://groups.google.com/d/optout.


Re: Oracle backend and passing data as is.

2016-05-17 Thread Jani Tiainen
Unfortunately problem seem to lie somewhere in standard Oracle backend 
and it's way to handle arguments and argument types. Most probably it's 
FormatStylePlaceholderCursor object that does it.


On 18.05.2016 00:09, Claude Paroz wrote:

Hello Jani,

I'm not familiar with the Oracle backend, but you probably have to 
play with the
OracleSpatialAdapter / WKTAdapter stuff to achieve what you need. Good 
luck!


Claude

Le mardi 17 mai 2016 14:53:28 UTC+2, Jani Tiainen a écrit :

I'm toying around Oracle and latest cx_Oracle feature that allows
putting real objects through cx_Oracle to database. One use case
is GIS
which is way faster than trying to transfer WKT over queries.

I just have one problem - how I can tell in the backend that one
particular query parameter and it's must be kept as is, and it's type
set automatically (or not to set at all on Django side).

Currently I always end up having "Expecting MDSYS.SDO_GEOMETRY got
NCHAR" error.

-- 


Jani Tiainen

--
You received this message because you are subscribed to the Google 
Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-developers+unsubscr...@googlegroups.com 
.
To post to this group, send email to 
django-developers@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/1da65293-721c-4790-ae76-b146d580d22d%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Django 
developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/573BF445.2070109%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Oracle backend and passing data as is.

2016-05-17 Thread Claude Paroz
Hello Jani,

I'm not familiar with the Oracle backend, but you probably have to play 
with the 
OracleSpatialAdapter / WKTAdapter stuff to achieve what you need. Good luck!

Claude

Le mardi 17 mai 2016 14:53:28 UTC+2, Jani Tiainen a écrit :
>
> I'm toying around Oracle and latest cx_Oracle feature that allows 
> putting real objects through cx_Oracle to database. One use case is GIS 
> which is way faster than trying to transfer WKT over queries. 
>
> I just have one problem - how I can tell in the backend that one 
> particular query parameter and it's must be kept as is, and it's type 
> set automatically (or not to set at all on Django side). 
>
> Currently I always end up having "Expecting MDSYS.SDO_GEOMETRY got 
> NCHAR" error. 
>
> -- 
>
> Jani Tiainen 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/1da65293-721c-4790-ae76-b146d580d22d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Oracle backend and passing data as is.

2016-05-17 Thread Jani Tiainen
I'm toying around Oracle and latest cx_Oracle feature that allows 
putting real objects through cx_Oracle to database. One use case is GIS 
which is way faster than trying to transfer WKT over queries.


I just have one problem - how I can tell in the backend that one 
particular query parameter and it's must be kept as is, and it's type 
set automatically (or not to set at all on Django side).


Currently I always end up having "Expecting MDSYS.SDO_GEOMETRY got 
NCHAR" error.


--

Jani Tiainen

--
You received this message because you are subscribed to the Google Groups "Django 
developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/573B143B.5050400%40gmail.com.
For more options, visit https://groups.google.com/d/optout.