django fixtures error

2010-01-09 Thread CCC
hi, my code like this: class Profile(models.Model): GENDER = ((1,'male'),(2,'female')) gender = models.IntegerField(choices=GENDER,default=0) user = models.ForeignKey(User,unique=True) name = models.CharField(max_length=20,blank=True) job = models.CharField(max_length=50,blank=T

Re: newbie, how to load js in admin panel

2010-01-09 Thread Marc Aymerich
On Sat, Jan 9, 2010 at 6:37 AM, Marc Aymerich wrote: > Hi all! > > I'm trying to load this js > in one of the admin panel views. but seems that I'm unable to configure > django properly in order to be able media files access through my browser. > > I

DjangoUnicodeDecodeError

2010-01-09 Thread }--o
hi, could someone tell me how to handle this exception? I try to save some data, the data comes from a csv file read via codecs.open(file, 'r') DjangoUnicodeDecodeError: 'utf8' codec can't decode bytes in position 171-176: unsupported Unicode code range. You passed in 'B:\\Dokumentumok\\_Forditas

Re: multidb - partitioning

2010-01-09 Thread tom
Hi Adrian, thanks for your answer! The problem is, that i don't know how many projects will be created. Every user of the application can create and delete new projects. Maybe it's possible to execute some raw sql commands whenever a project is created or deleted (to create the new table and inser

Re: Seeking Django developer for contract work

2010-01-09 Thread dbakerweb
Thanks for this. On Jan 8, 5:47 pm, Nick Lo wrote: > > We have an RFP for 3 web-based prototype applications. We have posted > > to various freelance sites and I was wondering if anyone here could > > advise where to post to ensure we get a Django solution proposed. > > http://djangogigs.com/ --

Re: Seeking Django developer for contract work

2010-01-09 Thread dbakerweb
Thank-you. On Jan 8, 6:38 pm, Andy McKay wrote: > On 10-01-08 2:47 PM, Nick Lo wrote: > > >> We have an RFP for 3 web-based prototype applications. We have posted > >> to various freelance sites and I was wondering if anyone here could > >> advise where to post to ensure we get a Django solution

Re: Python based web reporting tool?

2010-01-09 Thread Mark Freeman
Thanks everyone. A lot of great suggestions here. It looks like reportlab is going to fit my needs nicely! On Jan 8, 7:38 am, tom wrote: > You could tryhttp://www.xhtml2pdf.com/ > > It's xhtml+css -> pdf converter. Then you should be able to use django- > templates and create from this templates

Creating UML diagram from my django models

2010-01-09 Thread Gaffar Durmaz
i wanna creating UML or ER diagram from my models.. is there any tools to creating automatically ? so i use Eclipse IDE.. maybe eclipse plugins or other.. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django

Re: autocomplete widget

2010-01-09 Thread esatterwh...@wi.rr.com
What I do for auto completers ( in general ) is point the widget at a URL that returns JSON objects and the parse the objects client side. For the user object your function might look like this: from django.utils import simplejson from django.contrib.auth.models import User from django.http import

Re: Register signal on all objects

2010-01-09 Thread Andy McKay
On 10-01-08 7:02 AM, Matias wrote: Is there any recommended way to attach a post_save signal to ALL models? When you create a signal you can optionally assign a model to listen too. Not doing that means it is called for all models. http://docs.djangoproject.com/en/dev/topics/signals/#connect

Re: Creating UML diagram from my django models

2010-01-09 Thread Tomasz Zieliński
On 9 Sty, 15:46, Gaffar Durmaz wrote: > i wanna creating UML or ER diagram from my models.. > is there any tools to creating automatically ? > so i use Eclipse IDE.. maybe eclipse plugins or other.. I'm not sure if this would satisfy you: http://code.google.com/p/django-command-extensions/wiki/G

Re: Handling Vector/Array Data in Forms

2010-01-09 Thread Tomasz Zieliński
On 9 Sty, 01:23, datta wrote: > I am using Django for a scientific applicaition. If I have to > transport a vector/array 'to' a form, dismantle it and display the > relevant information, it is easy. But how I capture vectors/array > datatypes 'from' the HTML forms (submitted by the user) in the >

Change charset of HttpResponse

2010-01-09 Thread Benjamin W.
Hi there, how can I change the charset of an HttpRespone? I tried something like this: response = HttpResponse(mimetype='text/csv') response['Content-Disposition'] = 'attachment; filename=test.csv' response['charset'] = 'ISO-8859-1' But this doesn't work - I still get an UTF-8 encode

Re: handle astronomically high number of users via the new BigIntegerField and contrib.auth.user

2010-01-09 Thread creecode
Hello GBS, You might be able to accomplish this with the use of signals.post_syncdb. An adaptation the technique discussed here < http://onebiglibrary.net/story/automatically-create-mysql-fulltext-index-with-django-syncdb > to alter your column might do the trick. On Jan 8, 10:24 pm, G B Smith

Re: DjangoUnicodeDecodeError

2010-01-09 Thread Karen Tracey
On Sat, Jan 9, 2010 at 7:34 AM, }--o wrote: > hi, > > could someone tell me how to handle this exception? > I try to save some data, the data comes from a csv file read via > codecs.open(file, 'r') > Since you haven't specified an encoding to codecs.open, you'll get a plain file object that does

