OK thanks for this informations.
Yes I would like P3, but it is my host, for the moment.
Cordially
Le dimanche 6 mars 2016 20:30:14 UTC+1, luisza14 a écrit :
>
> The problem is in your __str__() function, because Python 2 use
> __unicode__() instead of str to return Unicode string. By default
The problem is in your __str__() function, because Python 2 use
__unicode__() instead of str to return Unicode string. By default p2 return
bytes in __str__ and p3 return Unicode.
python_2_unicode_compatible works and I thing it is the best approach
because you are support both version 3/2 .
I
OK thanks
Without the python_2_unicode_compatible decorator before my class, it does
not work.
Le dimanche 6 mars 2016 14:11:41 UTC+1, Vijay Khemlani a écrit :
>
> Do you know why you had the problem in the first place or are you just
> copy-pasting code?
>
> If you only need to support one
Do you know why you had the problem in the first place or are you just
copy-pasting code?
If you only need to support one version of Python (either 2.x or 3.x) there
is no need to use the python_2_unicode_compatible decorator
On Sun, Mar 6, 2016 at 8:14 AM, Georges H
OK Thanks but I solved this little problem by adding at the top of my
models.py:
django.utils.encoding import from python_2_unicode_compatible
And always in models.py before each class:
@ python_2_unicode_compatible
Perfect!
Le dimanche 6 mars 2016 03:16:35 UTC+1, Vijay Khemlani a écrit :
>
The error you are seeing is at the application level, not database, so I
don't think postgres is at fault.
Post the full stack trace for the error and the relevant part of your code
when it fails.
On Sat, Mar 5, 2016 at 3:28 PM, Georges H wrote:
> Hi to all the Django
Hi to all the Django community !
I started with Django.
I have a small form that works pretty well, and that will store the data in
a Postgres database, that's fine.
OK, except that when I have a special character to enter (like an accent, I
am french), I get an error (No problem without
10.1.2013 8:59, Ian Kelly kirjoitti:
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.
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
9.1.2013 19:21, Ian Kelly kirjoitti:
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
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
9.1.2013 12:28, Ian kirjoitti:
On Wednesday, January 9, 2013 12:38:28 AM UTC-7, Jani Tiainen wrote:
Tested against latest master. Same behaviour.
In Oracle backend base.py is following piece of code:
# Check whether cx_Oracle was compiled with the WITH_UNICODE option.
This
On Wednesday, January 9, 2013 12:38:28 AM UTC-7, Jani Tiainen wrote:
>
> Tested against latest master. Same behaviour.
>
> In Oracle backend base.py is following piece of code:
>
> # Check whether cx_Oracle was compiled with the WITH_UNICODE option.
> This will
> # also be True in Python 3.0.
Ok, found source of the problem - but I don't know the solution.
I'm using Oracle client 10.2.0.3.0. It seems that unicode doesn't work
there.
I compiled cx_Oracle against 11g instantclient 11.2 and it worked just fine.
So it must be something that Django assumes with Oracle and unicode
Tested against latest master. Same behaviour.
In Oracle backend base.py is following piece of code:
# Check whether cx_Oracle was compiled with the WITH_UNICODE option.
This will
# also be True in Python 3.0.
if int(Database.version.split('.', 1)[0]) >= 5 and not hasattr(Database,
8.1.2013 21:00, akaariai kirjoitti:
I created the following test case into django's test suite modeltests/
basic/tests.py:
def test_unicode(self):
# Note: from __future__ import unicode_literals is in
effect...
a = Article.objects.create(headline='0
I created the following test case into django's test suite modeltests/
basic/tests.py:
def test_unicode(self):
# Note: from __future__ import unicode_literals is in
effect...
a = Article.objects.create(headline='0
\u0442\u0435\u0441\u0442 test', pub_date=datetime.n ow())
Hi,
I've been trying to save UTF-8 characters to oracle database without
success.
I've verified that database is indeed UTF-8 capable.
I can insert UTF-8 characters directly using cx_Oracle.
But when I use ORM it will trash characters.
Model I use:
class MyTest(models.Model):
txt =
On Mon, Jan 4, 2010 at 11:05 AM, Bill Freeman wrote:
> I find the error slightly confusing because the mentioned character, \xc2,
> which is capital A with circumflex, doesn't occur in the quoted part of the
> text. Line 46 not included in your post, perhaps? Apparently the
Hi Bill, Simon,
On 04/01/10 16:05, Bill Freeman wrote:
> I find the error slightly confusing because the mentioned character,
> \xc2, which is capital A with circumflex, doesn't occur in the quoted
> part of the text.
\xc2 is the first byte of a character encoded in UTF-8 as two bytes.
The
I find the error slightly confusing because the mentioned character, \xc2,
which is capital A with circumflex, doesn't occur in the quoted part of the
text. Line 46 not included in your post, perhaps? Apparently the pound
signs, \xa3, aren't bothering it because they're in u"", or maybe it would
On Sun, Jan 3, 2010 at 6:48 PM, Simon Davies wrote:
> I know I'm missing something really simple really but I keep getting
> this error:
>
> SyntaxError: Non-ASCII character '\xc2' in file /home/simon/
> djangoprojects/bikerescue/bikeshop/models.py on line 46, but no
>
I know I'm missing something really simple really but I keep getting
this error:
SyntaxError: Non-ASCII character '\xc2' in file /home/simon/
djangoprojects/bikerescue/bikeshop/models.py on line 46, but no
encoding declared; see http://www.python.org/peps/pep-0263.html for
details. This is the
Hi Ian,
I do have NVARCHAR2 columns and the NLS_NCHAR_CHARACTERSET is
AL16UTF16 in both schemas.
When trying to decode and encode according to your instruction I get:
UnicodeEncodeError: 'latin-1' codec can't encode characters in
position 4171134-4176189: ordinal not in range(256)
When looking
On Dec 1, 9:29 am, Johan wrote:
> Hi,
>
> I have two oracle schemas created with the same characterset
> (NLS_CHARACTERSET = WE8ISO8859P1).
>
> I get a "DatabaseError: ORA-12704: character set mismatch" when doing
> this:
> 1) dumpdata to export data from a module
Hi,
I have two oracle schemas created with the same characterset
(NLS_CHARACTERSET = WE8ISO8859P1).
I get a "DatabaseError: ORA-12704: character set mismatch" when doing
this:
1) dumpdata to export data from a module named log in the first schema
and then
2) loaddata to import the result into
Dear All,
I have an urgent task about fetching data from DB(MySQL) to the web
using django, the MySQL is 4.0 and charset in Latin-1, and there's
some non-english data inside the DB.
There has two problems when implementing that using Django, first,
when I start the app, it told me "server is
You could try file_name.decode('utf-8', 'replace') which will tell the
encoder not to throw errors but for any character it can't encode it
will replace with a ?
On Jul 31, 12:26 pm, alecs wrote:
> Environment:
>
> Request Method: GET
> Request
>
Environment:
Request Method: GET
Request URL:
http://172.16.23.33/file/4719e0bdedaa4f741f032991894d52ecb08c3476a598504fd1fee92d
Django Version: 1.0.3
Python Version: 2.6.2
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
On Jul 31, 11:55 am, alecs wrote:
> I'm sending a file to user:
>
> upfile = UpFile.objects.get(file_hash=request.path[6:])
> user = get_object_or_404(User, username=request.user.username)
> down_file_log = DownFile.objects.create(user_id=user,
>
I'm sending a file to user:
upfile = UpFile.objects.get(file_hash=request.path[6:])
user = get_object_or_404(User, username=request.user.username)
down_file_log = DownFile.objects.create(user_id=user,
file_id=upfile)
wrapper = FileWrapper(file(upfile.file_path))
Yes. I completely missed that ticket, but I had switched to importing
markdown normally instead of through Django, and it solved my
problems.
But I noticed on Ubuntu that the repository version of python-markdown
is still 1.6. So I will switch to a newer version of Markdown. Thank
you both for
On Jun 1, 7:11 pm, Karen Tracey wrote:
>
> That comment, specifically, includes the same exception and traceback as you
> are showing. I read subsequent discussion in the ticket to be saying that
> the problem here is the markdown version, it's some pre-Unicode support
>
On Mon, Jun 1, 2009 at 4:02 PM, bfrederi wrote:
>
> I'm getting this:
>
> Traceback (most recent call last):
> File "/home/django-code/aubrey_explore/tests.py", line 18, in
> testSpeaking
>self.assert_(markdown(self.bla.collection_description_short))
> File
Sorry, didn't mean to post so many replies. A combination of an
annoying KVM switch and user error.
On Jun 1, 3:19 pm, bfrederi wrote:
> I'm getting this:
>
> Traceback (most recent call last):
> File "/home/django-code/aubrey_explore/tests.py", line 18, in
>
I'm getting this:
Traceback (most recent call last):
File "/home/django-code/aubrey_explore/tests.py", line 18, in
testSpeaking
self.assert_(markdown(self.bla.collection_description_short))
File "/usr/lib/python2.5/site-packages/django/contrib/markup/
templatetags/markup.py", line 72, in
I'm getting this:
Traceback (most recent call last):
File "/home/django-code/aubrey_explore/tests.py", line 18, in
testSpeaking
self.assert_(markdown(self.bla.collection_description_short))
File "/usr/lib/python2.5/site-packages/django/contrib/markup/
templatetags/markup.py", line 72, in
I'm getting this:
Traceback (most recent call last):
File "/home/django-code/aubrey_explore/tests.py", line 18, in
testSpeaking
self.assert_(markdown(self.bla.collection_description_short))
File "/usr/lib/python2.5/site-packages/django/contrib/markup/
templatetags/markup.py", line 72, in
On Mon, Jun 1, 2009 at 2:26 PM, bfrederi wrote:
>
> I am having problems using the
> django.contrib.markup.templatetags.markup.markdown function with
> special characters (diacritics and such).
>
> I am using markdown in my model and creating a function that returns
>
I am having problems using the
django.contrib.markup.templatetags.markup.markdown function with
special characters (diacritics and such).
I am using markdown in my model and creating a function that returns
markdown from a model field. I even went as far as to override the
save method for my
Thank you that was it :)
On Mar 23, 5:01 pm, Briel wrote:
> Hi.
>
> It sounds like you have run into the auto escape filter. It basically
> converts html tags into something viewable but not html. This is
> a protective matter, to protect your site from cross site scripting
Hi.
It sounds like you have run into the auto escape filter. It basically
converts html tags into something viewable but not html. This is
a protective matter, to protect your site from cross site scripting
attacks, that can take down your site and worse. If you want to
display some html from
Hi all,
I'm a django newbie. I have a mysql database backend and when I try to
output html from the database I'm getting all the html as
ampersand + l + t + ;
So then when I view the page I'm basically seeing all the html tags.
mysql server - 5.1.30
Thoughts?
What am I doing wrong?
thanks
On Mon, Jul 21, 2008 at 12:23 PM, [EMAIL PROTECTED] <
[EMAIL PROTECTED]> wrote:
>
> Some news;
> I found an old trunk (0.97-pre-SVN-unknown ... ?!?!) and I downgraded
> the django version..
> Now all works well...
>
> It's a bug of the new versions..?
>
>
Not likely. It's more likely your code
Some news;
I found an old trunk (0.97-pre-SVN-unknown ... ?!?!) and I downgraded
the django version..
Now all works well...
It's a bug of the new versions..?
Thanks
Davide
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Hi!
Thanks for your help..
more informations :
I have downloaded the latest trunk this morning (0.97-pre-SVN-7947),
but nothing changed...
I run django on ubuntu server, python 2.5.1 and mysql 5 (apache +
mod_python).
I have copied the wrong urlPattern, this is the right one:
On Thu, Jul 17, 2008 at 1:01 PM, [EMAIL PROTECTED] <
[EMAIL PROTECTED]> wrote:
>
> Hi,
> I have a problem about the encoding of the variables that i have in my
> views..
>
> I've an url like this:
>
>
On Thu, 2008-07-17 at 10:01 -0700, [EMAIL PROTECTED] wrote:
> Hi,
> I have a problem about the encoding of the variables that i have in my
> views..
>
> I've an url like this:
>
> http://elvis.sinedita.it/dossiers/Comunità/1/
>
> my URLS:
>
> (r'(?P[^/]+)/section/$',
Hi,
I have a problem about the encoding of the variables that i have in my
views..
I've an url like this:
http://elvis.sinedita.it/dossiers/Comunità/1/
my URLS:
(r'(?P[^/]+)/section/$', 'views.listpersection'),
in the views i found something like 'Comunit\xe0'
and when i exec:
On Sun, 2007-11-04 at 10:54 +, omat wrote:
> I change one thing at a time when debugging but after posting here, I
> go on with experimenting. And when I respond to a request, like
> posting the traceback, usually it is not the very exact instance that
> I am running currently.
Well,
I change one thing at a time when debugging but after posting here, I
go on with experimenting. And when I respond to a request, like
posting the traceback, usually it is not the very exact instance that
I am running currently. I change it to be consistent with the on going
discussion, but
On Sat, 2007-11-03 at 13:13 +, omat wrote:
> Here is the traceback:
>
> Traceback (most recent call last):
> File "update_feeds.py", line 171, in process_feed
> process_entry(entry, fpf, feed, postdict)
> File "update_feeds.py", line 119, in process_entry
> feed.tags))
> File
On Sat, 2007-11-03 at 14:51 +, omat wrote:
> I have experimented both with the subject and the message. They both
> expose the same problem when the name contains non-ascii chars.
>
> As a hack, I started using the slug field instead of the name field
> both in the message template and the
Take a look at your Tag model's __unicode__ method (or paste your Tag
model here). I suspect that's where the problem is.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
On 11/3/07, omat <[EMAIL PROTECTED]> wrote:
> "repr(sbj)"= str: u'new tag: Arkada\u015flar\u0131n'
The str: prefix on that looks a little odd. I'm also confused how you got
repr(sbj) if (as according to the traceback) the exception occurs on the
line preceding the assignment of sbj?
What
I have experimented both with the subject and the message. They both
expose the same problem when the name contains non-ascii chars.
As a hack, I started using the slug field instead of the name field
both in the message template and the subject and it works fine, but
the problem is still there.
On 11/3/07, omat <[EMAIL PROTECTED]> wrote:
>
>
> Here is the traceback:
[snip]
So, it is during the rendering of the template that things go kerflooey:
File "/srv/django/sites/haberrobotu/aggregator/models.py", line 199,
> in mail_new_tag
> msg = t.render(c)
...in which case the
Typo: "str" in "isinstance(str, unicode)" should be "sbj"
On 3 Kasım, 15:13, omat <[EMAIL PROTECTED]> wrote:
> Here is the traceback:
>
> Traceback (most recent call last):
> File "update_feeds.py", line 171, in process_feed
> process_entry(entry, fpf, feed, postdict)
> File
Here is the traceback:
Traceback (most recent call last):
File "update_feeds.py", line 171, in process_feed
process_entry(entry, fpf, feed, postdict)
File "update_feeds.py", line 119, in process_entry
feed.tags))
File "/srv/django/common/tagging/managers.py", line 39, in
On Sat, 2007-11-03 at 07:01 -0500, James Bennett wrote:
> On 11/3/07, omat <[EMAIL PROTECTED]> wrote:
> > sbj = u'new tag: %s' % (instance.name)
>
> You might want to read this:
>
> http://code.djangoproject.com/wiki/UnicodeBranch#PortingApplicationsTheQuickChecklist
>
> There's a warning
On Sat, 2007-11-03 at 11:41 +, omat wrote:
> Hi All,
>
> I have a function that sends mail to managers every time a new tag is
> created, connected to post_save of a Tag model via dispatcher.
>
> def mail_new_tag(instance):
> t = loader.get_template('app/new_tag_email.txt')
> c =
On 11/3/07, omat <[EMAIL PROTECTED]> wrote:
> sbj = u'new tag: %s' % (instance.name)
You might want to read this:
http://code.djangoproject.com/wiki/UnicodeBranch#PortingApplicationsTheQuickChecklist
There's a warning about using this style of string interpolation under
Python 2.3 which
Hi All,
I have a function that sends mail to managers every time a new tag is
created, connected to post_save of a Tag model via dispatcher.
def mail_new_tag(instance):
t = loader.get_template('app/new_tag_email.txt')
c = Context({'tag': instance})
msg = t.render(c)
sbj = u'new
£,¥ and other non-ASCII symbols are working perfectly on the latest
newforms-admin. Thanks, Malcolm!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
Hi Malcom,
Thanks for the quick reply! I will wait for the Unicode changes to be
ported to the newforms-admin branch.
Just so I understand the situation... Does the current newforms-admin
branch always trigger errors when non-ASCII data such as é and ¢ are
entered into text fields?
And while
On Sat, 2007-07-07 at 02:23 +, leifbyron wrote:
> Hello,
>
> I have run into a character-encoding error while developing a custom
> admin site with the newforms-admin branch.
newforms-admin has not had the Unicode changes ported across to it yet.
Using it with non-ASCII data is not
Hello,
I have run into a character-encoding error while developing a custom
admin site with the newforms-admin branch.
Everything works fine with standard alphanumeric input, but as soon as
I enter a special character (an accented e or a pound sign, for
example) into a text field or textarea, I
Hi,
from django.utils.translation import ugettext as _
My guess is that if you import ugettext, then you should supply a
Unicode string as an argument:
def index(request):
teststring = _(u"Lösung")
[...]
(notice the 'u' before the string).
That works here, at least using an utf-8
Hi list,
my django is completely utf8-configured. I'm using I18N and my msg-ids
(po-files) are utf8-encoded, too.
But now I've run into a strange problem: Translation of strings
containing non-ascii characters is working great in templates, but it
fails if I try to translate non-ascii strings
Hello.
I think there is a problem in django.contrib.admin.models code:
string slice ("object_repr[:200]") doesn't respect multibyte encodings
(UTF8).
class LogEntryManager(models.Manager):
def log_action(self, user_id, content_type_id, object_id,
object_repr, action_flag,
I have encountered a problem with Spanish tilde into my django
templates.
If I use the {% trans 'something' %} where something contains a Spanish
tilde. I get an error which tells me:
Exception Type: UnicodeDecodeError
Exception Value:'ascii' codec can't decode byte 0xc3 in
71 matches
Mail list logo