Re: how to convert {{candidate.vote_set.filter(vote='TU').count()}} in template syntax

2008-03-27 Thread laspal
Thanks a lot. Its works On Mar 27, 8:33 pm, Peter Rowell <[EMAIL PROTECTED]> wrote: > Specifically, you might look athttp://www.djangosnippets.org/snippets/9/. > > This allows you to do something like: > > {% expr candidate.vote_set.filter(vote='TU').count() as count %} > > and now {{coun

Re: extra arguments in generic views

2008-03-27 Thread Erik Vorhes
That's probably a discussion for the django-developers list, http://groups.google.com/group/django-developers . Unless those changes happen, you're likely best off creating multiple dictionaries or extending them in the individual url dict. On Thu, Mar 27, 2008 at 12:49 PM, Michael <[EMAIL PROTEC

Re: How are you storing binary data in db

2008-03-27 Thread Rishabh Manocha
I think he meant recipes in that are there any recipes to accomplish this (storing binary data to the DB). Unless I'm getting this completely wrong, he was not talking about cooking recipes :). I would be interested in a solution for this too. There are cases where apps running as the apache/web

Re: Counting over a ManyToManyField of a ManyToManyField, a question of style.

2008-03-27 Thread [EMAIL PROTECTED]
Yes, instead of returning all the records and counting them in python you would be using your databases COUNT() funciton. On Mar 27, 10:33 pm, Rodrigo Culagovski <[EMAIL PROTECTED]> wrote: > On Mar 27, 3:43 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > Well, books can be redefined as

Re: Counting over a ManyToManyField of a ManyToManyField, a question of style.

2008-03-27 Thread Rodrigo Culagovski
On Mar 27, 3:43 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Well, books can be redefined as: > > def books(self): > progs = self.programs.all() > return sum([prog.publications.all().filter(type=u'Book').count() > for prog in progs]) > > and likewise for the other methods. Nice.

Re: Using ModelForm...not populating my choices

2008-03-27 Thread James Bennett
On Thu, Mar 27, 2008 at 9:49 PM, Greg <[EMAIL PROTECTED]> wrote: > class SurveyForm(ModelForm): > experience = forms.ChoiceField(widget=forms.RadioSelect) A ChoiceField requires you to pass in a set of choices for it to use. -- "Bureaucrat Conrad, you are technically correct -- the best k

Re: Using ModelForm...not populating my choices

2008-03-27 Thread Greg
Brian, I tried this but still doesn't work: // class SurveyForm(ModelForm): experience = forms.ChoiceField(widget=forms.RadioSelect) class Meta: model = Survey // Nothing gets displayed in the template On Mar 27, 9:32 pm, "Brian Armstrong" <[EMAIL PROTECTED]> wrote: > On Thu,

Re: css problem

2008-03-27 Thread [EMAIL PROTECTED]
http://www.djangoproject.com/documentation/static_files/ On Mar 27, 9:28 pm, "Brian Armstrong" <[EMAIL PROTECTED]> wrote: > Greg, check out settings.py. CSS counts as media -- it's a static > file you want to serve up to the outside. The exact details of how > this works depend on how the serv

Re: Using ModelForm...not populating my choices

2008-03-27 Thread Brian Armstrong
On Thu, Mar 27, 2008 at 9:27 PM, Greg <[EMAIL PROTECTED]> wrote: > > Hello, > My experience field by default gets displayed as a drop > down..everything works fine when it is displayed this way. However I > want the field to be displayed in my template as Radio Buttons. So I > added the lin

Re: css problem

2008-03-27 Thread Brian Armstrong
Greg, check out settings.py. CSS counts as media -- it's a static file you want to serve up to the outside. The exact details of how this works depend on how the server you're on is set up, but essentially you have two options. You go into settings.py and fill in values for media_root and medi

IntegrityError: duplicate key violates unique constraint

2008-03-27 Thread makebelieve
I recently made a new production database for a site using the following methods: 1. Ran syncdb to create all tables needed for the project 2. Used data transfer in PG Navicat to bring in old data I need Now when I try to create a new object in the admin interface I keep getting: IntegrityErr

Using ModelForm...not populating my choices

2008-03-27 Thread Greg
Hello, My experience field by default gets displayed as a drop down..everything works fine when it is displayed this way. However I want the field to be displayed in my template as Radio Buttons. So I added the line ' experience = forms.CharField(widget=forms.RadioSelect) ' to my ModelClass. How

Re: math in django

2008-03-27 Thread James Bennett
On Thu, Mar 27, 2008 at 9:19 PM, Dan Ellis <[EMAIL PROTECTED]> wrote: > It's not possible to use aggregate functions in any Django release, > but IIRC it is something that has been added in the queryset-refactor > branch. Be careful how you say that: you're free to write any piece of SQL you l

Re: math in django

2008-03-27 Thread Dan Ellis
It's not possible to use aggregate functions in any Django release, but IIRC it is something that has been added in the queryset-refactor branch. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Re: How are you storing binary data in db

2008-03-27 Thread Dan Ellis
On Mar 27, 9:05 pm, Mike H <[EMAIL PROTECTED]> wrote: > Reading large > chunks of file data from a db just wastes db resources A recipe is unlikely to be a large chunk of file data. Pictures of food, sure, don't store those in the DB. Storing the text in the DB also means you can make use of its

css problem

2008-03-27 Thread Greg Lindstrom
Hello List! Things clicked tonight! I visited with Jacob at PyCon and decided that it was time to really learn Django. I have gone through most of the Django book (online) and the Head First XHTML with CSS books. Tonight, everything came together and I've written my first web pages using Django

Re: User created in postgresql is not found when Adding Data to the API.

2008-03-27 Thread Chirolo
Hi again. Thank you Thomas for your help. I think that I passed the role and authentication problem, but now I have another problem. Here is what I have done wrong. When I created my database named 'iFriendsDB' in postgresql I created it as super user. and then within the iFriendsDB created the us

Re: Customized ChoiceField doesn't save properly with newforms-admin

2008-03-27 Thread Julien
Thanks for the pointer! I finally ended up defining my own field, which allowed me more flexibility: class CodeCategoryChoiceField(ChoiceField): def clean(self, value): return CodeCategory.objects.get(pk=value) Thanks! Julien On Mar 27, 8:53 pm, peschler <[EMAIL PROTECTED]> wrote:

javascript in django

2008-03-27 Thread julichrist
anyone know how to put javascript into django templete? let's say i have a field "color" in the models.py, i want django templete shows a color picker (using javascript) in the templete, so user can pick the color. -- View this message in context: http://www.nabble.com/javascript-in-django-tp16

math in django

2008-03-27 Thread cmccomas80
i have a system i created a while back in php that allows fans to come to the site after a soccer match and rate each player on a scale of 1-10 based on their performance. it displays the player's average for every, the entire season, etc. the way that it's structured now is using a mysql databas

Re: django.newforms and AJAX

2008-03-27 Thread David Cramer
I'm not too familiar with .NET, but with middleware and decorators it would be possible, there would just need to be some awareness. One thing we had done on Curse, was wrap the jQuery base AJAX call, and our login_required methods. If a JS method was sent in (all JS methods were to /js/ or had js

Re: User profile problem

2008-03-27 Thread Karen Tracey
On Thu, Mar 27, 2008 at 6:45 PM, Francisco Benavides < [EMAIL PROTECTED]> wrote: > > Hi, > > I am in the process of adding more information to the user, managed > via django.contrib.auth. I am getting an error in the admin > interface, when trying to add a profile to a given user. First time > th

Re: blog displays raw html

2008-03-27 Thread Justin Lilly
I also feel obligated to mention that you don't have to use HTML. If you prefer some sort of markup, look here: http://code.djangoproject.com/wiki/UsingMarkup -justin On Thu, Mar 27, 2008 at 7:55 PM, Justin Lilly <[EMAIL PROTECTED]> wrote: > You're being affected by a relatively new feature: Aut

Re: blog displays raw html

2008-03-27 Thread Justin Lilly
You're being affected by a relatively new feature: Autoescaping HTML. You can find more information at this link: http://www.djangoproject.com/documentation/templates/#automatic-html-escaping -justin On Thu, Mar 27, 2008 at 7:32 PM, Floyd Arguello <[EMAIL PROTECTED]> wrote: > > Hi djangoers, >

Re: Postgres and Fixtures

2008-03-27 Thread SlowLearner
On Mar 27, 3:23 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > > It will run automatically if you are using trunk Django, but not if > you are using the 0.96 release. If you are using 0.96, and can't > update to trunk, you will need to run ./manage.py sequencereset after > loading a fixtur

blog displays raw html

2008-03-27 Thread Floyd Arguello
Hi djangoers, I'm learning Django by setting up a blog per instructions here (combined with code from djangoproject.com svn): http://www.rossp.org/blog/2006/jun/08/django-blog-redux/ Most things work, except I enter raw html when posting the blog through the admin interface, and the raw html

Re: Problems with Apache + mod_python

2008-03-27 Thread Floyd Arguello
Slayer_X wrote: > # vim /etc/httpd/conf/httpd.conf > > PythonPath "['/usr/lib/python2.4/site-packages/django'] + > sys.path" > SetHandler python-program > PythonHandler django.core.handlers.modpython > PythonDebug On > SetEnv DJANGO_SETTINGS_MODULE ripsol.settings > Try this

Re: Problems with Apache + mod_python

2008-03-27 Thread Graham Dumpleton
On Mar 28, 9:32 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Thu, Mar 27, 2008 at 3:13 PM, Michael Wieher <[EMAIL PROTECTED]> > wrote: > > > but this is the error message. > > > >ImportError: No module named django > > > shouldn't that mean that python can't find the django module? regardle

User profile problem

2008-03-27 Thread Francisco Benavides
Hi, I am in the process of adding more information to the user, managed via django.contrib.auth. I am getting an error in the admin interface, when trying to add a profile to a given user. First time the interface crashes, but the profile gets added, so the next time I try to add the same profil

Re: CacheMiddleware issue

2008-03-27 Thread Mike Axiak
Brandon, It appears that the Cache Middleware does not read the content from the file before caching the response [1]. I'm not sure if this is a bug or not...though I'd probably lean towards it being a bug. (Do we not cache middleware to *always* evaluate a file object before caching the response

Re: Configuring Apache and mod_python for Django

2008-03-27 Thread Graham Dumpleton
Now for some more comments. On Mar 28, 2:01 am, Peter Rowell <[EMAIL PROTECTED]> wrote: > In another thread (http://groups.google.com/group/django-users/ > browse_thread/thread/962cfdf7609839eb/), > > On Mar 23, 11:48 pm, Graham Dumpleton <[EMAIL PROTECTED]> > wrote: > > > For example, using pref

Re: Problems with Apache + mod_python

2008-03-27 Thread Karen Tracey
On Thu, Mar 27, 2008 at 3:13 PM, Michael Wieher <[EMAIL PROTECTED]> wrote: > but this is the error message. > > >ImportError: No module named django > > shouldn't that mean that python can't find the django module? regardless > of if he has further issues, modules within modules or anything, if p

Re: CacheMiddleware issue

2008-03-27 Thread bfrederi
I appreciate the help Rajesh, I haven't added any special settings for the cachemiddleware, I just placed 'django.middleware.cache.CacheMiddleware' in my middleware classes and that's it. As far as the low-level caching that I have written into my code using the "from django.core.cache import cac

Re: customize forms

2008-03-27 Thread Rocio Figueroa
2008/3/26, Juanjo Conti <[EMAIL PROTECTED]>: > form_for_instance > > Your example will be: > > > def edit(request, u_id): > usuario = Usuario.objects.get(id=u_id) > > form = form_for_instance(usuario)() > > return render_to_response('usuario/usuarioEdit.html', {'form':form}) hi

Re: Using database tables without creating models for each table

2008-03-27 Thread Rajesh Dhawan
Hi Lavanya, > In the project I am currently working on, we create hundred's of > tables during runtime. Have you considered re-architecting your application in a way that doesn't require creation of tables at runtime? I am curious of your usecase scenarios that resulted in this design choice. >

Re: How are you storing binary data in db

2008-03-27 Thread Mike H
On 27 Mar 2008, at 19:31, shabda wrote: > > Considering that BlobField is not supported, what are you using to > store binary data. Recipes, snippets .. In all cases, whether it's a binary file uploaded by the user or a binary file generated by the application, I store it in a file on disk a

Re: Does __unicode__() work in 0.96.1?

2008-03-27 Thread Legioneer
> > > The unicode branch was merged after the 0.96 release, thus 9.96.1 does not > > include its benefits... > > I meant 0.96.1 of course. thanks a lot --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" g

Re: How to check the SQL that the Django ORM is executing?

2008-03-27 Thread Rajesh Dhawan
Hi, On Mar 27, 4:01 pm, qwerty <[EMAIL PROTECTED]> wrote: > Hi all, > > I want so see the SQL that the Django ORM is executing behind the > scenes. I know that SQLObject has this but I wanted to see if there is > some similar functionality in Django. Is it? See: http://www.djangoproject.com/doc

Re: CacheMiddleware issue

2008-03-27 Thread Rajesh Dhawan
Hi Brandon, > > I would paste in some code examples, but this project is several > hundred lines long, and there are several incidences where I open > files that is conflicting with the cache middleware. Not knowing how you have your cache setup (anonymous, all views, low- level), it's hard to t

Re: How to check the SQL that the Django ORM is executing?

2008-03-27 Thread [EMAIL PROTECTED]
It depends, thats better if you want to actively see what queries are being run, this is better if you want to see what SQL a specific query executes. On Mar 27, 3:24 pm, shabda <[EMAIL PROTECTED]> wrote: > wouldn't getting the queries from connection.queries be abetter > approach? > > On Mar 28,

Re: Reports

2008-03-27 Thread Justin Lilly
Django handles it as well as Python. Here are some resources I would suggest checking out: report lab: http://www.reportlab.org/index.html google charts: http://toys.jacobian.org/hg/googlecharts/ and http://toys.jacobian.org/hg/googlecharts/raw-file/tip/docs/examples.html(examples) django-gra

Re: How are you storing binary data in db

2008-03-27 Thread Dan Ellis
On Mar 27, 7:31 pm, shabda <[EMAIL PROTECTED]> wrote: > Considering that BlobField is not supported, what are you using to > store binary data. Recipes, snippets .. But these aren't binary data; they're text, so why not use a TextField? --~--~-~--~~~---~--~~ You

Re: How to check the SQL that the Django ORM is executing?

2008-03-27 Thread shabda
wouldn't getting the queries from connection.queries be abetter approach? On Mar 28, 1:15 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > http://www.djangoproject.com/documentation/faq/#how-can-i-see-the-raw... > > or > > you can make a function like this: > > In [19]: def show_sql(query): >

CacheMiddleware issue

2008-03-27 Thread bfrederi
When I enable CacheMiddleware for site caching (using memcached as my cache backend), I notice that if the page requires opening a file on the file system or over http, that opening the file won't work, and causes problems, the most typical being "ValueError: I/O operation on closed file". I also

Re: How to check the SQL that the Django ORM is executing?

2008-03-27 Thread [EMAIL PROTECTED]
http://www.djangoproject.com/documentation/faq/#how-can-i-see-the-raw-sql-queries-django-is-running or you can make a function like this: In [19]: def show_sql(query): : clauses = query._get_sql_clause() : return 'SELECT %s %s' % (', '.join(clauses[0]), clauses[1])

view/template "composition"

2008-03-27 Thread dave
I'm pretty new to django and I was wondering if it is possible to do an %include/ssi tag that can hook into the URLconf and views. Looking at the source it doesn't seem possible. I've written a bunch of views and now I'd like to mash them together. I know I can use template inheritance to define

Using database tables without creating models for each table

2008-03-27 Thread Lavanya
Hi, In the project I am currently working on, we create hundred's of tables during runtime. Django book says every table requires a model class to be created to access the table. Unfortunately, this solution doesn't fit our project. Creating model class for each and every db table is mandatory?

how to force char field instead varchar to be created

2008-03-27 Thread eat
I want to have char fields (db storage reason) instead of varchar how to force that in the models.py ?? django seems to create only varchar thx --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Reports

2008-03-27 Thread Percy Gonzales
Hello, as Django's handling of the issue: * Generate reports PDF * Graphics statistics (bars, cakes ,...) Thanks Percy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

How to check the SQL that the Django ORM is executing?

2008-03-27 Thread qwerty
Hi all, I want so see the SQL that the Django ORM is executing behind the scenes. I know that SQLObject has this but I wanted to see if there is some similar functionality in Django. Is it? Thanks, Angel --~--~-~--~~~---~--~~ You received this message because you

Re: Configuring Apache and mod_python for Django

2008-03-27 Thread Graham Dumpleton
Also see what I said towards end of: http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango as to why. I might clarify later and address your specific questions when have time. Graham Peter Rowell wrote: > In another thread (http://groups.google.com/group/django-users/ > browse_thread/

Re: Counting over a ManyToManyField of a ManyToManyField, a question of style.

2008-03-27 Thread [EMAIL PROTECTED]
Well, books can be redefined as: def books(self): progs = self.programs.all() return sum([prog.publications.all().filter(type=u'Book').count() for prog in progs]) and likewise for the other methods. On Mar 27, 1:27 pm, Rodrigo Culagovski <[EMAIL PROTECTED]> wrote: > My application has t

How are you storing binary data in db

2008-03-27 Thread shabda
Considering that BlobField is not supported, what are you using to store binary data. Recipes, snippets .. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dja

Re: 台中模特兒一夜情

2008-03-27 Thread Michael Wieher
I doubt it 2008/3/27 辣妹 <[EMAIL PROTECTED]>: > 台中縣市兼職小姐外送 > > 女大學生 專櫃小姐 幼教師 護士 模特兒 會計各行各業兼職皆有 > > 精挑細選.年紀都約在18~23歲 (但未成年的是不做的喔!) > > 由於都是兼職的台灣小姐.所以大都不能太晚.所以想找的朋友請先約好 > > 台中縣市各賓館或汽車旅館皆可送達 > > 價格優惠~安全實在 > > 錢小姐 0987-630-487 > > > --~--~-~--~~~---~--~~ You receiv

台中模特兒一夜情

2008-03-27 Thread 辣妹
台中縣市兼職小姐外送 女大學生 專櫃小姐 幼教師 護士 模特兒 會計各行各業兼職皆有 精挑細選.年紀都約在18~23歲 (但未成年的是不做的喔!) 由於都是兼職的台灣小姐.所以大都不能太晚.所以想找的朋友請先約好 台中縣市各賓館或汽車旅館皆可送達 價格優惠~安全實在 錢小姐 0987-630-487 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django u

Re: Problems with Apache + mod_python

2008-03-27 Thread Michael Wieher
but this is the error message. >ImportError: No module named django shouldn't that mean that python can't find the django module? regardless of if he has further issues, modules within modules or anything, if python can't find the initial django module that means a bad install? --~--~-

Re: Problems with Apache + mod_python

2008-03-27 Thread Evert Rol
> If your python interpreter can't import django, you installed it > wrong. > C'est tres facil. One of the previous post in this thread mentions the development server works fine, so django can be imported from the shell apparently. But testing that will never hurt; there may happen to be a

Counting over a ManyToManyField of a ManyToManyField, a question of style.

2008-03-27 Thread Rodrigo Culagovski
My application has the following models: Researcher, Program and Publication. Each Researcher has 0 or more Programs as a ManyToManyField, and each Program has 0 or more Publications also as a ManyToManyField. Publication has a 'type' attribute which is a CharField, and has choices: Book, Article

Re: Filter ManyToMany options by Site in adming interface

2008-03-27 Thread Josh
No no, the model will be served on all sites. Individual instances will only be on a single site. So each site will have it's own set of neighborhoods and locations. It's also possible that a neighborhood or location will be on multiple sites. The problem is that when dealing with a location in t

Re: Problems with Apache + mod_python

2008-03-27 Thread Michael Wieher
Look. If your python interpreter can't import django, you installed it wrong. C'est tres facil. the django module should be installed to the system and should be importable from anywhere. Setting your PYTHON_PATH is, at best, a hack, and at worst, will cause massive problems (as hacks do) when an

Re: extra arguments in generic views

2008-03-27 Thread Michael
I guess I didn't explain myself well enough. 90% of the views on my site don't need anything special being passed to a wrapper view function or anything. In my "info_dict" I typically define only the items that stretch across the generic views of the entire model, typically queryset and date_fiel

Re: django.newforms and AJAX

2008-03-27 Thread Darien García
I think it's possible, using python decorators and django midleware, implement something like AJAX.NET in the way of sending python objects to the page via JSON using a python-JSON translator. And I'm also looking forward for the tool. --~--~-~--~~~---~--~~ You re

Hi

2008-03-27 Thread Darien García
I think it's possible, using python decorators and django midleware, implement something like AJAX.NET in the way of sending python objects to the page via JSON using a python-JSON translator. And I'm also looking forward for the tool. --~--~-~--~~~---~--~~ You rec

Re: Problems with Apache + mod_python

2008-03-27 Thread Slayer_X
Hi, sorry for the delay On Mar 16, 2:45 pm, prz <[EMAIL PROTECTED]> wrote: > are you sure you have django directory _IN_ > > /usr/lib/python2.4/site-packages/django Yes, I have the django directory > or is it only > > /usr/lib/python2.4/site-packages/django/core/handlers/modpython.py -- I have

Re: some database error?: not sure...

2008-03-27 Thread Evert Rol
>> Thanks, Evert! I could check now that the table is correct - and, >> with >> some experimenting, I found the mistake I had made too: I had, in >> models.py, in class Admin, entered "ordering = ('nummer')" instead of >> "ordering = ['nummer']". >> >> Perhaps somebody can explain why list_displ

Re: some database error?: not sure...

2008-03-27 Thread Evert Rol
> Thanks, Evert! I could check now that the table is correct - and, with > some experimenting, I found the mistake I had made too: I had, in > models.py, in class Admin, entered "ordering = ('nummer')" instead of > "ordering = ['nummer']". > > Perhaps somebody can explain why list_display and list

Re: some database error?: not sure...

2008-03-27 Thread bavel
Thanks, Evert! I could check now that the table is correct - and, with some experimenting, I found the mistake I had made too: I had, in models.py, in class Admin, entered "ordering = ('nummer')" instead of "ordering = ['nummer']". Perhaps somebody can explain why list_display and list_filter req

Re: Does __unicode__() work in 0.96.1?

2008-03-27 Thread Karen Tracey
On Mar 27, 12:15 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > The unicode branch was merged after the 0.96 release, thus 9.96.1 does not > include its benefits... I meant 0.96.1 of course. --~--~-~--~~~---~--~~ You received this message because you are subscribe

Re: Does __unicode__() work in 0.96.1?

2008-03-27 Thread Karen Tracey
On Thu, Mar 27, 2008 at 10:47 AM, Legioneer <[EMAIL PROTECTED]> wrote: > > Hi All, > > I use django 0.96.1 on CentOS 4 box (python 2.3.4). When use __str__() > in model definitions everything is fine, but when change it to > __unicode__() I don't see it working (e.g. in admin interface there is >

Re: some database error?: not sure...

2008-03-27 Thread Evert Rol
> I don't mean to be overly critical, its not a bad application, but > if its marketed to 'perfectionists' then I guess you have to expect > people to be demanding =) Yup. But in their defence: the software comes completely free, and does work mostly out of the box. Anyway, perhaps this is

Re: django.newforms and AJAX

2008-03-27 Thread peschler
Hi David I was thinking about something like that, too. How do you intend to handle things on the server-side? How is the JS supposed to generically get the data? I already implemented a server side app, which makes all content types available via a REST conform API using a hacked-up django-rest

Re: Retrieving model schema and URL regexes from database

2008-03-27 Thread Marty Alchin
On Fri, Mar 21, 2008 at 2:37 PM, Greg <[EMAIL PROTECTED]> wrote: > I would like to store model schema and URL regexes in the database and > be able to retrieve them from the database and use them in an app. > For example, let's say I create a simple poll model and store that > schema in the da

Re: some database error?: not sure...

2008-03-27 Thread Evert Rol
> I deleted the database again - run syncdb again - clicked 'Change' and > bingo: same error message! No date entered, this time. Only this one > table in the database... Is this typical for sqlite? I've never experienced anything like this with sqlite. What does your model look like; there may

Re: some database error?: not sure...

2008-03-27 Thread Michael Wieher
I don't mean to be overly critical, its not a bad application, but if its marketed to 'perfectionists' then I guess you have to expect people to be demanding =) On Thu, Mar 27, 2008 at 10:54 AM, Evert Rol <[EMAIL PROTECTED]> wrote: > > > I guess by "bug" I meant that > > > > synchronizing, by its

Re: some database error?: not sure...

2008-03-27 Thread Evert Rol
> I guess by "bug" I meant that > > synchronizing, by its nature involves making two disparate things > congruent. > > syncdb does not do that. Well, it does, up to the part that 'it' (the writers) feels confident about: it synchronizes the database globally with newly added models; indeed

Re: Howto execute custom SQL from the command line

2008-03-27 Thread Thomas Guettler
Tourneur Henry-Nicolas schrieb: > Hello, > > At the installation stage of the software (Django bases, of course) I'm > developing, I have to insert data in a database. Is there any easy way to > tell django to execute the SQL directives contained in a .sql file ? > > I tried using manage.py but

Re: some database error?: not sure...

2008-03-27 Thread bavel
I deleted the database again - run syncdb again - clicked 'Change' and bingo: same error message! No date entered, this time. Only this one table in the database... Is this typical for sqlite? --~--~-~--~~~---~--~~ You received this message because you are subscrib

Re: some database error?: not sure...

2008-03-27 Thread Michael Wieher
I guess by "bug" I meant that synchronizing, by its nature involves making two disparate things congruent. syncdb does not do that. but ok, thanks for the reply, I'm glad its a documented "feature" at least... On Thu, Mar 27, 2008 at 10:37 AM, bavel <[EMAIL PROTECTED]> wrote: > > That's what I

Re: extra arguments in generic views

2008-03-27 Thread Erik Vorhes
This should help: http://www.b-list.org/weblog/2006/nov/16/django-tips-get-most-out-generic-views/ Say you've got this in "yourproj.yourapp.views" (assuming there's a ForeignKey on Thing2): from django.views.generic import date_based from yourproj.yourapp.models import Thing1 from yourproj.your

Re: some database error?: not sure...

2008-03-27 Thread Evert Rol
> I got this error when I added a field to my models, ran sycndb. > > I believe I got this error because syncdb failed to actually add the > correct column to the database to reflect the changes I had made to > my models. > > I believe this is a bug in syncdb, but maybe someone more > experi

Re: some database error?: not sure...

2008-03-27 Thread bavel
That's what I had done: deleted the database and run syncdb again - so I was pretty sure that the database file reflected the class in my models.py. I entered one record manually through the admin interface and got the error when I clicked 'Change' for this table. The first field in the table shou

Re: how to convert {{candidate.vote_set.filter(vote='TU').count()}} in template syntax

2008-03-27 Thread Peter Rowell
Specifically, you might look at http://www.djangosnippets.org/snippets/9/. This allows you to do something like: {% expr candidate.vote_set.filter(vote='TU').count() as count %} and now {{count}} can be used in the current context. If you find yourself yearning for Total Python Power in yo

Re: some database error?: not sure...

2008-03-27 Thread Michael Wieher
I got this error when I added a field to my models, ran sycndb. I believe I got this error because syncdb failed to actually add the correct column to the database to reflect the changes I had made to my models. I believe this is a bug in syncdb, but maybe someone more experienced can show me wha

some database error?: not sure...

2008-03-27 Thread bavel
I cannot figure out what this message might mean; can anybody help?: OperationError at /admin/balie/lid no such column: balie_lid.n Request method: GET Request URL: http://localhost:8000/admin/balie/lid/ Exception Type: OperationalError Exception Value: no such column: balie_lid.n Exception Loca

Free Call and SMS (World Wide)

2008-03-27 Thread HOT RIYA
Free Call and SMS (World Wide) http://www.freecall2phone.blogspot.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubs

extra arguments in generic views

2008-03-27 Thread Michael Newman
I was just messing around with my sites urlconf to keep it organized and manage clean things up a bit. I make use of generic views quite a bit and they really save me a lot of time. One of the things that I noticed however as I was trying to combine a lot of "info_dicts" was that the generic views

Re: django.newforms and AJAX

2008-03-27 Thread David Cramer
I was planning on using mootools, but it could just as easily be done with jQuery or no libraries (as all we need are a few basic things.. DOM selection and AJAX, the rest is cake) On Mar 27, 7:58 am, Michael <[EMAIL PROTECTED]> wrote: > David, > > This would be really cool because right now it i

Configuring Apache and mod_python for Django

2008-03-27 Thread Peter Rowell
In another thread (http://groups.google.com/group/django-users/ browse_thread/thread/962cfdf7609839eb/), On Mar 23, 11:48 pm, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > For example, using prefork MPM because PHP is not thread safe in > conjunction with Python web applications in embedded mode

Re: django.newforms and AJAX

2008-03-27 Thread Michael
David, This would be really cool because right now it is still a bit of a pain to do this for each form. A tool could really save some time. One thing that keeps coming up that I need javascript to check for is for file uploads checking that the file is appropriate both in extension and size. Als

Re: Filter ManyToMany options by Site in adming interface

2008-03-27 Thread Michael
Let's break down exactly what you are trying to accomplish. You have a model that you only want to be served only on a certain site. I thought that flatpages was using a manager to figure this out, but if actually applies a filter when flatpages is being fallen back on. You can create a manager q

Re: assertRaises() in django unittest framework doesn't catch exceptions

2008-03-27 Thread Karantir
And here is a bit of my testcase [code] self.assertRaises(RevisionNotStarted, self.documents[0].fix_revision()) [/code] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Does __unicode__() work in 0.96.1?

2008-03-27 Thread Legioneer
Hi All, I use django 0.96.1 on CentOS 4 box (python 2.3.4). When use __str__() in model definitions everything is fine, but when change it to __unicode__() I don't see it working (e.g. in admin interface there is a default output). Does 0.96.1 support __unicode__() or I should move to SVN versio

assertRaises() in django unittest framework doesn't catch exceptions

2008-03-27 Thread Karantir
Hi, I use unittest framework and recently i've faced strange issue. I use asserRaises() method to ensure that my model methods raises appropriate exceptions. And methods raises, but asserRaises() doesn't catch them, therefore i see an error with following traceback ==

Re: Trouble running dev server after upgrade to Leopard.

2008-03-27 Thread Evert Rol
> EDIT: After writing all of the stuff below, I got it working, at least > somewhat. I usually used sudo to run the dev server because I wanted > to run it on port 80 (nevermind why, long explanation). Doing that > still produces the same error, but if I run it without the sudo, it > works. I have

Re: Slightly OT - Django is Wired

2008-03-27 Thread Jeffrey Johnson
I can take credit for turning Chris Anderson (the Editor of Wired) on to Django. We were discussing other things a while ago (diydrones.com) and I mentioned that we were doing a project with GeoDjango. He said "what is django", and I proceeded to explain and his response was basically "Ah! RoR, bu

django.newforms and AJAX

2008-03-27 Thread David Cramer
As promised, Im going to release some tools that make it easier to integrate client and server-side javascript validation and utilities for newforms. To do this though, I first need to come up with a list of what is needed. Here is my current list: - Validation per-field via client-side and serve

Re: Where do I put the code to fetch data not coming from a DB

2008-03-27 Thread Zack
So. If you aren't using a relational db, maybe you don't really want to be using subclasses of django models to pull your data out of SVN. My initial thought would be that you should do something like write an abstract class that has the necessary methods for providing the CRUD equivalent actions

Re: Filter ManyToMany options by Site in adming interface

2008-03-27 Thread Josh
I'm not sure I understand how flatpages can help. I'm trying to limit what options show up in a select box in the admin interface so that if I have a Location on site A, when I go to select what Neighborhood it's in I'm only presented with the Neighborhoods that are also associated with site A and

Re: Where do I put the code to fetch data not coming from a DB

2008-03-27 Thread Michael Wieher
good question.. I don't honestly know if you can configure django's models to reference plain-text, or whatever this library-of-data is. most likely you'll just have to disable database use and write your own access routines. On Thu, Mar 27, 2008 at 6:09 AM, Rishabh Manocha <[EMAIL PROTECTED]> wr

Slightly OT - Django is Wired

2008-03-27 Thread Chris Moffitt
I hadn't seen mention of this so I thought I'd give everyone here a heads up. In the April edition of Wired, they have their normal Expired, Tired and Wired lists (p. 44). Check this one out: Expired: ASP.NET Tired: PHP Wired: Django Pretty cool. Yet more positive momentum for a great framework.

  1   2   >