Re: handle astronomically high number of users via the new BigIntegerField and contrib.auth.user

2010-01-09 Thread G B Smith
Thanks, that is a good resource. So this is what I am going to do : - -- modify the contrib.auth.models.user to explicitly include id = models.BigIntegerField(primary_key=True) -- modify the contrib.auth.models.user.id field in the database using creecode's method above or via the mysql shell or ph

Re: Change charset of HttpResponse

2010-01-09 Thread Karen Tracey
On Sat, Jan 9, 2010 at 11:26 AM, Benjamin W. wrote: > how can I change the charset of an HttpRespone? > I tried something like this: > >response = HttpResponse(mimetype='text/csv') >response['Content-Disposition'] = 'attachment; filename=test.csv' >response['charset'] = 'ISO-8859-1' >

Re: Change charset of HttpResponse

2010-01-09 Thread Benjamin W.
Thanks Karen, I'll take a look at this. On Jan 9, 6:03 pm, Karen Tracey wrote: > On Sat, Jan 9, 2010 at 11:26 AM, Benjamin W. wrote: > > how can I change the charset of an HttpRespone? > > I tried something like this: > > >    response = HttpResponse(mimetype='text/csv') > >    response['Content

Re: autocomplete widget

2010-01-09 Thread nameless
Thank you it's very useful. Now I need to create a new widget in django but I don't know where is the documentation about widget. On Jan 9, 4:42 pm, "esatterwh...@wi.rr.com" wrote: > What I do for auto completers ( in general ) is point the widget at a > URL that returns JSON objects and the par

Abstract model classes and foreign keys

2010-01-09 Thread Frédéric Burlet
Hi, I'm facing an issue when modeling a couple of tables by using abstract classes. Here is an extract of my model: class TypeConstant(models.Model): code = models.CharField(max_length = 8, unique = True) description = models.CharField(max_length = 32) class Meta: abstract

Reverse filtering via ManytoManyField

2010-01-09 Thread janedenone
I defined two models (Tag and Page), where the Page model links to the Tag model: tags = models.ManyToManyField(Tag, blank=True) For a single tag, I can refer to the pages linked to that tag like so: for page in tag.page_set: ... results = tag.page_set.count() But I cannot find a way to obt

Viewing content as a list

2010-01-09 Thread spike
I'm new to Python and Django. I'm slowly learning by book so bare with me. Thanks. The book I'm reading "Django 1.0 Website Development" has readers build a social bookmarking website. Everything has gone well but I want to make a change. I want the bookmarks that are submitted to be displayed wi

