Re: python/django

2012-07-20 Thread Trey Sullivan
Hey spanky, I'm not sure if I'm misunderstanding you but it sounds like you are trying to 'import python'. What you want to do is run python from your command line: $ python which then brings you to the interpreter which looks something like Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53)

Passing a dict to default page_not_found view

2012-07-20 Thread Masud Khokhar
Hi all, I am using the default 404 view that Django uses. I have created a custom 404.html page in my templates directory which automatically gets loaded. Is it possible for this page to load a python dictionary or do I need to raise http404 myself for that? In essence, what I am trying to do

Re: How to create a app inside a app

2012-07-20 Thread Russell Keith-Magee
On Sat, Jul 21, 2012 at 3:32 AM, Nicolas Ardison wrote: > Hello, i was reading the Django documentation, and i have the following > trouble that i'm not sure if django can solve it. I have a application > called "userArea" and i want to extend that app with more app

Re: Ignore apostrophes using django-postgresql

2012-07-20 Thread Russell Keith-Magee
To clarify - is your problem removing apostrophes, or having a search mechanism that can accommodate variations in punctuation? If the answer is the former, then the answer Ian gave is on the right track. However, if your actual problem is full-text search, then there are some better options. If

Re: Ignore apostrophes using django-postgresql

2012-07-20 Thread Ian Clelland
The queryset's extra() method can help you with that: MyModel.objects.extra(where=["replace(db_column_name, , '') = %s"], params=["rockn burger"]) (Be careful if you're typing that in manually -- there are lots of single-quotes in it) Ian On Fri, Jul 20, 2012 at 4:02 PM, Ada Pineda

Ignore apostrophes using django-postgresql

2012-07-20 Thread Ada Pineda
Hello I'm asking for your help because I need to do a query on a table that has a field that contains apostrophes, but I need to ignore them (apostrophes) when I'm doing the query. I have to save the data as it is, so I can't just take away those apostrophes before saving to the database. I

Re: How to create a app inside a app

2012-07-20 Thread Melvyn Sopacua
On 20-7-2012 21:32, Nicolas Ardison wrote: > [APP1] > > [subAPP1] > > [subAPP2] > Could i do something like this? anyone know where i can start reading about > this. Yes and no. You can, but within a project the last part of the python module path must be unique. So you cannot do:

Re: Android app that can post to a django server

2012-07-20 Thread Bill Freeman
On 7/17/12, gavin lyons wrote: > I have built the Django server as shown here > http://stackoverflow.com/questions/5871730/need-a-minimal-django-file-upload-example > > I have been trying to build an android app that will allow me to select > files on my phone and post them

How to create a app inside a app

2012-07-20 Thread Nicolas Ardison
Hello, i was reading the Django documentation, and i have the following trouble that i'm not sure if django can solve it. I have a application called "userArea" and i want to extend that app with more app isolated from the "main" apps. [DjangoProject] [APP1] [subAPP1] [subAPP2] [APP2]

sqlite to mysql loaddata not working (using natural keys)

2012-07-20 Thread dack
I'm trying to move django data from an sqlite database to a mysql database. I know I need to use natural keys, but it's still failing. Any ideas? Here's my procedure. The default database is sqlite, the mysql database is called "mysql" in settings.py. $*./manage.py dumpdata -a -n > data.json*

Re: How is the label_tag's attrs parameter supposed to specified?

2012-07-20 Thread Tomas Neme
{% for field in form %} {{ field.label }}{{ field }} {% endfor %} although I think the custom form class is not such a bad solution -- "The whole of Japan is pure invention. There is no such country, there are no such people" --Oscar Wilde |_|0|_| |_|_|0| |0|0|0| (\__/) (='.'=)This is

Extending a app with other app

2012-07-20 Thread Nicolas Ardison
Hello, i'm realtive new in django framework, and i can not find how to do the following thing: Does anybody knows how to create a "app" inside a "app"? I have read that i must create an other settings and url file inside the first "app" but i don't look crear how ? Anyone knows some open

How is the label_tag's attrs parameter supposed to specified?

2012-07-20 Thread doogster
For me, the BoundField.label_tag method's attrs parameter is one of those "what were the designers of Django thinking when they put it in" things. Rather than wondering, I'll ask here. The way to add HTML attributes to a label is to call label_tag with its attrs parameter set. label_tag is

