Can't move down then up the directory tree for inserting of html files

2010-11-09 Thread Brian
Thanks for the help. I'm using Python 2.5 and Django Template 1.1 I can't seem to move down then up the directory tree for inserting of html files using {% include file %} statement Sample dir structure: root/ root/lib/ root/lib/Top.html root/main/ root/main/include/HomeLogo.html root/main/HOME.

Please help me figure out this UnicodeEncodeError

2010-11-09 Thread Eric Chamberlain
Hi, can anyone tell me how to work around this UnicodeEncodeError? >>> from hashlib import md5 >>> full_jid = u'e...@example.com/Eric\u2019s iPhone 3GS' >>> hash = md5(full_jid) Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'ascii' codec can't encode character u'\u2

Making MODEL.objects.raw() query with LIKE input%

2010-11-09 Thread xvga
Hi All, my question is linked to this thread, so I post here I need to run sql query with LIKE and % in the end - I have tried %% and : CLASSNAME.objects.raw("select * from table where full_name like %s%% ", [user_input]) this is what I get as sql: select * from table where full_name LIKE 'u

Re: question about involve "vncserver" command with django

2010-11-09 Thread Bill
Hi Clifford, Thank you, sounds like good, I will try FreeNX later. but you know, I already wrote the python code, it works except I use it on Django. BTW, we are very close, I'm at Eglinton subwaystation. Best regards, Bill > I've found FreeNX with the NoMachine client to be a much better > al

Help!!: creating a combined form linked via foreign key??

2010-11-09 Thread sosurim kim
This message isn't going through for some reason... -- Forwarded message -- From: sosurim kim Date: Mon, Nov 8, 2010 at 1:55 PM Subject: Re: creating a combined form linked via foreign key?? To: django-users@googlegroups.com Oops, I meant to say addressbook, not phonebook... sor

Re: Create a ContentType object on model save

2010-11-09 Thread Kenny Meyer
Kenny Meyer (knny.m...@gmail.com) wrote: > Hello, > > I have two models, 1) FlashCard and 2) Practice, and I have a generic relation > in the FlashCard model pointing to the Practice model using the contenttypes > framework. > The Practice model tracks information like how many times something was

Re: question about involve "vncserver" command with django

2010-11-09 Thread CLIFFORD ILKAY
On 11/09/2010 05:50 PM, Bill wrote: What am I doing is want to simplify using vnc. I'm a Linux administrator. As you know, if users want to use vnc they must login the server with ssh to start vnc server first. Then get the port or id number, then use vncviewer or http link to access the vncserve

Re: question about involve "vncserver" command with django

2010-11-09 Thread Bill
Hi Jirka, Thank you for your quickly reply. >   this is technically impossible, two programs cannot listen on the > same TCP port (on one interface). It's very likely that it was Django > webserver listening there. You are right, sorry for that stupid question, and I check it again, I find the X

Re: Trouble accessing development server

2010-11-09 Thread Shawn Milochik
Instead of the domain try 0.0.0.0 or your public IP address. python manage.py runserver 0.0.0.0:8000 or python manage.py runserver 82.165.105.204:8000 #this is just a sample IP address for Host Monster Shawn -- You received this message because you are subscribed to the Google Groups "Djang

Trouble accessing development server

2010-11-09 Thread Engywook
I have django running on HostMonster, and am having a problem reaching the Development server. According to a reply to somebody having a similar issue, what I'm supposed to do is this: python manage.py runserver www.yourhost.yourdomain.com:8000. Tried that, with several different port numbers. W

Admin Inlines only show up after a browser refresh

2010-11-09 Thread vjimw
We have an odd situation where, for one of our model forms, the inlines do not regularly show up on the form page, but if you refresh the browser window, they will appear with the correct data. Has anyone else run into this before? I am not really sure how to debug it since it is not consistent. H

Re: clean method in a model

2010-11-09 Thread refreegrata
Thanks for answer. You have reason, I don't need do that. With a clean method in the modelform is enough. This question appear, because initialy I just wanted add a validator to the field of the model, but for the validation the parameter "self" was necessary and I could not find a way to pass th