Re: request.LANGUAGE_CODE-sensitive choices in forms.ChoiceField?

2010-01-09 Thread Andreas Pfrengle
On 7 Jan., 18:17, Tom Evans wrote: > 2010/1/7 Andreas Pfrengle : > > > However I'm wondering how I would transform this concept on Formsets. > > I think I would somehow need to expand already the formsets __init__ > > to accept the additional 'request' parameter (otherwise I get "__init__ > > () g

{% if ... in ... %} template tags not working

2010-01-09 Thread kotpierdzibonk
Hi, I copied the below code from the django documentation (http:// docs.djangoproject.com/en/dev/ref/templates/builtins/), tried it out, and it is not working for me. Can anyone think of a reason why? {% if "bc" in "abcdef" %} This appears since "bc" is a substring of "abcdef" {% endif %} I g

Re: {% if ... in ... %} template tags not working

2010-01-09 Thread Frédéric Burlet
Which version of django are you running ? The in operator in the if statement only works in the development version of django not with 1.1 or 1.0 series. (see warning on top of the page) Frédéric Burlet. On Saturday 09 January 2010 21:22:28 kotpierdzibonk wrote: > Hi, > > I copied the below

Re: handle astronomically high number of users via the new BigIntegerField and contrib.auth.user

2010-01-09 Thread Eric Chamberlain
On Jan 9, 2010, at 8:59 AM, G B Smith wrote: > Thanks, that is a good resource. So this is what I am going to do : - > -- modify the contrib.auth.models.user to explicitly include id = > models.BigIntegerField(primary_key=True) > -- modify the contrib.auth.models.user.id field in the database usi

Re: Register signal on all objects

2010-01-09 Thread Matias
El 09/01/10 17:12, Andy McKay escribió: On 10-01-08 7:02 AM, Matias wrote: Is there any recommended way to attach a post_save signal to ALL models? When you create a signal you can optionally assign a model to listen too. Not doing that means it is called for all models. http://docs.djangopro

Mysterious transactions wrapping views without middleware.

2010-01-09 Thread apramanik
Hey all, I am seeing transactions wrapping my views without using the 'django.middleware.transaction.TransactionMiddleware'. I don't have any @transaction decorators around my view. I also tried setting DISABLE_TRANSACTION_MANAGEMENT to True as per: http://docs.djangoproject.com/en/1.1/topics/db/t

Re: Mysterious transactions wrapping views without middleware.

2010-01-09 Thread Karen Tracey
On Sat, Jan 9, 2010 at 7:06 PM, apramanik wrote: > Hey all, > > I am seeing transactions wrapping my views without using the > 'django.middleware.transaction.TransactionMiddleware'. I don't have > any @transaction decorators around my view. I also tried setting > DISABLE_TRANSACTION_MANAGEMENT to

Re: {% if ... in ... %} template tags not working

2010-01-09 Thread kotpierdzibonk
Thx for pointing this out to me! Skim reading took its toll :-) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubs

Re: why does if statement fail with

