Re: pymssql: Problem with Unicode string

2011-01-29 Thread Orgil
sorry, let me correct some row: --- import pymssql conn = pymssql.connect(host='testserver', user='sa', password='sa', database='testdb', as_dict=True) crms = conn.cursor() crms.execute('SELECT cc_Name FROM tblUsers') for line

pymssql: Problem with Unicode string

2011-01-29 Thread Orgil
Hello! I am using pymssql-1.9.908. And I have MSSQL2008 database server. I ran following code from python 2.6: --- import pymssql conn = pymssql.connect(host='testserver', user='sa', password='sa', database='testdb', as_dict=True) crms =

Facebook session problems.

2011-01-29 Thread CrabbyPete
I managed to log into facebook using the graph api, I store the FB id and tie it to a User, like this class FacebookUser(models.Model): user= models.ForeignKey(User) fb_uid = models.CharField( max_length=100, blank = True, unique = True ) access_token=

Re: Django cache created in one function not available to another?

2011-01-29 Thread Russell Keith-Magee
On Sat, Jan 29, 2011 at 9:30 PM, Rob Hudson wrote: > This sounds similar to this bug : > http://code.djangoproject.com/ticket/15149 If the OP is using Django 1.2.3, this probably isn't #15179 -- Jeff reports that if he rolls back to before the recent key prefixing changes, his

Re: ANN: Server upgrade on djangoproject.com

2011-01-29 Thread Russell Keith-Magee
On Sun, Jan 30, 2011 at 12:29 PM, creecode wrote: > Hello Jacob, > > On Jan 28, 12:33 pm, Jacob Kaplan-Moss wrote: > >> I'm starting the switchover to the new djangoproject.com server right >> now. > > The source listings seem to visually cut off code.  I

Re: Google maps

2011-01-29 Thread Sam Walters
Hi This also depends how server-side oriented you want this to be? Its good to learn geodjango. (that way if your calculation areas of polygons, loading layers you can just make this python+server side instead of writing it in javascript. Also with lots of ajax related request/response designs

Re: ANN: Server upgrade on djangoproject.com

2011-01-29 Thread creecode
Hello Jacob, On Jan 28, 12:33 pm, Jacob Kaplan-Moss wrote: > I'm starting the switchover to the new djangoproject.com server right > now. The source listings seem to visually cut off code. I don't recall seeing this issue before the upgrade. Thanks, creecode -- You

Re: How to format a datetime in a webpage?

2011-01-29 Thread Wayne Young
Thank you very much! I misunderstood the meaning of "date" and "the time of day"... On Fri, Jan 28, 2011 at 8:53 PM, Jirka Vejrazka wrote: > > {{record.ComplaintTime|time:"Y-m-d > > H:i"}} > > From the documentation: > > "The time filter will only accept

Styleled Form in login generic views

2011-01-29 Thread Daniel Corbe
Hi, How to get a 'class=inputStyle' on a form in generic login view? -- Daniel Corbe Hahne Latorre dan...@corbe.com.br 55 48 9618-5115 skype: daniel_corbe -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Django Admin - list_display doesn't follow FK links?

2011-01-29 Thread Mathieu Möller
Hey Victor, - I changed my subscription to my gmail-account because I'm not sure if my email went trough. Here is it again. - I do the following to get data out of a related table/model: Of course you could access your other model via __unicode__...

contenttypes and dumpdata options

2011-01-29 Thread jd
hello, What's the current recommended way to deal with contenttypes when you move a db using dumpdata? I know about excluding it, but I read something about using the ---natural option with the dump command would work as well. Does this work when including contenttypes in the dump? Which is the

Re: Django Admin - list_display doesn't follow FK links?

2011-01-29 Thread Excite User
Hey Victor, I do the following to get data out of a related table/model: Of course you could access your other model via __unicode__... Or, simply write a function for your model and use a callback in your list_display: Here an easy "quick and dirty" example: class othermodel(models.Model)

Re: Django Template CSS Load Path

2011-01-29 Thread octopusgrabbus
Interestingly, I added TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.request', 'django.core.context_processors.media', ) to my settings.py and got this error. Put 'django.contrib.auth.context_processors.auth' in your TEMPLATE_CONTEXT_PROCESSORS setting in order to use

query did not work

2011-01-29 Thread gintare
would like to post one bug, since i was sitting 4h on it For some reasons query did not work. In the end appeared that it depends on how urls.py are formulated: urlpatterns = patterns('', (r'^searchbooks','Finnish2.Fin.views.searchbooks'), # page http://127.0.0.1:8000/searchbooks is

Re: Django Template CSS Load Path

2011-01-29 Thread octopusgrabbus
I still cannot get the css page to load. On Jan 19, 4:02 pm, Matías Iturburu wrote: > On Wed, Jan 19, 2011 at 5:30 PM, Eduardo Cereto Carvalho < > > eduardocer...@gmail.com> wrote: > > You can use MEDIA_URL conf to get the root path to your media files. > > > > /> > My

Re: need help following tutorial part 1

2011-01-29 Thread Andre Terra
Quick and dirty solution: python django-admin.py startproject mysite or Add C:\PathToYourDjangoInstall\Scripts\ to your PATH environment variable. This can be done in one of two ways. #1 (EASIER) Open 'System Properties' (hit WindowsKey + PauseBreak, or right-click on My Computer and select

Re: need help following tutorial part 1

2011-01-29 Thread Panupat
Oh Axel, sorry about that ^_^; The tutorial said I should cd to the directory I want to start my project. So no I wasn't in C:\Python27\Scripts when I typed the command On Jan 30, 2:05 am, Axel Bock wrote: > you should not. are you IN c:\...\scripts when you type in >

Re: need help following tutorial part 1

2011-01-29 Thread Axel Bock
you should not. are you IN c:\...\scripts when you type in "django-admin.py"? AFAIK windows adds the current directory always to the path. and it's AXEL ;) 2011/1/29 Panupat > Hi Alex. Thank you for you suggestion. > > It seems I can get the script to run if I type out

Re: need help following tutorial part 1

2011-01-29 Thread Panupat
Hi Alex. Thank you for you suggestion. It seems I can get the script to run if I type out the full path. C:\Python27\Scripts\django-admin.py startprofect mysite C:\Python27 is already added to my windows' PATH. Proably will need to add C:\Python27\Scripts to it too. On Jan 30, 1:44 am, Axel

Re: need help following tutorial part 1

2011-01-29 Thread Axel Bock
hm ... my windows times are over quite a while, BUT ... 1) try associating the .py extension with the python commandline interpreter. 2) syntax error? send a screendump maybe, or your exact command line ... it _should_ work without problems. can you execute other simple python scripts? cheers,