Re: Cant override change_form.html in Django..Why??

2012-07-20 Thread cabrazil
Hayyan, I´m following the same book and got the same problem, how did you solve it? Thanks. Em quinta-feira, 4 de agosto de 2011 07h29min37s UTC-3, Hayyan Rafiq escreveu: > > Hi i read that > "By default, the admin application will look for a template in several > places, using the first >

Re: Can a method call inside save() display its return on template?

2012-07-20 Thread Andy McKay
> cursor.execute("SELECT > GetDirectionDescr("+str(nod_id1)+","+str(nod_id2)+") from sys.dual") Please note that code means that you might be open to SQL injection. You should be using the parameters for SQL, see:

Re: Boolean always returns False?

2012-07-20 Thread Sithembewena Lloyd Dube
Hi Tomas, Some guy created a user model instead of inheriting the base one. Yes, I'm importing the right one :) Seems I found the problem. The user seemed to be modified before it got to my check. Thanks. On Fri, Jul 20, 2012 at 5:44 PM, Tomas Neme wrote: > why do you

Re: Boolean always returns False?

2012-07-20 Thread Tomas Neme
why do you have your own User model? Are you sure you're logging in the right user and loading the right user instance? On Fri, Jul 20, 2012 at 12:37 PM, Sithembewena Lloyd Dube wrote: > Hi everyone, > > I have a user model in which i have a newsletter boolean field. When the

Boolean always returns False?

2012-07-20 Thread Sithembewena Lloyd Dube
Hi everyone, I have a user model in which i have a newsletter boolean field. When the user subscribes to a newsletter, this is checked. I am then instantiating that user and checking the property, so that if it is False (i.e. unchecked) = I can display a subscription box. In the model:

Re: Can a method call inside save() display its return on template?

2012-07-20 Thread Tomas Neme
You can still do self.something = foobar even if "something" is not a database Field. What I mean is, doing self.vdr_code = get_vdr_code() will save it for THIS INSTANCE and then you can use it in your template. If you really need this to be only at .save() (instead of, say, at __init__, because

phpBB3 to DjangoBB migration...

2012-07-20 Thread jens
Hi... Anyone who interest the migration from phpBB3 to DjangoBB should take a look at my project: https://github.com/jedie/django-phpBB3 There i worked on a migration script. What is django-phpBB3 ? --- """ Django-phpBB3 provides the database models of a existing

Django 1.4 debug_toolbar and htmltidy with checking html5 syntax

2012-07-20 Thread b1-
Hi to all! htmltidy check html 4 syntax errors and it shows me boring messages like Current page have following errors: PositionError or Warning line 5 column 5 Warning: proprietary attribute "charset" line 5 column 5 Warning: lacks "content" attribute because I'm use html5.

python/django

2012-07-20 Thread spanky
hi there, i can't seem to get my django working in my python promt. import python just renders an error not recognised, got a feeling i have to change the site path so i can import django into idle or python prompt, any suggesions would be grateful thanks. I've tried running the install but

django/python

2012-07-20 Thread spanky
Hi there peeps, I can't seem to get my python command to import django, i've gotta feeling i have to change the command line path in windows to python and somehow sync django and pyhon up. Any suggestions, i've tried what the site says but somethings off -- You received this message because

Re: Variable # of fields in a form

2012-07-20 Thread Daniel Roseman
On Friday, 20 July 2012 00:41:04 UTC-7, Alex Strickland wrote: > > Hi > > I am generating a page with a variable list of categories (shown in a > Bootstrap accordion control) displayed as checkboxes. So a user may > select any or all of the checkboxes to categorise an article. > > I did that

Variable # of fields in a form

2012-07-20 Thread Alex Strickland
Hi I am generating a page with a variable list of categories (shown in a Bootstrap accordion control) displayed as checkboxes. So a user may select any or all of the checkboxes to categorise an article. I did that just as a wireframe/demo. Trouble is I didn't think how that might work with

Re: Can a method call inside save() display its return on template?

2012-07-20 Thread Marilena Papageorgiou
get_direction_descr does something like this: def get_direction_descr(nod_id1, nod_id2): cursor = connection.cursor() cursor.execute("SELECT GetDirectionDescr("+str(nod_id1)+","+str(nod_id2)+") from sys.dual") result = cursor.fetchall() return result[0][0]