Re: Django - technology or magic?

2007-07-24 Thread Jarek Zgoda
to_see napisał(a): > "Any sufficiently advanced technology is indistinguishable from > magic." > Arthur C. Clarke, "Profiles of The Future", 1961 (Clarke's third > law) > > After getting the tutorial example to work, then making a first-draft > version of my proposed application, I hit a wal

Re: How to do not escape a unicode string in Django

2007-07-24 Thread David Larlet
2007/7/23, Jacob Kaplan-Moss <[EMAIL PROTECTED]>: > It's probably just your shell; try ``print myobject`` instead. Hi Jacob, That's not exactly what I want to do. I use __str__ to get the title of the object and __repr__ to have a representation of this one. To be clear, I implement workflows an

Re: How to do not escape a unicode string in Django

2007-07-24 Thread David Larlet
2007/7/24, David Larlet <[EMAIL PROTECTED]>: > 2007/7/23, Jacob Kaplan-Moss <[EMAIL PROTECTED]>: > > It's probably just your shell; try ``print myobject`` instead. > > Before I switched to the unicoded trunk, it works perfectly but know > unicoded string were escaped so I have: > > >>> myobject #

mod_python, multiple django-sites, memory usage

2007-07-24 Thread Gábor Farkas
hi, how does it work exactly, when i have multiple django sites running in one apache server using mod_python? for example, imagine that i have 10 django sites running in one apache server. does that mean, that in every apache process, i have 10 python interpreters loaded? or in other words

newforms: How to pass onchange="..." ?

2007-07-24 Thread Thomas Guettler
Hi, how can I pass the html attribute onchange="..." with newforms? I want to add it to a ChoiceField. Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send emai

Re: newforms: How to pass onchange="..." ?

2007-07-24 Thread Thomas Guettler
Am Dienstag, 24. Juli 2007 10:32 schrieb Thomas Guettler: > Hi, > > how can I pass the html attribute onchange="..." with newforms? I found one solution myself: http://code.djangoproject.com/attachment/ticket/4961/newforms.diff#preview Adding HTML attributes to the widget --

Re: Random character in rendered HTML

2007-07-24 Thread Ivan Sagalaev
brutimus wrote: > {% block content %} > > {% include "whatever.html" %} > {% endblock %} This is most certainly a BOM -- Byte Order Mark of a UTF-8 charset that your text editor has added at the beginning of the 'whatever.html'. It's a part of UTF-8 and those symbols are normally not seen

Re: mod_python, multiple django-sites, memory usage

2007-07-24 Thread Graham Dumpleton
On Jul 24, 6:28 pm, Gábor Farkas <[EMAIL PROTECTED]> wrote: > hi, > > how does it work exactly, when i have multiple django sites running in > one apache server using mod_python? > > for example, imagine that i have 10 django sites running in one apache > server. > > does that mean, that in every

Re: mod_python, multiple django-sites, memory usage

2007-07-24 Thread David Reynolds
On 24 Jul 2007, at 10:35 am, Graham Dumpleton wrote: Memory use of running multiple Django instances under Apache using mod_python is only one of the problems that can arise in this instance. Other problems are the ability for the Django instances to interfere with each other due to C extension

Re: mod_python, multiple django-sites, memory usage

2007-07-24 Thread Graham Dumpleton
On Jul 24, 7:53 pm, David Reynolds <[EMAIL PROTECTED]> wrote: > On 24 Jul 2007, at 10:35 am, Graham Dumpleton wrote: > > > Memory use of running multiple Django instances under Apache using > > mod_python is only one of the problems that can arise in this > > instance. Other problems are the abili

Buildbot 0.7.5 Twisted2.5 Python2.5 WinXP

2007-07-24 Thread Chanita Siridechkun
I tried to use Buildbot 0.7.5, Twisted2.5, Python2.5 on WinXP. As I run buildbot start I got ImportError: No module named twistw. So I edited 'C:\Python25\Lib\site-packages\buildbot\scripts\startup.py' in launch(): # this is copied from bin/twistd. twisted-1.3.0 uses twistw, while # twi

Host-based url dispatch

2007-07-24 Thread Eratothene
I ran into the problem of Host-based url dispatch. I need to make something like this: urls.py: if request.META["HTTP_HOST"] = 'blogs.example.com' urlpatterns += (Some patterns) if request.META["HTTP_HOST"] = 'wikis.example.com' urlpatterns += (Abosolute different patterns) I have no ide

Re: Which database, and why?

2007-07-24 Thread Andreas Ahlenstorf
Am 24.07.2007 um 04:43 schrieb Kenneth Gonsalves: > The current versions of those manuals do not seem to > have those sections any more - so how can you trust a group that is > rewriting it's history? You're always right and never wrong, eh? Sorry, but such statements as yours are plain FUD. M

django.contrib.dataplot 0.3

2007-07-24 Thread Toby Dylan Hocking
Hi all, If any of you are interested in creating data graphics for your web apps, try checking out the new version of my plotting framework, django.contrib.dataplot. Here is an example of what it can do: http://www.ocf.berkeley.edu/~tdhock/dataplot-example/ There are builtin plots that you ca

Re: Host-based url dispatch

2007-07-24 Thread Graham Dumpleton
On Jul 24, 8:08 pm, Eratothene <[EMAIL PROTECTED]> wrote: > I ran into the problem of Host-based url dispatch. > > I need to make something like this: > urls.py: > > if request.META["HTTP_HOST"] = 'blogs.example.com' > urlpatterns += (Some patterns) > > if request.META["HTTP_HOST"] = 'wikis.exam

Re: mod_python, multiple django-sites, memory usage

2007-07-24 Thread Gábor Farkas
Graham Dumpleton wrote: > On Jul 24, 6:28 pm, Gábor Farkas <[EMAIL PROTECTED]> wrote: >> hi, >> >> how does it work exactly, when i have multiple django sites running in >> one apache server using mod_python? >> >> for example, imagine that i have 10 django sites running in one apache >> server. >

Re: Django - technology or magic?

2007-07-24 Thread Thomas Guettler
Am Dienstag, 24. Juli 2007 01:57 schrieb to_see: > "Any sufficiently advanced technology is indistinguishable from > magic." > Arthur C. Clarke, "Profiles of The Future", 1961 (Clarke's third > law) > ... > Am I having a fairly normal introduction to a web framework? I cannot > see this as te

Re: mod_python, multiple django-sites, memory usage

2007-07-24 Thread Graham Dumpleton
On Jul 24, 8:30 pm, Gábor Farkas <[EMAIL PROTECTED]> wrote: > Graham Dumpleton wrote: > > So, the question is, what are you trying to achieve or want? Was there > > a specific reason for the question? Knowing what you are really trying > > to do, might be able to suggest others things you can read

Re: Which database, and why?

2007-07-24 Thread Russell Keith-Magee
On 7/24/07, Andreas Ahlenstorf <[EMAIL PROTECTED]> wrote: > > Am 24.07.2007 um 04:43 schrieb Kenneth Gonsalves: > > > The current versions of those manuals do not seem to > > have those sections any more - so how can you trust a group that is > > rewriting it's history? > > You're always right and

Re: django.contrib.dataplot 0.3

2007-07-24 Thread Russell Keith-Magee
On 7/24/07, Toby Dylan Hocking <[EMAIL PROTECTED]> wrote: > > If any of you are interested in creating data graphics for your web apps, > try checking out the new version of my plotting framework, > django.contrib.dataplot. Here is an example of what it can do: Hi Toby, Looks like a great app! P

transaction commit

2007-07-24 Thread Michal Konvalinka
Hi, I would like to use transactions (in MySQL and InnoDB). I know there are decorators but I don't want to use them now. Is there any example how to use transactions without decorators? I couldn't find anything on django website, this user-group... Is this correct? def update_something(self, pa

Re: Django - technology or magic?

2007-07-24 Thread Nis Jørgensen
to_see skrev: > "Any sufficiently advanced technology is indistinguishable from > magic." > Arthur C. Clarke, "Profiles of The Future", 1961 (Clarke's third > law) > > Snippet #26 solved my problem, essentially in two lines. I could not > write those lines for myself now, and I'm not cert

Re: Template debugging

2007-07-24 Thread Russell Keith-Magee
On 7/23/07, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > Hi there! > > I was wondering if this is even possible (perhaps, some middleware?). > I'd like to have a closer look into the context that is getting rendered > in each view, including the data I get from the RequestContext. You might want t

Re: transaction commit

2007-07-24 Thread Russell Keith-Magee
On 7/24/07, Michal Konvalinka <[EMAIL PROTECTED]> wrote: > It works but I would like to ask If I am violating some Django > principles or not. Your example is correct, and you aren't violating any 'Django principles'. Django provides decorators because it can be convenient to wrap a whole funct

Re: transaction commit

2007-07-24 Thread Andrey Khavryuchenko
MK> Hi, MK> I would like to use transactions (in MySQL and InnoDB). I know there MK> are decorators but I don't want to use them now. Is there any example MK> how to use transactions without decorators? I couldn't find anything MK> on django website, this user-group... Quick google on "djan

Re: Django - technology or magic?

2007-07-24 Thread Sam Morris
On Mon, 23 Jul 2007 16:57:42 -0700, to_see wrote: > Snippet #26 solved my problem, essentially in two lines. I could not > write those lines for myself now, and I'm not certain I'll ever be able > to do so. I'm going to assume it's the Python code itself that is confusing you, rather than the n

Re: Insert vs. Update

2007-07-24 Thread Russell Keith-Magee
On 7/24/07, PyMan <[EMAIL PROTECTED]> wrote: > > Can anyone tell me why Django do this while using save()? : The behavior comes from the Object relational mapping (key word - Object). Since save() is an operation on an Object relational mapper, it was established as an unambiguous mechanism to ge

Form_for multiple models

2007-07-24 Thread Chris Hoeppner
Hi there! I need to get a form done. The 'long' way. Well... Actually, what I need is the same as form_for_instance, but for more than a single model. The actual form_for_instance is a bit too advanced for my poor python knowledge. Any way to get this a bit easier than creating the form by hand?

Re: Form_for multiple models

2007-07-24 Thread Russell Keith-Magee
On 7/24/07, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > Well... Actually, what I need is the same as form_for_instance, but for > more than a single model. Why not use multiple forms? There is nothing stopping you from putting multiple forms into a context, and populating multiple forms from a s

select_related() bug

2007-07-24 Thread novice
Hello, I have this following model structure model category : name & description fields model seller : name & some address fields... model offer: category (FK to category table), name, picture, etc... model offer_seller: offer (FK to offer), seller (FK to seller), price, amount, etc the selle

Re: newforms: How to pass onchange="..." ?

2007-07-24 Thread [EMAIL PROTECTED]
Better yet, don't mix your js in with your other stuff, separate out your script and say document.getElementByID("id_whatever").onchange = do something On Jul 24, 3:47 am, Thomas Guettler <[EMAIL PROTECTED]> wrote: > Am Dienstag, 24. Juli 2007 10:32 schrieb Thomas Guettler: > > > Hi, > > > how c

Re: transaction commit

2007-07-24 Thread Michal Konvalinka
Hi Andrey, I suppose you read my question attentively and therefore you know that I searched the web (and django documentation of course including the transaction page). And I suppose you know that I was looking for example how to use transactions without decorators. The problem is that there's n

Re: upload progress bar (ticket #4165)

2007-07-24 Thread Dirk van Oosterbosch, IR labs
I now believe this 'uncaught exception' just means that the return from the query http://mydomain.com/admin/upload_progress/?0 was not correctly parsable xml. If I try http://mydomain.com/admin/upload_progress/?0 by hand it returns OperationalError at /admin/upload_progress/ (1048, "Column 'p

Re: transaction commit

2007-07-24 Thread Russell Keith-Magee
On 7/24/07, Michal Konvalinka <[EMAIL PROTECTED]> wrote: > > The problem is that there's no example how to use transactions without > decorators in the documentation, there's no example here in this > mailing list... I found the example in > django.db.transaction.py This is a problem that should

Cercasi Programmatori Python

2007-07-24 Thread Vittorino Parenti
La nosrta società cerca programmatori python con le seguenti conoscenze: - Python2.4 o superiori - Django - PostgreSQL, MySQL, Ajax - PHP (non indispensabile) Coloro che fossero interessati possono inviare il CV al seguente indirizzo: [EMAIL PROTECTED] Saluti, Vittorino. --~--~-~--~-

Re: transaction commit

2007-07-24 Thread Michal Konvalinka
OK, I can try it but it will require a correction because I'm not a native speaker. Michal On 24/07/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > On 7/24/07, Michal Konvalinka <[EMAIL PROTECTED]> wrote: > > > > The problem is that there's no example how to use transactions without > > de

newforms: default Model values

2007-07-24 Thread Patrick
Hi! I'm starting to use newforms for most of my forms, but I run into a problem, which I'm hope has a DRY solution, but I haven't found it yet. Here's my model chunk: class Post(models.Model): status = models.CharField( maxlength = 15,

Re: Instant Django

2007-07-24 Thread yml
Hello, I have downloaded your package and launch the start.bat Then in that console I have entered: "django-admin startproject test_admin" Unfortunatly the system raises this error message: """ Traceback (most recent call last): File "E:\instant_django\django\Utilities\django-admin.py", line 5

Re: Instant Django

2007-07-24 Thread cjl
YML: Thank you for the bug report. I thought I had tested this use case, but obviously I missed something. I'll check into it, and get back to you with an answer. Thanks again, cjlesh --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Changing the "name" of a DB object & displaying the ID

2007-07-24 Thread Matt Williams
Dear All, I have a simple question, but can' find the answer in the docs. I have two classes, a & b, in my model.py file, related via a OneToOne. When I create an a, I would like to display its UID in the admin interface. I've tried adding idNumber = model.AutoField(primary_key=true) and

Re: Form_for multiple models

2007-07-24 Thread Chris Hoeppner
Russell Keith-Magee escribió: > On 7/24/07, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > >> Well... Actually, what I need is the same as form_for_instance, but for >> more than a single model. > > Why not use multiple forms? There is nothing stopping you from putting > multiple forms into a contex

Customizing the settings configuration

2007-07-24 Thread gorans
Hi, I develop Django sites on my mac and then publish them to another web server. In between, they live in a happy SVN repository on my development server. Each time I make a change to the project's settings.py I have to then go over and modify the live file version (in respect to the database t

Re: Trouble with last bit of Tutorial

2007-07-24 Thread Martin, Jared
I think my post got lost last night... So here's my question again: - Original Message - From: django-users@googlegroups.com To: Django users Sent: Mon Jul 23 20:53:49 2007 Subject: Trouble with last bit of Tutorial I'm trying to put the last bit on the tutorial. I'm running django 0

Re: How to communicate with Authorize.net?

2007-07-24 Thread Kevin Menard
On 7/22/07, Greg <[EMAIL PROTECTED]> wrote: > > Is there any documentation on how to send form data to a Authorize.net > from within a Django view? I've done this from a Java webapp we have here. It's mostly just XML datagram forming and parsing, using standard HTTP libs for POSTing. I don't th

Re: List with pagination, sorting and simple search interface

2007-07-24 Thread Pigletto
> I don't think there are pre-made components that will provide you with > all of those things, and being somewhat new to django I can only point > you to one bit of documentation and code that I found helpful for > pagination: > > http://code.djangoproject.com/wiki/PaginatorTag Thanks. Finally I'

share users across django projects?

2007-07-24 Thread hotani
I'm about to build a new project using django that will have the same users as a previous project. I would like to avoid duplicating the existing user table. Is there a way to authenticate into the new project with the current user list? --~--~-~--~~~---~--~~ You

Re: transaction commit

2007-07-24 Thread Peter Melvyn
> Your example is correct, and you aren't violating any 'Django principles'. Really? Should not be there something like this? enter_transaction_management() try: managed(True) try: ... except: transaction.rollback() raise ... else: tra

Re: transaction commit

2007-07-24 Thread Andrey Khavryuchenko
Michal, MK> I suppose you read my question attentively and therefore you know that MK> I searched the web (and django documentation of course including the MK> transaction page). And I suppose you know that I was looking for MK> example how to use transactions without decorators. MK> The pr

Re: Django - technology or magic?

2007-07-24 Thread SH
That's one of the reasons I like django better than rails - Because there's so little magic. It's all pretty straightforward. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gro

Re: share users across django projects?

2007-07-24 Thread Carl Karsten
hotani wrote: > I'm about to build a new project using django that will have the same > users as a previous project. I would like to avoid duplicating the > existing user table. Is there a way to authenticate into the new > project with the current user list? The users are in the db. Unless you

Django .91 issue

2007-07-24 Thread [EMAIL PROTECTED]
Hi I have a csv file that I am reading in and I want to test to make sure that there are no duplicate records so I do something like this: # My Checker from csv import reader import datetime import re import time from time import strptime from django.models.somemodel import SomeModel from some_s

RE: Form_for multiple models

2007-07-24 Thread Chris Brand
> - When you instantiate your form, pass in prefix='form1' as an > argument - all the fields on the form will get that prefix, which will > keep the two forms distinct in the POST dictionary. This will only be > an issue if there is an overlap in the field names on the two forms, > but it's bette

RE: select_related() bug

2007-07-24 Thread Chris Brand
> Maybe the problem is with the depth parameter, but since I have a self > reference in the offer model, I have to use depth parameter. I have > increased the depth prameter, but I get the same error. Sounds like it could be bug 4789, which I recently tripped over myself. Can you increase the dep

Re: share users across django projects?

2007-07-24 Thread hotani
I have considered it, but the first project is rather large and we wanted to keep it on its own server with a separate database. I am still at the high level design stage of the second project so it may end up bundled with the first. --~--~-~--~~~---~--~~ You rece

Re: Django .91 issue

2007-07-24 Thread oggie rob
With 0.91, you use the "magic" name for db-api operations, rather than the model name. For example: from django.models import my_model_module my_model_module.somemodels.get_object(...) I think sometime before 0.91 was finished, the directory structure changed, so you might access your models sli

Re: Instant Django

2007-07-24 Thread cjl
Thanks again for the bug report, I have found the problem. Change the 'path' section of start.bat to read: path = %CD%\Python25;%CD%\Utilities;%CD%\Utilities\svn- win32-1.4.4\bin;%CD%\Utilities\exemaker-1.2-20041012;%CD%\Utilities \npp.4.1.2.bin;%CD%\Utilities\sqlite-3_4_0;%PATH% I had %PATH% f

Re: newforms: default Model values

2007-07-24 Thread Doug B
I don't know how others have approached it, but I have a 'settings' file with defaults defined in one place and reference those values via imports in the form file and model file. For values specific for the app, I stick them in the models file. models.py - POST_DEFAULTS = {'status':'pub

Re: Insert vs. Update

2007-07-24 Thread Peter Melvyn
On 7/24/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > You're not the first to suggest insert() and update() methods that > explicity do SQL INSERT and UPDATE calls. FYI: both, SQLite and MySQL support REPLACE statement to do this automatically. --~--~-~--~~~--

Re: Insert vs. Update

2007-07-24 Thread James Bennett
On 7/24/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > You're not the first to suggest insert() and update() methods that > explicity do SQL INSERT and UPDATE calls. I have a vague recollection > that a decision was made about adding these calls, but a quick search > in the ticket database d

Re: newforms: default Model values

2007-07-24 Thread Patrick
On Tue, 24 Jul 2007 11:51:36 -0700, Doug B wrote: > I don't know how others have approached it, but I have a 'settings' file > with defaults defined in one place and reference those values via > imports in the form file and model file. For values specific for the > app, I stick them in the model

Re: Django .91 issue

2007-07-24 Thread [EMAIL PROTECTED]
Awwh, Yes! Brainfart! Thank you so much. I'm glad new django doesn't use this method anymore. Thanks again. On Jul 24, 2:22 pm, oggie rob <[EMAIL PROTECTED]> wrote: > With 0.91, you use the "magic" name for db-api operations, rather than > the model name. For example: > > from django.models im

django db models error

2007-07-24 Thread akk
Hi, I started walking myself through exercises in django book. At chapter V - Interacting with a database: Models. I keep getting error when I try to create class. Otherwise my db connectivity seems fine. I can run from >>> django.db import connection >>> cursor = connection.cursor() (fine) Here

Auth framework - initials et of users/groups ?

2007-07-24 Thread Przemyslaw Wegrzyn
Hi! I'm just trying to do is using django.contrib.auth framework. What I'd need is the possibility to create initial set of groups, users and user-group assignements, when 'syncdb' is performed. One option I see is to add custom statements to one of SQL files used to initialize my application's

Re: Customizing the settings configuration

2007-07-24 Thread Shawn Allen
One solution is to add an extra import at the bottom of your settings.py: try: from localsettings import * except ImportError: pass Then put localsettings.py in your svn:ignore, and override whatever settings you need to on a per-installation basis. On Jul 24, 2007, at 8:41 AM, go

from settings import *, non-django python script Error

2007-07-24 Thread johnny
import re from BeautifulSoup import BeautifulSoup import urllib2 from os import environ #from settings import * def myfunction() : environ['DJANGO_SETTINGS_MODULE'] = "mysite.settings" from settings import * I get an error: myscript.py:22: SyntaxWarning: import * only allowed at module

Re: django db models error

2007-07-24 Thread James Bennett
On 7/24/07, akk <[EMAIL PROTECTED]> wrote: > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib/python2.5/site-packages/django/db/models/base.py", > line 40, in __new__ > model_module = sys.modules[new_class.__module__] > KeyError: '__console__' You'll need to actu

Re: django db models error

2007-07-24 Thread akk
Thanks a lot. I guess, I was not reading it well. On Jul 24, 4:55 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 7/24/07, akk <[EMAIL PROTECTED]> wrote: > > > Traceback (most recent call last): > > File "", line 1, in > > File "/usr/lib/python2.5/site-packages/django/db/models/base.py",

Re: Blog engine

2007-07-24 Thread Henrik Lied
This sounds great. I created a project on Google Code: http://code.google.com/p/django-blog-engine/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-u

Re: Auth framework - initials et of users/groups ?

2007-07-24 Thread Andrey Khavryuchenko
Przemyslaw, PW> I'm just trying to do is using django.contrib.auth framework. PW> What I'd need is the possibility to create initial set of groups, users PW> and user-group assignements, when 'syncdb' is performed. PW> One option I see is to add custom statements to one of SQL files used to

Re: newforms: default Model values

2007-07-24 Thread Michael
When I came across the same issue (model default values not being selected), I simply stopped using form_for_model for new forms and instead created an instance of my model in memory then used form_for_instance... for eg: p = Post() PostForm = form_for_instance(p) That way the default values for

Re: from settings import *, non-django python script Error

2007-07-24 Thread Carl Karsten
johnny wrote: > import re > from BeautifulSoup import BeautifulSoup > import urllib2 > from os import environ > #from settings import * > > def myfunction() : > > environ['DJANGO_SETTINGS_MODULE'] = "mysite.settings" > from settings import * > > I get an error: > myscript.py:22: SyntaxW

Uploading 1 image...making multiple dimensions of that image?

2007-07-24 Thread Greg
Hello, In my admin interface I upload a picture of a product. We'll in my website I will show that picture in 3 separate pages.Each page shows the picture with different dimensions. I know that I can apply a width and height attribute to my img tag. However, that causes the pictures to be d

using javascript to update a ChoicesField: getting "not one of the available choices."

2007-07-24 Thread hotani
I have 'drop-down A' which, when changed, updates 'drop-down B' via an AJAX call. Problem is this: ChoicesField for drop-down B won't recognize any of the choices and I can't submit the form. Is there a way to turn off that piece of the validation? Alternatively I could remove 'drop-down B' from

Re: Should I give up on dreamhost?

2007-07-24 Thread walterbyrd
On Jul 23, 12:40 pm, Horst Gutmann <[EMAIL PROTECTED]> wrote: > What exactly have you done so far? It took me quite some time but now > Django is (so far) working veeery realiably on my Dreamhost account. > I have asked for, and recieved, help before, but I was still unable to solve the problem.

Re: using javascript to update a ChoicesField: getting "not one of the available choices."

2007-07-24 Thread Doug B
Don't use a ChoiceField, but do use the select widget. class TF(forms.Form): blah=forms.IntegerField(widget=forms.Select(choices=((1,'one'), (2,'two'))), initial = 2) post = {'blah': 42} form = TF(post) form should validate. It would be up to you to make sure that the Integer value is in

Re: Blog engine

2007-07-24 Thread Chris Moffitt
I think I mentioned earlier in this thread, that I do have my take on creating a blog here - http://www.satchmoproject.com/trac/browser/satchmoproject.com/satchmo_website/apps It's pretty full featured right now and makes use of the tagging and comment_utils libraries. It still needs the feeds bu

Re: Auth framework - initials et of users/groups ?

2007-07-24 Thread Przemyslaw Wegrzyn
Andrey Khavryuchenko wrote: > PW> One option I see is to add custom statements to one of SQL files used to > PW> initialize my application's model. Yet it's a bit ugly, isn't it ? > >Create this data in console or in the script and then use > manage.py dumpdata >to save then in json format.

Re: Form_for multiple models

2007-07-24 Thread Nathan Ostgard
You can specify it upon form creation. Here is an example of how you could use prefixes for multiple model forms: In your views: from django import newforms as forms from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from yourproject.yourapp.models impor

DB-Lookup on dynamically created fieldname

2007-07-24 Thread Andreas Pfrengle
Hello group, I have some models in my app that have several fields. First, my code picks dynamically one of the models from a string-variable, sth. like: mdl = eval(model_name), where model_name contains the name the model. Then, I want to lookup a field in that model, but again I also only got i

Re: Instant Django

2007-07-24 Thread yml
This is half solving the problem. with your fix in the start.bat now when i launch python it start python on the memory stick but for some reasons dajngo-admin.exe call python installed on my computer not the one in your package. However this is working fine "E:\instant_django\django>python Utili

RE: Form_for multiple models

2007-07-24 Thread Chris Brand
> You can specify it upon form creation. Here is an example of how you > could use prefixes for multiple model forms: Thanks, Nathan. That's very useful. Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dj

Re: Auth framework - initials et of users/groups ?

2007-07-24 Thread Peter Melvyn
On 7/25/07, Przemyslaw Wegrzyn <[EMAIL PROTECTED]> wrote: > Thanks! I overlooked the 'fixtures' feature, I'll give it a try. I don't know wjhat kind of SQL server do you use, but If I'm not mistaken, fixtures are not fully supported on MySQL with InnoDB engine. --~--~-~--~~---

Re: Auth framework - initials et of users/groups ?

2007-07-24 Thread Przemyslaw Wegrzyn
Peter Melvyn wrote: >>Thanks! I overlooked the 'fixtures' feature, I'll give it a try. >> >> > >I don't know wjhat kind of SQL server do you use, but If I'm not >mistaken, fixtures are not fully supported on MySQL with InnoDB >engine. > > Yes, I've found such warning in the documentation.

Re: How do I know if fastcgi is installed correctly? (using dreamhost)

2007-07-24 Thread Horst Gutmann
walterbyrd wrote: > > On Jul 19, 4:08 pm, FrankW <[EMAIL PROTECTED]> wrote: >> in your shell, if you cd into /home/walterbyrd/django.niche-software/ >> django >> and type ./dispatch.fcgi, what do you get? >> > > > ./dispatch.fcgi > WSGIServer: missing FastCGI param REQUEST_METHOD required by WS

Please Help with Namespace Issue.

2007-07-24 Thread Sebastian Macias
Hello I'm having this strange problem and was wondering if anyone knows what might be causing it. I'm working on a django project called championsound. I integrated django registration the "regular" way: copied the app folder to my project folder and added (r'', include('marketing.urls')), to my

Re: DB-Lookup on dynamically created fieldname

2007-07-24 Thread Doug B
Maybe you could do something like this? filterargs = {} filterargs[fieldname] = some value # or for other types of filtering filterargs["%s__istartswith" % fieldname] = somevalue mdl.objects.filter(**filterargs) You might also want to take a look at the function get_model() from django.db.mode

Re: newforms: default Model values

2007-07-24 Thread Patrick
Seems like an elegant and logical solution. Thanks, Michael! On Tue, 24 Jul 2007 21:04:50 +, Michael wrote: > When I came across the same issue (model default values not being > selected), I simply stopped using form_for_model for new forms and > instead created an instance of my model in me

Re: newforms: default Model values

2007-07-24 Thread Patrick
Unfortunately, this doesn't work without a primary key needed for many-to- many relations that are used in the model. Previous tip with modifying base fields before instantiating a form object works better. On Tue, 24 Jul 2007 22:37:06 +, Patrick wrote: > Seems like an elegant and logical

Why does direct_to_template require a db?

2007-07-24 Thread omat
Hi all, I have an application that does not use a database at all. Thus, I removed db specific settings from the settings file. Everything works fine, except, when I try to use 'django.views.generic.simple.direct_to_template', it raises an "Improperly Configured' exception, complaining that the

Re: django.contrib.dataplot 0.3

2007-07-24 Thread Toby Dylan Hocking
Hi Russ, Thanks for the advice. I can certainly change the name to django-dataplot. However, I thought that the contrib/ subdirectory of the django distribution would be the most natural place to install it, since it is an add-on app that is meant to be used by other apps. Can you suggest ano

Re: Why does direct_to_template require a db?

2007-07-24 Thread Jeremy Dunck
On 7/24/07, omat <[EMAIL PROTECTED]> wrote: > Why does direct_to_template require a database at all? > It doesn't directly require it. You must be using something that does. Are you using sessions? It does use RequestContext, which runs TEMPLATE_CONTEXT_PROCESSORS, which includes django.core.c

Re: django.contrib.dataplot 0.3

2007-07-24 Thread James Bennett
On 7/24/07, Toby Dylan Hocking <[EMAIL PROTECTED]> wrote: > Furthermore, is there a formal process for integrating into > django.contrib? How has it worked in the past? At the moment there isn't a formal process; when it's come up before, the most common suggestion seems to have been that an appl

Best Practices to Make your Apps Portable

2007-07-24 Thread Sebastian Macias
Today I had issues getting django registration to work in my django project without having to modify every namespace inside django registration. Basically what I ended up having to do is adding django registration to my site-packages folder so I don't get errors like "No module named registration.

A convenient way to include images in a blog entry

2007-07-24 Thread Kai Kuehne
Hi list! In the last past hours I've been thinking about how to include images into my django blog application. At first, I added a new field to my "Entry" django model and named it "image". This worked but I decided that (maybe) I want to include more than one image in a blog entry. So I created

Re: Best Practices to Make your Apps Portable

2007-07-24 Thread Collin Grady
apps are portable if you don't make them in a project directory - as for copying them to another server, nothing stops you from making a "3rd_party" or some such folder in there that you add to pythonpath, so that they don't have to be referenced by project.app Or maybe make an "apps" directory t

Re: transaction commit

2007-07-24 Thread Russell Keith-Magee
On 7/25/07, Peter Melvyn <[EMAIL PROTECTED]> wrote: > > > Your example is correct, and you aren't violating any 'Django principles'. > > Really? Should not be there something like this? Yes - this is a more complete example, and catching the rollback case is a good idea. The point I was trying to

Re: Customizing the settings configuration

2007-07-24 Thread Russell Keith-Magee
On 7/24/07, gorans <[EMAIL PROTECTED]> wrote: > > I though that there could be a way to trick Django into reading > special development settings for me, something like having a settings > 'package' import separate settings files: No need for any special handling - just use the --settings option t

Re: Auth framework - initials et of users/groups ?

2007-07-24 Thread Russell Keith-Magee
On 7/25/07, Peter Melvyn <[EMAIL PROTECTED]> wrote: > > On 7/25/07, Przemyslaw Wegrzyn <[EMAIL PROTECTED]> wrote: > > > > Thanks! I overlooked the 'fixtures' feature, I'll give it a try. > > I don't know wjhat kind of SQL server do you use, but If I'm not > mistaken, fixtures are not fully suppor

Re: Auth framework - initials et of users/groups ?

2007-07-24 Thread Russell Keith-Magee
On 7/25/07, Przemyslaw Wegrzyn <[EMAIL PROTECTED]> wrote: > > I'd like to use fixtures to initialize all my authentication data, so > I'd like to disable this question as well: ... > Is there any option to do it ? Well, I have not enough time to check the > sources myself :-/ Yes. You can use the

Re: Please Help with Namespace Issue.

2007-07-24 Thread Russell Keith-Magee
On 7/25/07, Sebastian Macias <[EMAIL PROTECTED]> wrote: > > When I run the app with the development server everything is fine, I > can go to http://localhost:8000/accounts/login/ and I get no errors > but when I test it using apache/mod_python I get the following error. > > ImportError at / > No m

  1   2   >