2010-01-09 Thread neridaj
Template error: In template /Users/username/django-sites/username.com/public/templates/ tagging/tag_list.html, error at line 17 'if' statement improperly formatted 7 : {{ object.name }} 8 : 9 : 10 : {% endfor %} 11 : 12 : 13 : {% if page_obj.has

Re: multidb - partitioning

2010-01-09 Thread Robert S
Hello, I'm new to django, so bear with me if this is a silly approach but, could you assign the project name to db_table at run time? Something like ... models.py ... # app_name and project_code may need to be declared with global scope ... APP_NAME = 'app_name' # might be optional global pro

Re: Mysterious transactions wrapping views without middleware.

2010-01-09 Thread apramanik
Thanks! That partially fixes my problem. I wrapped a function with commit_on_success and it doesn't rollback the changes if it throws an IntegrityError coming from PostgresSQL: @transaction.commit_on_success def add_destination( self, placemark, trip, user, \ descript

Re: why does if statement fail with

2010-01-09 Thread Karen Tracey
On Sat, Jan 9, 2010 at 8:16 PM, neridaj wrote: > Template error: > In template /Users/username/django-sites/username.com/public/templates/ > tagging/tag_list.html, > error at line 17 > 'if' statement improperly formatted > > > [snip

print statements don't show up

2010-01-09 Thread aditya
Hi, Has anyone run into issues with print statements in Django? I was curious about the core Django code, so I was poking around. My way of discovering how things work is to run some print statements and see their output...But my print statements aren't being printed to the Terminal. I've got the r

Re: print statements don't show up

2010-01-09 Thread Ishwor Gurung
Hi Aditya, 2010/1/10 aditya : > Hi, > Has anyone run into issues with print statements in Django? I was > curious about the core Django code, so I was poking around. My way of > discovering how things work is to run some print statements and see > their output...But my print statements aren't bein

Re: handle astronomically high number of users via the new BigIntegerField and contrib.auth.user

2010-01-09 Thread G B Smith
Eric, could you explain how this UUID implementation was achieved? Django doesn't have a built-in UUID, so I can only guess that you used a varchar field within Django. ? On Jan 10, 2:29 am, Eric Chamberlain wrote: > On Jan 9, 2010, at 8:59 AM, G B Smith wrote: > > > Thanks, that is a good resour

Re: print statements don't show up

2010-01-09 Thread aditya
Ishwor, The print statement is actually in a core Django file. I'm trying to get familiar with Django's source code. Unfortunately my print statements dont seem to run. On Jan 9, 8:10 pm, Ishwor Gurung wrote: > Hi Aditya, > > 2010/1/10 aditya : > > > Hi, > > Has anyone run into issues with print

Re: print statements don't show up

2010-01-09 Thread aditya
Ok, I figured it out...it turns out urls.py doesn't get executed by runserver until I actually try a url. All I needed to do was point my browser to localhost:8000, and everything worked as expected : Aditya On Jan 9, 8:10 pm, Ishwor Gurung wrote: > Hi Aditya, > > 2010/1/10 aditya : > > > Hi, >

Re: print statements don't show up

2010-01-09 Thread Ishwor Gurung
2010/1/10 aditya : > Ishwor, > The print statement is actually in a core Django file. I'm trying to > get familiar with Django's source code. Unfortunately my print > statements dont seem to run. You want to make sure the monkey patching business is done correctly then. Start with the traceback an

Re: print statements don't show up

2010-01-09 Thread Ishwor Gurung
2010/1/10 aditya : > Ok, I figured it out...it turns out urls.py doesn't get executed by > runserver until I actually try a url. All I needed to do was point my > browser to localhost:8000, and everything worked as expected : Glad you figured it out :) [...] -- Regards Ishwor Gurung Key id:0xa98d

Re: Register signal on all objects

2010-01-09 Thread Ishwor Gurung
2010/1/10 Matias : [...] > Thanks, this will do the trick... Curious. Why doesn't overriding save(..) do for you? -- Regards Ishwor Gurung Key id:0xa98db35e Key fingerprint:FBEF 0D69 6DE1 C72B A5A8 35FE 5A9B F3BB 4E5E 17B5 -- You received this message because you are subscribed to the Google G

context processor var empty

2010-01-09 Thread neridaj
I'm trying to use a context processor to make all of my blog entry titles available for an ajax autocomplete search box but for some reason the var returned from the context processor is empty. from blog.models import Entry # search/context_processors.py def search(request): data = Entry

Re: Django Tutorial 1.1: Viewing SQLite3 tables

2010-01-09 Thread Jay Godse
If you want to get comfortable with SQLite, try some of the tutorials at: http://www.squidoo.com/sqlitehammer http://www.squidoo.com/sqlitetutorial http://www.squidoo.com/sqliteprogramming There are also videos at http://www.youtube.com/user/Jaynonymous1 which you may find useful. Cheers, J