Re: What is different of handling character code between pure Python and Django?

2014-05-26 Thread Sugita Shinsuke
Hello Tom I finally resolved the problem. I used subprocess.Popen's option "shell=False" And, make cm by list. I resolved. Thank you. 2014年5月8日木曜日 17時45分52秒 UTC+9 Tom Evans: > > On Thu, May 8, 2014 at 5:05 AM, Sugita Shinsuke > > wrote: > > Hello Tom Evans > > > > >

Data + admin design problem

2014-05-26 Thread Wojtas
Hi there! I didn't know where to ask. I'm doing Django for couple of years, and I encountered following problem. I'm doing a website which manages warehouse of company which lends music instruments. I have 3 types of products: serial -> which exist only in amount of 1 countable -> which exist

Re: Proxy problem (permissions denied)

2014-05-26 Thread Me Sulphur
Sorry, logging in after a while. Hopefully you have solved the problem by now. Answering just in case some one stumbles upon through Google. The problem is not the proxy, it is that you are accessing SITE B (localhost:*8080*) from SITE A (localhost:*8000*) from within the browser, which is

OneToOne? Inheritance? Another solution for nested model relationships?

2014-05-26 Thread Daniele Procida
I've an application that's been happily running for a few years, that does this: class Person(Model): # everyone's a Person class Researcher(Model): # a Researcher is Person who publishes research person = models.OneToOneField(Person) class Publication(Model): author =

Re: Anyone interested in reviewing the code of a small project - BookMarker

2014-05-26 Thread Aseem Bansal
I am using webbrowser library because this project is supposed to store bookmarks instead of my browser. Storing bookmarks in a app is useful only if there is a way to open them via the app. I was initially serving the bookmarks as hyperlinks but then came across a problem. Web browser's were

A bug found when bad file paths

2014-05-26 Thread Gox Dávalos Camarena
I downloaded django 1.6.5 and tried to migrate an old application (from Django 1.3). Then when i go into the admin i got an error (see the image error2.jpg). As you can see, there is impossible to figure out what can be the reason of the problem. Then I tried to replicate in my old

Re: Anyone interested in reviewing the code of a small project - BookMarker

2014-05-26 Thread Andre Terra
Why are you using the webbrowser library? I don't see how it makes sense.. Cheers, AT On Mon, May 26, 2014 at 12:32 PM, Aseem Bansal wrote: > Thanks Shmengie. I was thinking of using class based views as it was > pointed in tutorial that they are better but I was not

Re: Anyone interested in reviewing the code of a small project - BookMarker

2014-05-26 Thread Aseem Bansal
Thanks Shmengie. I was thinking of using class based views as it was pointed in tutorial that they are better but I was not sure which ones are good here. So I decided to prioritize making it work and then go for refactoring. CSS location I will change. The tutorials used include's but I

Re: why I change url is showing other user's data?

2014-05-26 Thread Andromeda Yelton
The urlpattern is telling your view (I assume a subclass of UpdateView?) which instance of your User model to edit, but that's all the urlpattern gets you - there's nothing built in about permissions. You need to write permission restrictions yourself. There's a whole bunch of ways you can do

Re: Anyone interested in reviewing the code of a small project - BookMarker

2014-05-26 Thread shmengie
Looks like you're getting a handle on django. You're not using Class Based Views, but you import generic. Since you're getting familiar with django, you *might* want to hold off on delving into CBVs. They're very powerful and can reduce coding, but can be difficult to wrap your head around.

Re: Django queryset csv encode

2014-05-26 Thread hito koto
Hi, WongoBongo, Thanks 2014年5月26日月曜日 18時39分20秒 UTC+9 WongoBongo: > > If you want all the user_name's in Staff as UTF-8: > > staff = Staff.objects.all() > staff_list = [s.user_name.encode('utf-8') for s in staff] > > I'm not familiar with the encoding you mentioned in your last message. Try >

RE: ASP .NET web service and Django

2014-05-26 Thread Ilya Kazakevich
Hello, For web services (I believe you speak about SOAP web services) check: * https://wiki.python.org/moin/WebServices (SOAP section). It has info about Python SOAP client and server libraries. * For .NET (client) : http://stackoverflow.com/questions/1302525/how-to-use-a-wsdl Ilya Kazakevich,

Re: ASP .NET web service and Django

2014-05-26 Thread Jani Tiainen
You might be interested in suds library, it's basically lightweight SOAP stuff, it may work or it may not. All depends quality of WSDL you do have. And to my knowledge getting Django to run on IronPython requires some hacks... On Mon, 26 May 2014 04:09:19 -0700 (PDT) shar100101

Re: ASP .NET web service and Django

2014-05-26 Thread shar100101
Unfortunately Tastypie is not solution for me, because it uses Rest. I am using IronPython to run website and I still have not found solution to read Soap/Rest requests with IronPython. I was hoping that output form .Net service, sent using HTTP, can be used in Django. I tried using WebRequest

Re: Django queryset csv encode

2014-05-26 Thread Kelvin Wong
If you want all the user_name's in Staff as UTF-8: staff = Staff.objects.all() staff_list = [s.user_name.encode('utf-8') for s in staff] I'm not familiar with the encoding you mentioned in your last message. Try it. K On Monday, May 26, 2014 2:12:14 AM UTC-7, hito koto wrote: > > Hi, > >

Re: Django queryset csv encode

2014-05-26 Thread Kelvin Wong
Okay, I re-read your first post. You said that you wanted to get a UTF-8 string. name = [name.encode("utf8") for name in Staff.objects.filter(id = 3).values_list('user_name', flat=True)] This variable 'name' now contains a UTF-8 encoded string in a list-like object. Python 2.7.6 (default,

Re: Django queryset csv encode

2014-05-26 Thread hito koto
Hi, I have this: >>> x = name >>> import locale >>> locale.getdefaultlocale()[1] 'UTF8' >>> print x ['\xe5\x93\x88\xe6\x96\xaf\xe6\x9c\x9d\xe9\xad\xaf'] after i try this : >>> name ['\xe5\x93\x88\xe6\x96\xaf\xe6\x9c\x9d\xe9\xad\xaf'] >>> type(name) Traceback (most recent call last): File "",

Re: Django queryset csv encode

2014-05-26 Thread WongoBongo
Python 2.7.6 (default, Jan 13 2014, 04:26:18) [GCC 4.2.1 (Apple Inc. build 5577)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> x = u'\u54c8\u65af\u671d\u9b6f' >>> print(x) 哈斯朝魯 >>> import locale >>> locale.getdefaultlocale()[1] 'UTF-8' >>> K On Sunday,

Column type and index not support by Django ORM - best way to alter/add them

2014-05-26 Thread graeme
I need to do the the following to Postgres tables for Django models: 1) Add a functional index 2) Have a bigserial primary key and a bigint foreign key point to it. Given that I only want this on a single install, is there any reason not to just do it directly? I have found code snippets with