Django TypeError-/SEARCH/

2012-03-01 Thread coded kid
Hi guys, I want to create a search form for my django site. So after creating it, I input the keyword I want to search, after clicking on “Search” I’m getting: TypeError at /search/ Related Field has invalid lookup: icontains Request Method: GET Request URL:http://127.0.0.1:8000/search/?q=lord

Re: using django templates to generate and replace a file

2012-03-01 Thread Paul Bunker
Thanks Kurtis, It seems so obvious now! :-) I can do ... t = Template(open('users.template').read()) c = Context([get the users from db]) open('users.cfg','w').write(t.render(c)) Thanks for your speedy response! It seems I couldn't see the wood for the trees -Paul On Feb 29, 8:24 pm, Kurtis Mu

EuroPython 2012: Call for Proposal is Open!

2012-03-01 Thread Palla
Hi all, I'm Francesco and I am writing on behalf of EuroPython Staff (www.europython.eu). We are happy to announce that the Call for Proposals is now officially open! DEADLINE FOR PROPOSALS: MARCH 18TH, 23:59:59 CET For those who have never been at EuroPython (or similar conferences) before, the

Re: subprocess

2012-03-01 Thread Sébastien Billion
Hi, You can try something like that: p = subprocess.Popen(args=[("%s %s") % (script_name,command_args1)], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True) output = p.stdout.readlines() p.wait() 2012/3/1 dummyman dummyman > Hi , > > i am using django s view function to invoke py*t

Re: subprocess