Re: question about involve "vncserver" command with django

2010-11-09 Thread Jirka Vejrazka
> For example,  django listen on tcp port 8000, and the Xvnc also listen > on tcp port 8000. > It's wired. Hi Bill, this is technically impossible, two programs cannot listen on the same TCP port (on one interface). It's very likely that it was Django webserver listening there. Overall, st

change the color of messages fr .validate

2010-11-09 Thread John Fabiani
Hi, Newbie here! Therefore I'll need a little detail (like show the code). How in the heck can I change the color of the messages from jquery.validate.js Here's my code: $("#registration_form").validate({ rules: { first_name : "required", last_name :

question about involve "vncserver" command with django

2010-11-09 Thread Bill
Hi all, I met a problem, I can use python to execute the the command "vncserver " to start vncserver use subprocess, like this: process = subprocess.Popen('vncserver' , shell=True) but when I write this code to views.py it didn't work as I hope. The Xvnc process listened on the port which Django

Re: Excessive tmp table creation for mysql

2010-11-09 Thread Marc Aymerich
On Tue, Nov 9, 2010 at 7:49 PM, Nick wrote: > Yesterday I received a warning from our DB monitoring system stating > that my django DB had an excessive amount of temp tables created. Here > is the error: > > * Nagios 2.10 * > > Notification Type: PROBLEM > > Service: mysql_tmp_disk_tables

Excessive tmp table creation for mysql

2010-11-09 Thread Nick
Yesterday I received a warning from our DB monitoring system stating that my django DB had an excessive amount of temp tables created. Here is the error: * Nagios 2.10 * Notification Type: PROBLEM Service: mysql_tmp_disk_tables Host: Address: State: WARNING Date/Time: Mon Nov 8 15:19:18

translate user registration errors

2010-11-09 Thread Andrea Imparato
Hello to all, I have to translate Username can only contain alphanumeric characters and the underscore. error when my users have to register to my site. How can I do that? I tried blocktrans without success :( Thanks P.S.: django is so cool :) -- You received this message because you are subsc

Re: clean method in a model

2010-11-09 Thread cootetom
You say you want to do the clean in the model but then say you want the error to be associated with the field in the ModelForm? If you need that clean functionality to exist for both a model and a form of that model then you could shift the checks into a function of it's own out side of the class's

Re: A cache-busting sledge-hammer

2010-11-09 Thread Ole Laursen
On Nov 9, 1:13 pm, Łukasz Rekucki wrote: > I would recommend using one of asset managers that provide JS/CSS > versioning instead. Their aren't very hard to install. You can compare > some of the more popular at > djangopackages.com:http://djangopackages.com/grids/g/asset-managers/ Seems like th

Re: django models: two foreignky for "User"

2010-11-09 Thread Marcos Moyano
Use related_name (http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey.related_name) Rgds, Marcos At Tue, 9 Nov 2010 07:20:45 -0800 (PST), luckrill wrote: > > I write following models: > > class article(models.Model): > created_by = models.ForeignKey('User')

Re: get_absolute_url and root url

2010-11-09 Thread devbird
Sorry, I was wrong. The url pattern must have a trailing slash. On Nov 9, 9:33 am, devbird wrote: > you should set the "root url" as '^$'(an empty string), without any > '/', and remove the slash from the url pattern regexp. > > On Nov 8, 2:07 pm, Dirk Eschler wrote: > > > > > Hello, > > > i've

Re: clean method in a model

2010-11-09 Thread refreegrata
ok, thanks for the answer, but I want use the clean method in a model, not in a form. For that in the clean method I throw a ValidationError, but the error message isn't associated to the field form of the modelform. On 8 nov, 19:17, cootetom wrote: > If you want to associate an error to a specif

django models: two foreignky for "User"

2010-11-09 Thread luckrill
I write following models: class article(models.Model): created_by = models.ForeignKey('User') edited_by = models.ForeignKey('User') django report error. How to ForeignKey "User" for two field. -- You received this message because you are subscribed to the Google Groups "Django users" g

Re: A cache-busting sledge-hammer

2010-11-09 Thread Łukasz Rekucki
I would recommend using one of asset managers that provide JS/CSS versioning instead. Their aren't very hard to install. You can compare some of the more popular at djangopackages.com: http://djangopackages.com/grids/g/asset-managers/ In most cases you get things like JS/CSS combining and compress

Re: "Include" tag and dynamically generated file to include

2010-11-09 Thread Łukasz Rekucki
On 9 November 2010 11:25, samuele.mattiuzzo wrote: > Hi all, > i have a problem with a django template. > > i have a value (a number) stored into a mysql database and i'm > accessing it using {{ totem.layout.communitySpace }} > > This number sould be used to get a page: > {% include "bacheche/clip

move up tree in {% include "/dir/name.html" %} statement

2010-11-09 Thread Brian
Thanks for the help. I'm using Python 2.5 and Django Template 1.1 I can't seem to move up the directory tree for inserting of html files using {% include file %} statement Sample dir structure: ---/lib/Top.html ---/lib/ root/ ---/main/ ---/main/include/HomeLogo.html ---/mai

Re: "Include" tag and dynamically generated file to include

2010-11-09 Thread samuele.mattiuzzo
Ok, i'll stick with the building up into the view! Thanks, by searching older posts i found something, so i'll read those. Thanks again! On 9 Nov, 13:09, Daniel Roseman wrote: > On Nov 9, 10:25 am, "samuele.mattiuzzo" wrote: > > > > > > > Hi all, > > i have a problem with a django template. > >

Re: Generic Views - do you use them?

2010-11-09 Thread ringemup
I don't use them either for much the same reasons, and because I often end up using custom render_to_response shortcuts that set common context or handle custom template loading. Although the new class- based views may make them more customizable. I don't see much need for an alternative, though

Re: Exclude form field when calling form from view

2010-11-09 Thread Knut Ivar Nesheim
Whenever you create an instance of UploadFileForm you need to explicitly tell it to not show the title. In the first 4 lines of your view, you do it correctly, but if you receive post data, your code does not do anything with show_title, and since you set it to True by default, it will get included

Re: Custom formset validation: having a "save?" checkbox for each form

2010-11-09 Thread Carsten Fuchs
Dear Knut, thank you very much for your reply! I guess I didn't see the forest for the trees... Somehow I thought there is a way to validate only those forms in a formset whose "should save" boolean field is set - which in turn would have required validating only this field of every form indep

Re: A cache-busting sledge-hammer

2010-11-09 Thread Cal Leeming [Simplicity Media Ltd]
That's a pretty neat idea, originally I was having to use { now|date:"u" } to put the current epoch timestamp on the end of the urls... On 09/11/2010 10:35, Ole Laursen wrote: Hi! If you have the problem of visitors getting errors from using the old Javascripts and CSS when you roll out a rele

Re: Mysql Quires using raw()

2010-11-09 Thread Jani Tiainen
On Tuesday 09 November 2010 12:25:30 Jagdeep Singh Malhi wrote: > hi > I am facing problem with raw() mysql quiers > for example : > maxid = Client.objects.raw('SELECT Max(id) FROM client') > > print maxid > > output is :- > > > I am using Django 1.2 version. > where I am wrong? Nowhere. Outpu

Re: Exclude form field when calling form from view

2010-11-09 Thread Ed
I'm still a bit confused, apologies. This is the beginning of the view: def upload_file(request, modelname, id): if modelname == 'film': form = UploadFileForm() else: form = UploadFileForm(show_title=False) object = get_object_or_404(modelna

"Include" tag and dynamically generated file to include

2010-11-09 Thread samuele.mattiuzzo
Hi all, i have a problem with a django template. i have a value (a number) stored into a mysql database and i'm accessing it using {{ totem.layout.communitySpace }} This number sould be used to get a page: {% include "bacheche/clip_{{ totem.layout.communitySpace }}.html" %} and it should return

Re: get_absolute_url and root url

2010-11-09 Thread devbird
you should set the "root url" as '^$'(an empty string), without any '/', and remove the slash from the url pattern regexp. On Nov 8, 2:07 pm, Dirk Eschler wrote: > Hello, > > i've built an app which is based on Django's flatpages app. It reuses most of > its features including the FlatPageFallba

Re: "Include" tag and dynamically generated file to include

2010-11-09 Thread Daniel Roseman
On Nov 9, 10:25 am, "samuele.mattiuzzo" wrote: > Hi all, > i have a problem with a django template. > > i have a value (a number) stored into a mysql database and i'm > accessing it using {{ totem.layout.communitySpace }} > > This number sould be used to get a page: > {% include "bacheche/clip_{{

A cache-busting sledge-hammer

2010-11-09 Thread Ole Laursen
Hi! If you have the problem of visitors getting errors from using the old Javascripts and CSS when you roll out a release, I have a sledge- hammer solution that only requires a single-line change in your settings.py. It's a middleware that examines the HTML from your views and appends a little ti

Re: Can extra() be used to implement JOIN?

2010-11-09 Thread bruno desthuilliers
On 8 nov, 16:52, Daniel Roseman wrote: > This is exactly what `select_related()` does. The only gotcha is that > you have to start with the Answer model, rather than Question, but the > result is the same: > >     answers = Answer.objects.filter(question_id=1).select_related() > > Now each answer

Re: non-ASCII characters in {{}}

2010-11-09 Thread bruno desthuilliers
On 9 nov, 00:13, Sébastien RAGONS wrote: > Hello, > > I try to display an article but there is char like 'é'. Django uses only unicode internally. If you take care of using utf8 encoding all the way down (python source files, template source files, database, webserver etc) you shouldn't have an

Mysql Quires using raw()

2010-11-09 Thread Jagdeep Singh Malhi
hi I am facing problem with raw() mysql quiers for example : maxid = Client.objects.raw('SELECT Max(id) FROM client') print maxid output is :- I am using Django 1.2 version. where I am wrong? -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Using Django's auth for Trac too

2010-11-09 Thread Graham Dumpleton
On Nov 9, 7:54 pm, Torsten Bronger wrote: > Hall chen! > > Knut Ivar Nesheim writes: > > See the following link to the docs. This should be exactly what > > you want. > > >http://docs.djangoproject.com/en/dev/howto/apache-auth/ > > We use WSGI.  But if all else fails, switching to mod_python may

Re: Validator for \t

2010-11-09 Thread Daniel Roseman
On Nov 9, 9:11 am, Ralf Peschke wrote: > Thank you for your response, Cliff. > But the strip-command wasn't my problem. I wondered why Django let pass > these kind of invalid input and if there is an easy way to toggle this > behavior for the whole project. I could not find anything in the Django

Re: Validator for \t

2010-11-09 Thread Ralf Peschke
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thank you for your response, Cliff. But the strip-command wasn't my problem. I wondered why Django let pass these kind of invalid input and if there is an easy way to toggle this behavior for the whole project. I could not find anything in the Django d

Re: Using Django's auth for Trac too

2010-11-09 Thread Torsten Bronger
Hallöchen! Knut Ivar Nesheim writes: > See the following link to the docs. This should be exactly what > you want. > > http://docs.djangoproject.com/en/dev/howto/apache-auth/ We use WSGI. But if all else fails, switching to mod_python may be an alternative. Thank you! Tschö, Torsten. -- Tor

Re: Using Django's auth for Trac too

2010-11-09 Thread Knut Ivar Nesheim
Hi, See the following link to the docs. This should be exactly what you want. http://docs.djangoproject.com/en/dev/howto/apache-auth/ Regards Knut On Tue, Nov 9, 2010 at 6:51 AM, Torsten Bronger wrote: > Hallöchen! > > I know that my question has a strong Apache component, but can > anybody he

Re: Exclude form field when calling form from view

2010-11-09 Thread Knut Ivar Nesheim
The problem is here: if request.method == 'POST': form = UploadFileForm(request.POST, request.FILES) You need to make sure you always pass in show_title correctly when instantiating the form. Regards Knut On Tue, Nov 9, 2010 at 3:57 AM, Ed wrote: > I can fall back on the subcl