need help following tutorial part 1

2011-01-29 Thread Panupat
I'm kinda stuck and would greatly appreciate any help. I followed these turorials and got Django to install. Was able to import Django and print out the version correctly. I'm running Apache2.2 on windows 7 with mod_wsgi http://docs.djangoproject.com/en/1.2/intro/install/ But moving forward to

newbie question about paths

2011-01-29 Thread Brian Craft
Suppose the project is /var/www/django/project. Following the django with wsgi docs, you would add /var/www/django to the path, and DJANGO_SETTINGS_MODULE would be project.settings. However, in that case, the path scheme described in the tutorial doesn't work, e.g. setting up admin.py for Polls

Re: Word file Display and Save??

2011-01-29 Thread Andre Terra
What's the rationale behind attaching a .doc file to a user profile? I'm willing to bet $20 this isn't the best solution for what you need. Sincerely, André Terra On Sat, Jan 29, 2011 at 10:18, Andy McKay wrote: > > On 2011-01-28, at 8:16 PM, nicolas lubkov wrote: > > Hello

Re: Django cache created in one function not available to another?

2011-01-29 Thread Rob Hudson
This sounds similar to this bug : http://code.djangoproject.com/ticket/15149 On Jan 28, 8:02 am, Lance Vick wrote: > So I have a function that sets cache (and successfully outputs it): > > def push_cache: >     cache.set('foo_cache', 'FUBAR!!!') >     foodata =

Re: Django Admin - list_display doesn't follow FK links?

2011-01-29 Thread Daniel Roseman
On Saturday, January 29, 2011 12:28:49 PM UTC, Victor Hooi wrote: > > Hi, > > I'm trying to use list_display in the django-admin, and I can't seem to > find a way to get list_display to follow FK links. > > My models.py: > > class Site(models.Model): > name = models.CharField(max_length=50,

Django Admin - list_display doesn't follow FK links?

2011-01-29 Thread Victor Hooi
Hi, I'm trying to use list_display in the django-admin, and I can't seem to find a way to get list_display to follow FK links. My models.py: class Site(models.Model): name = models.CharField(max_length=50, unique=True) description = models.TextField() def __unicode__(self):

Re: QUERYDICT immutable

2011-01-29 Thread Andy McKay
On 2011-01-29, at 5:25 AM, sami nathan wrote: > now i want to change just message in my request.POST (denoted by red color in > above request) and i am helpless i tried the following code > > def recive_ShortMessage(request): > if request.method == 'POST': >

Re: Word file Display and Save??

2011-01-29 Thread Andy McKay
On 2011-01-28, at 8:16 PM, nicolas lubkov wrote: > Hello all, is there a way to display a word .doc in the user profile and let > the users edit it and save it to keep in their profile.?? You may add what ever you want to a user profile model and you can add files to models using a FileField.

Re: Word file Display and Save??

2011-01-29 Thread Maxim Mai
I am not so sure if you can access MS word from python directly, or if there are some libraries that allow you to do so. But I am sure that there is one thing you can try: WORD -> XML -> DOM -> Python -> django views.py / admin_views.py -> DOM -> XML -> WORD hope this helps, correct me if this