2012-03-01 Thread Tom Evans
On Thu, Mar 1, 2012 at 11:42 AM, Sébastien Billion wrote: > Hi, > > You can try something like that: > > p = subprocess.Popen(args=[("%s %s") % (script_name,command_args1)], Sorry to pick on something seemingly inconsequential, but this really riles me. If you launch a subprocess using a string l

Re: subprocess

2012-03-01 Thread Sébastien Billion
Thanks for the explications Tom. I didn't realize the consequently to use a string like in my example. Sorry for my bad post 2012/3/1 Tom Evans > On Thu, Mar 1, 2012 at 11:42 AM, Sébastien Billion > wrote: > > Hi, > > > > You can try something like that: > > > > p = subprocess.Popen(args=[("%s

How do i view json data returned from django

2012-03-01 Thread Stanwin Siow
Hello, I want to view the actual json data from django view, is there anyway i can do that before i parse it into jQuery? Below are my two methods def refresh_list(request): if request.method == 'POST': if 'name_input2' in request.POST: username = request.POST['nam

humanized date range and translation

2012-03-01 Thread Emmanuel Beffara
Hello, I am working on a Django application for handling events with schedules. Basically an event has a starting and ending date and contains sessions, each with a date and starting and ending time (current code is at https://gitorious.org/django-seminar/). The application is internationalize

How can I use order_by and filter at the same time? (drives me nuts..!!!)

2012-03-01 Thread Tony Kyriakides
How can I use order_by and filter at the same time? (drives me nuts..!!!) This is what i tried: from django.shortcuts import render_to_response from vidupdate.posts.models import Entry from datetime import datetime #( I even imported the date only) def entry_view(request): entries = Entry.

Re: How do i view json data returned from django

2012-03-01 Thread Shawn Milochik
On 03/01/2012 07:48 AM, Stanwin Siow wrote: Hello, I want to view the actual json data from django view, is there anyway i can do that before i parse it into jQuery? Assuming that you have a dictionary named "return_data," this will do it: return HttpResponse(simplejson.dumps(return_data),

Re: How can I use order_by and filter at the same time? (drives me nuts..!!!)

2012-03-01 Thread Tom Evans
On Thu, Mar 1, 2012 at 1:21 PM, Tony Kyriakides wrote: > How can I use order_by and filter at the same time? (drives me > nuts..!!!) > > This is what i tried: > > from django.shortcuts import render_to_response > from vidupdate.posts.models import Entry > from datetime import datetime  #( I even i

Re: UnicodeEncodeError in file uploads

2012-03-01 Thread Aljoša Mohorović
if you're using apache please check /etc/apache2/envvars and make sure that LANG is not C. if you uncomment system locale it should work as expected. ## Uncomment the following line to use the system default locale instead: . /etc/default/locale Aljosa Mohorovic -- You received this message bec

Re: How can I use order_by and filter at the same time? (drives me nuts..!!!)

2012-03-01 Thread Tony Kyriakides
Tom thanks again for helping :) On Thursday, March 1, 2012 3:21:41 PM UTC+2, Tony Kyriakides wrote: > > How can I use order_by and filter at the same time? (drives me > nuts..!!!) > > This is what i tried: > > from django.shortcuts import render_to_response > from vidupdate.posts.models import

django facebook api prob

2012-03-01 Thread dummyman dummyman
Hi guys, Sorry for troubling you. I am not able to make out how to use facebook social graph and other plugins in django. I am a newbie . I know the basics of django and i went thru facebook api key s in developers.facebook.com . It always points out " an error occured . please try again" . Can u

Re: UnicodeEncodeError in file uploads

2012-03-01 Thread andi-h
Hi, as you suggested I changed that settings. In addition I made a new MySQL database with an UTF8 collation and copied all the data to that one. No change, I still got the same problem :-( -- You received this message because you are subscribed to the Google Groups "Django users" group. T

Re: UnicodeEncodeError in file uploads

2012-03-01 Thread Aljoša Mohorović
although it's possible that this is not the problem, could you post additional details after you restart apache: 1) envvars content $ cat /etc/apache2/envvars 2) env settings for apache/site user (usually www-data): $ cat /etc/default/locale $ sudo su - www-data $ export Aljosa -- You received

Inline formset factory ignores 'exclude=' for foreign key field

2012-03-01 Thread gulrtosk
Hello list, through trial and error I discovered that it isn't required to pass the foreign key form field post data to the constructor of an inline form set. Django will fill it in automatically by looking at the primary key of the 'instance=' given. So I figured I might as well exclude the hi

Re: UnicodeEncodeError in file uploads

2012-03-01 Thread andi-h
1) $ cat /etc/apache2/envvars export APACHE_RUN_USER=www-data export APACHE_RUN_GROUP=www-data export APACHE_PID_FILE=/var/run/apache2.pid . /etc/default/locale export LANG # comments have been stripped 2) $ cat /etc/default/locale LANG="en_US.UTF-8" $ sudo su - www-data $ export export HOME='/var

Re: UnicodeEncodeError in file uploads

2012-03-01 Thread Aljoša Mohorović
On Thu, Mar 1, 2012 at 6:16 PM, andi-h wrote: > Would it help to change the locale settings on this Ubuntu server to > de_DE.UTF-8, too? don't know, but give it a shot. also, what's the output of: $ locale -a Aljosa -- You received this message because you are subscribed to the Google Groups

RE: Going crazy with WSGI

2012-03-01 Thread Sells, Fred
I paid my dues, here are a few working files from my system that may help you. Note that I use flex for my frontend and thus don't use all the django features as intended. Some of these files may be out of date with latest practice and current docs. So use them as you will. -- You received th

Re: django facebook api prob

2012-03-01 Thread yati sagade
I tried just now, and even I'm getting the same error. Perhaps you should ask this question on http://stackoverflow.com under the "facebook" tag - a team of FB engineers monitors this tag, and may offer more insight. Most probably, it's some bug/maintenance glitch. On Thu, Mar 1, 2012 at 9:01 PM,

how to use formwizard with parametrized urls

2012-03-01 Thread danoro
How do I use formwizard within parametrized URLs ? This is my urls.py from accounts.jobs.views.wizard import JobWizardView named_job_forms = ( ('narrative', JobNarrativeForm), ('location', JobLocationForm), ('dedication', JobDedicationForm), ('preferences', JobPreferencesForm),

null field issue

2012-03-01 Thread Marc Aymerich
I have a model with a filed like name = models.CharField(max_length=255, blank=True, null=True) With Django admin I've created some instances of that model without filling name field. Now I'm querying that model with name__isnull=True and the filter doesn't return any single object!! acctually

Re: Inline formset factory ignores 'exclude=' for foreign key field

2012-03-01 Thread gulrtosk
Right, I don't know whether this is a bug or done on purpose ... It looks like it was done on purpose so I'd be happy to hear the experts on this. I'm using Django 1.3. I hope I got this right. On line 752 of django.forms.models (development trunk), in the add_fields() method of BaseInlineFormS

Re: null field issue

2012-03-01 Thread jirka . vejrazka
Hi Marc, if I remember correctly (can't check now), the documentation clearly states that you should avoid using null=True on CharField unless you have a good reason. Your example is a textbook reason why is it recommended - having two distinct states for "empty string" (i.e. "blank" and "nu

Re: null field issue

2012-03-01 Thread Marc Aymerich
On Fri, Mar 2, 2012 at 12:15 AM, wrote: > Hi Marc, > >  if I remember correctly (can't check now), the documentation clearly states > that you should avoid using null=True on CharField unless you have a good > reason. Your example is a textbook reason why is it recommended - having two > disti

Re: Error on Tutorial Part 3 - https://docs.djangoproject.com/en/1.3/intro/tutorial03/

2012-03-01 Thread Python_Junkie
Just to get you past the error and display your data, I suggest hard coding the directory path in your view. The work your way backwards to the settings file try t = loader.get_template('C:\\Python27\\my_Djando_projects\\mysite\\My_Templates\\polls\\index.html'') You could also add a litt

Re: Error on Tutorial Part 3 - https://docs.djangoproject.com/en/1.3/intro/tutorial03/

2012-03-01 Thread Python_Junkie
On Wednesday, February 29, 2012 2:46:11 PM UTC-5, Django_for_SB wrote: > > Hello All, > > I'm going through the tutorial on djangoproject.com, and can't seem to > hurdle over this section that reads "Write views that actually do > something" > > Here's the code I have so far, which is directl

Re: How do i view json data returned from django

2012-03-01 Thread Bill Freeman
On Thu, Mar 1, 2012 at 8:29 AM, Shawn Milochik wrote: > On 03/01/2012 07:48 AM, Stanwin Siow wrote: >> >> Hello, >> >> I want to view the actual json data from django view, is there anyway i >> can do that before i parse it into jQuery? >> > > > Assuming that you have a dictionary named "return_da

how can I use Tabularinline outside of the admin ?

2012-03-01 Thread Lestak
class Interprise( Model ): id = AutoField( primary_key = True ) description = CharField( max_length = 50 ) def __unicode__(self): return self.description class Client_Interprise( Model ): id = AutoField( primary_key = True ) activitie = ForeignKey( Activitie ) inte

Re: django facebook api prob

2012-03-01 Thread dummyman dummyman
has anyone tried before and is it working ? please help me out if u have got it working On Fri, Mar 2, 2012 at 12:11 AM, yati sagade wrote: > I tried just now, and even I'm getting the same error. Perhaps you should > ask this question on http://stackoverflow.com under the "facebook" tag - > a t

Haystack and Xapian

2012-03-01 Thread coded kid
Hi guys, I want to use Django Haystack with Xapian on my django site for search function. After setting all the necessary settings. I went ahead to input: manage.py rebuild_index , after inputting 'y' I'm getting an error saying: No module named xapian_backend. I can see the xapian backend module

Seeking sample template code for iterating nested QuerySet

2012-03-01 Thread brycenesbitt
The documentation at: https://docs.djangoproject.com/en/1.3/topics/db/queries/ Speaks of "Spanning multi-valued relationships", with an QuerySet returning all Entries (and their Blogs) where the Blog matches a pattern. What does the view code look like? When I do something similar: facets= mo

Re: Seeking sample template code for iterating nested QuerySet

2012-03-01 Thread Matthias Kestenholz
On Fri, Mar 2, 2012 at 08:04, brycenesbitt wrote: > The documentation at: > https://docs.djangoproject.com/en/1.3/topics/db/queries/ > > Speaks of "Spanning multi-valued relationships", with an QuerySet > returning all Entries (and their Blogs) where the Blog matches a > pattern. > > What does the