Re: Debugging Django: print statements?

2007-01-22 Thread Austin Govella
On 1/23/07, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > yes, but then deadlines dont always allow for that Then you need a debugger *and* new deadlines. -- Austin Govella Thinking & Making: IA, UX, and IxD http://thinkingandmaking.com [EMAIL PROTECTED] --~--~-~--~~

Re: Debugging Django: print statements?

2007-01-22 Thread Kenneth Gonsalves
On 23-Jan-07, at 11:13 AM, [EMAIL PROTECTED] wrote: > Correct way to debug in dev. mode, and when program works fine, put it > to production. yes, but then deadlines dont always allow for that -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ --~--~-~--~-

Re: Template with multiple elements and manipulators

2007-01-22 Thread [EMAIL PROTECTED]
probably if there are 2 forms, must be 2 independent views. so you define form action='' to point to each form view, and views are returning this page. since you can not press both buttons simultaneously this approach should work well --~--~-~--~~~---~--~~ You re

Re: Database Error Handling

2007-01-22 Thread [EMAIL PROTECTED]
Hi Vadim, > Am I just taking the wrong approach here or something? Considering how > few questions I found regarding this it would appear that most people > are either blissfully ignoring db errors or know something I don't :) Probably. At least I never thought about wrapping save method with tr

Re: Debugging Django: print statements?

2007-01-22 Thread [EMAIL PROTECTED]
Margaret wrote: > yup, me too > > On 1/23/07, Vadim Macagon <[EMAIL PROTECTED]> wrote: > > > > Eclipse + PyDev is working out for me pretty well, PyDev has a graphical > > debugger. > > > > rzimerman wrote: > > > What's the best way to do debugging in Django? Usually when I program, > > > I use

Tute Part 4: vote() got an unexpected keyword argument 'poll_id'

2007-01-22 Thread speleolinux
Hi all I'm having problems in getting Part 4 of the tutorial where one uses generic views to work. The Polls app works fine until then. I have made the changes in part 4 and the polls/ URL is fine and when I go to say polls/1/ I get my list of polls with the Vote button but when its clicked I ge

No module named MIMEText

2007-01-22 Thread johnny
when I run python manage.py runserver and go to http://127.0.0.1:8000/admin/ I get an error: ImproperlyConfigured: Error importing middleware django.middleware.common: "No module named MIMEText" Traceback (most recent call last): File "H:\xampp\python\lib\site-packages\django\core\servers\bas

Multilingual content - yet another idea

2007-01-22 Thread [EMAIL PROTECTED]
Hi, I am developing a website that contains mainly multilingual content. There were some questions and ideas on this list on how to achieve it, so I thought I would share mine and see if anyone else finds it useful. I have a working prototype, although not ready for production use yet. An examp

Re: Debugging Django: print statements?

2007-01-22 Thread Margaret
yup, me too On 1/23/07, Vadim Macagon <[EMAIL PROTECTED]> wrote: > > Eclipse + PyDev is working out for me pretty well, PyDev has a graphical > debugger. > > rzimerman wrote: > > What's the best way to do debugging in Django? Usually when I program, > > I use "print" statements to identify probl

Re: dot asp files in wiki

2007-01-22 Thread Adrian Holovaty
On 1/22/07, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > on this page of the wiki: > http://code.djangoproject.com/wiki/AJAX > > i see something that looks like asp and vb files ... do they belong > here? I've removed them. Thanks for the heads-up. Adrian -- Adrian Holovaty holovaty.com | dj

Re: Multiple Forms and/or Models from one template (newforms)

2007-01-22 Thread SmileyChris
On Jan 23, 8:07 am, "JimR" <[EMAIL PROTECTED]> wrote: > 1. Can/Should I use multiple forms on one template that will update the > models? So far, when I've tried this approach the "post" only uses the > first form on the page. > > 2. Should I use one large form containing all of the fields from

dot asp files in wiki

2007-01-22 Thread Kenneth Gonsalves
hi, on this page of the wiki: http://code.djangoproject.com/wiki/AJAX i see something that looks like asp and vb files ... do they belong here? -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ --~--~-~--~~~---~--~~ You received thi

Database Error Handling

2007-01-22 Thread Vadim Macagon
There have been some questions in the past about how to catch IntegrityError(s) thrown by Model.save(), and there were two options suggested: 1). Don't wrap Model.save() in a try/except, because the data should be valid before saving. I validate the data before saving, but if validation occur

Re: Debugging Django: print statements?

2007-01-22 Thread Vadim Macagon
Eclipse + PyDev is working out for me pretty well, PyDev has a graphical debugger. rzimerman wrote: > What's the best way to do debugging in Django? Usually when I program, > I use "print" statements to identify problems. But Django seems to > surpress all output to stdout. > > I read at djang

Re: translations...

2007-01-22 Thread [EMAIL PROTECTED]
Okay, I noticed this thread literally seconds after creating my own describing a very similar approach. I searched the group for 'multilingual', should also have checked 'translations'. The new thread should appear shortly. My library also uses the internal Translation class, but I moved the de

Re: dump and restore tool for django

2007-01-22 Thread Russell Keith-Magee
On 1/23/07, Rob Hudson <[EMAIL PROTECTED]> wrote: > > I've looked at the dump code in #2333 and I'm looking forward to this > being added. I brought up a question before about being able to dump > data in a database agnostic way. It's interesting how you simply use > the serializers. And JSON f

Re: Debugging Django: print statements?

2007-01-22 Thread Filipe Correia
Check this thread: http://groups.google.com/group/django-users/browse_frm/thread/a9ed968d854c634c/3216dec1234ce0ac I haven't found better ways to debug since then. I find the simplest way for me has been to use print statements along with the built-in webserver. I'm still looking forward the next

Re: Using Object Relational Mapper

2007-01-22 Thread Steve M
I have a similar but not the same need. I do use the full Django stack, but I need to write helper programs that can interact with the database but have nothing to do with the web. This matters because I already have a normal Django project and some apps set up, but you may need to make a dummy pr

Template with multiple elements and manipulators

2007-01-22 Thread [EMAIL PROTECTED]
Hello everyone, we are building a web application at work with Django, and one template has two in it with their own submit button. If I have a Manipulator for both kind of forms, how would I cleanly write my view? Thanks, Vincent. --~--~-~--~~~---~--~~ You r

Re: Getting HTTP header data in templates

2007-01-22 Thread Andy Dustman
On 1/22/07, James Bennett <[EMAIL PROTECTED]> wrote: > > On 1/22/07, James Bennett <[EMAIL PROTECTED]> wrote: > > On 1/22/07, Andy Dustman <[EMAIL PROTECTED]> wrote: > > > Here's how I made it work: > > > > > > Index: django/views/defaults.py > > > > That view uses RequestContext, so you could jus

Re: How to set "REMEMBER ME"

2007-01-22 Thread Vadim Macagon
You can't change session lifetime on the fly with the default SessionMiddleware, but you can write your own middleware that's more flexible. I just wrote up my solution on the wiki here: http://code.djangoproject.com/wiki/CookBookDualSessionMiddleware -+ enlight +- Rob Hudson wrote: > It woul

Re: translations...

2007-01-22 Thread ashwoods
oh. a group just for that :) thx don. On Jan 22, 9:37 pm, Don Arbow <[EMAIL PROTECTED]> wrote: > On Jan 22, 2007, at 12:22 PM, ashwoods wrote: > > > > > hmm... i guess everybody is tired of translation discussions :)You > > might have better luck in the Django internationalization group

Re: Getting HTTP header data in templates

2007-01-22 Thread James Bennett
On 1/22/07, James Bennett <[EMAIL PROTECTED]> wrote: > On 1/22/07, Andy Dustman <[EMAIL PROTECTED]> wrote: > > Here's how I made it work: > > > > Index: django/views/defaults.py > > That view uses RequestContext, so you could just add > 'django.core.context_processors.request' to your > TEMPLATE_C

Re: Getting HTTP header data in templates

2007-01-22 Thread James Bennett
On 1/22/07, Andy Dustman <[EMAIL PROTECTED]> wrote: > Here's how I made it work: > > Index: django/views/defaults.py That view uses RequestContext, so you could just add 'django.core.context_processors.request' to your TEMPLATE_CONTEXT_PROCESSORS setting and the full request will be made availabl

Re: translations...

2007-01-22 Thread Don Arbow
On Jan 22, 2007, at 12:22 PM, ashwoods wrote: > > hmm... i guess everybody is tired of translation discussions :) You might have better luck in the Django internationalization group: http://groups.google.com/group/django-I18n/ Don --~--~-~--~~~---~--~~ Y

Re: Getting HTTP header data in templates

2007-01-22 Thread Andy Dustman
On 1/22/07, Andy Dustman <[EMAIL PROTECTED]> wrote: > On 1/22/07, Bo Shi <[EMAIL PROTECTED]> wrote: > > > > I think request.META is what you're looking for, i.e.: > > > >referrer = request.META.get('HTTP_REFERER', '/') > > I know that; I need to have access to it from a template, specifically

Re: Does django create apps folder for you?

2007-01-22 Thread ashwoods
the manage.py startapp actually does very little. just a folder and a "couple" of empty files. if you want to have an apps folder, just create one. if your main project folder is MyProject, just go to MyProject and: mkdir apps (or if you are in windows, just use what you always use) under MyProj

Re: syncdb: No module named Utils

2007-01-22 Thread ashwoods
hmm... can you post the whole error output? On Jan 21, 11:05 pm, "johnny" <[EMAIL PROTECTED]> wrote: > what does it mean "No module named Utils" when I run python manage.py > syncdb? > > I have looked into INSTALLED_APPS, there is nothing called "Utils" > Someone mentioned CONTEXT_PROCESSORS, I d

Re: Newforms problems

2007-01-22 Thread gkelly
Trying printing out self.clean_data when using the built-in django server and you'll see what it looks like. Your fields might be empty strings instead of None, so you should say: if self.clean_data.get("city") instead of making comparisons to None (which is discouraged in Python, you should use

Re: translations...

2007-01-22 Thread ashwoods
hmm... i guess everybody is tired of translation discussions :) On Jan 21, 1:12 am, "ashley" <[EMAIL PROTECTED]> wrote: > after searching and reading all the posts related to internalization > and multilanguange, my first question is if there is any active > development to integrate or make e

Re: admin calendar and clock in my code

2007-01-22 Thread ashwoods
the new newforms library pretty much covers form creation. did u already take a peak? http://www.djangoproject.com/documentation/newforms/ cheers, ashley On Jan 22, 11:57 am, "Giorgio Salluzzo" <[EMAIL PROTECTED]> wrote: > Hi all, > I'm trying to include in my templates django admin calendar an

Re: Getting HTTP header data in templates

2007-01-22 Thread Andy Dustman
On 1/22/07, Bo Shi <[EMAIL PROTECTED]> wrote: > > I think request.META is what you're looking for, i.e.: > >referrer = request.META.get('HTTP_REFERER', '/') I know that; I need to have access to it from a template, specifically my 404.html template, in a way that will work with generic views

Re: Multiple Forms and/or Models from one template (newforms)

2007-01-22 Thread ashwoods
i would do case 2. you can create a NewForm object with all the fields you want. then in the view where you process the post request, you just create (or edit) the model instances manually. that means you import all your models, you create a new instance of each model and assign the request data

Re: Simple Model Question

2007-01-22 Thread Joseph Heck
Your example is sparse to the point of being a tad obtuse, but I think I get what you're asking. Unless you reference modelTemp directly from inside exe1, you don't need to import it. If exe1 had a foreignKey to modelTemp, you'd need to import modelTemp. Otherwise, you don't. -joe On 1/22/07, as

Re: Simple Model Question

2007-01-22 Thread ashwoods
sorry, i have no idea what you are trying to do. is that python? plz explain. On Jan 22, 5:08 pm, "johnny" <[EMAIL PROTECTED]> wrote: > If I have the following: > > model1 > import modelTemp > class exe > (class exe uses a foreignKey from modelTemp) > > model2 > import model1.exe > class exe1 >

Download weather toolbar

2007-01-22 Thread rohan$
Download Weather Toolbar - Instant weather reports, forecasts, and radar images anytime for FREE! - http://surl.in/HLWTD238206SVRAKSX --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Multiple Forms and/or Models from one template (newforms)

2007-01-22 Thread JimR
Hello, all. I'm new to Django and Python, and kind of rusty with my development skills, so please forgive me as I struggle through it all! I am developing a web site that will eventually have a pretty significant library of forms in addition to regularly updated content and other information. I

Re: Database API blind spot

2007-01-22 Thread Tim Chase
> SELECT * FROM camps where id in (SELECT DISTINCT camp_id FROM application); Computing the DISTINCT portion here may be superfluous, and possibly (depending on your DB) a premature mis-optimization. Whether DISTINCT or not, membership via IN will still behave the same, but DISTINCT will requi

Re: Database API blind spot

2007-01-22 Thread James Bennett
On 1/22/07, Chris Brand <[EMAIL PROTECTED]> wrote: > I have an app with Applications, each of which is for a single Camp. > What I want to do is retrieve all the Camps for which there exists an > Application. The straightforward way is to retrieve a list of distinct values for 'camp_id' from the

Re: Is this bug in Django

2007-01-22 Thread alex kessinger
Michael had it right. I guess I deleted the __init__.py without looking. --~--~-~--~~~---~--~~ 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 uns

Database API blind spot

2007-01-22 Thread Chris Brand
I have the feeling that this is something that should be straightforward, but I can't see how to do it. I have an app with Applications, each of which is for a single Camp. What I want to do is retrieve all the Camps for which there exists an Application. Thanks, Chris --~--~-~--~--

ImageField Question

2007-01-22 Thread Rob Slotboom
"Like FileField, but validates that the uploaded object is a valid image. Has two extra optional arguments, height_field and width_field, which, if set, will be auto-populated with the height and width of the image each time a model instance is saved." So I made this model: class Foto(models.Mod

Re: How to set "REMEMBER ME"

2007-01-22 Thread Rob Hudson
It would be interesting to know, however, how to make this work like this: Default case: when the user doesn't check the "remember me" box... - Remove the cookie on browser close. This is great for sites that might get used in public places like libraries. - You can do this with: settings.SESSIO

Re: Debugging Django: print statements?

2007-01-22 Thread Bryan Murdock
On 1/21/07, rzimerman <[EMAIL PROTECTED]> wrote: > > What's the best way to do debugging in Django? Usually when I program, > I use "print" statements to identify problems. But Django seems to > surpress all output to stdout. > > I read at djangobook.com that I could put "assert False" statements

Re: dump and restore tool for django

2007-01-22 Thread Rob Hudson
I've looked at the dump code in #2333 and I'm looking forward to this being added. I brought up a question before about being able to dump data in a database agnostic way. It's interesting how you simply use the serializers. And JSON for data is an interesting choice too. It looks like it work

Re: Is this bug in Django

2007-01-22 Thread Michael Radziej
[EMAIL PROTECTED]: > "/usr/local/lib/python2.4/site-packages/django/utils/translation/trans_real.py", > line 167, in _fetch > app = getattr(__import__(appname[:p], {}, {}, [appname[p+1:]]), > appname[p+1:]) > AttributeError: 'module' object has no attribute 'blog' > > > I have never seen any

Re: Debugging Django: print statements?

2007-01-22 Thread JP
> What's the best way to do debugging in Django? Usually when I program, > I use "print" statements to identify problems. But Django seems to > surpress all output to stdout. Hi Robert, the best way to do debugging is - as always - using a debugger: http://docs.python.org/lib/module-pdb.html J

Re: django admin username and password

2007-01-22 Thread carlwenrich
thanks James. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to [EMAIL PROTECTED]

Re: newforms: max_length or maxlength

2007-01-22 Thread Adrian Holovaty
On 1/22/07, Michel Thadeu Sabchuk <[EMAIL PROTECTED]> wrote: > The newforms.CharField class expects a max_length keyword to define the > max_length, the models.CharField expects a maxlength keyword (without > the underscore). Shouldn't the newforms.CharField class use maxlength > too? Hi Michel,

Re: django admin username and password

2007-01-22 Thread James Bennett
On 1/22/07, carlwenrich <[EMAIL PROTECTED]> wrote: > I have a friend who lost his django admin username and password, and > the programmer who set them up. What can we do to create new ones > without having to rebuild the whole thing? If you have shell access to the system it's running on, do the

Simple Model Question

2007-01-22 Thread johnny
If I have the following: model1 import modelTemp class exe (class exe uses a foreignKey from modelTemp) model2 import model1.exe class exe1 (class exe1 uses a foreignKey from exe) Question I have is, do I have to import modelTemp for model2 also? --~--~-~--~~~---~-

newforms: max_length or maxlength

2007-01-22 Thread Michel Thadeu Sabchuk
Hi guys! The newforms.CharField class expects a max_length keyword to define the max_length, the models.CharField expects a maxlength keyword (without the underscore). Shouldn't the newforms.CharField class use maxlength too? Thanks Michel Thadeu Sabchuk --~--~-~--~~~-

django admin username and password

2007-01-22 Thread carlwenrich
I have a friend who lost his django admin username and password, and the programmer who set them up. What can we do to create new ones without having to rebuild the whole thing? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goog

Re: Is this bug in Django

2007-01-22 Thread Corey Oordt
What exact command did you type? On Jan 22, 2007, at 5:44 AM, [EMAIL PROTECTED] wrote: > > Traceback (most recent call last): > File "manage.py", line 11, in ? > execute_manager(settings) > File > "/usr/local/lib/python2.4/site-packages/django/core/management.py", > line 1447, in execute

Re: Getting HTTP header data in templates

2007-01-22 Thread Bo Shi
I think request.META is what you're looking for, i.e.: referrer = request.META.get('HTTP_REFERER', '/') On Jan 22, 9:39 am, "Andy Dustman" <[EMAIL PROTECTED]> wrote: > I have a 404 page that I would like to display some of the HTTP > headers (particularly HTTP_REFERER) in so that user receivi

Using Object Relational Mapper

2007-01-22 Thread Nirmal
Hi, I am a newbie to Django. As everyone knows, the features that are provided by Django is loosely coupled and I want to use onlt the object-relational mapper that is provided by Django. My database is MySql. Does anyone have used Django only for this? I have my own httpserver and templating sy

ANN: Django-0.95.1 hosting available at WebFaction

2007-01-22 Thread Remi
Hi everyone, This is just a quick post to announce that WebFaction have added Django-0.95.1 to their control panel. Remi http://www.webfaction.com - Hosting for an agile web. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo

Is this bug in Django

2007-01-22 Thread [EMAIL PROTECTED]
Traceback (most recent call last): File "manage.py", line 11, in ? execute_manager(settings) File "/usr/local/lib/python2.4/site-packages/django/core/management.py", line 1447, in execute_manager execute_from_command_line(action_mapping, argv) File "/usr/local/lib/python2.4/site-pack

Debugging Django: print statements?

2007-01-22 Thread rzimerman
What's the best way to do debugging in Django? Usually when I program, I use "print" statements to identify problems. But Django seems to surpress all output to stdout. I read at djangobook.com that I could put "assert False" statements in problematic parts, and then I would see debugging output

Getting HTTP header data in templates

2007-01-22 Thread Andy Dustman
I have a 404 page that I would like to display some of the HTTP headers (particularly HTTP_REFERER) in so that user receiving the error can make a usable report. Is there some way at getting at this information in a template without having to have your view return a HttpResponseNotFound object? I'

Re: catching database error

2007-01-22 Thread [EMAIL PROTECTED]
Thanks for the explanation, i tried the code you provided and it worked so this solves my problem. thank's richard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: newforms validation

2007-01-22 Thread serbaut
The clean_XXX methods documented in the regression tests mentioned above did it for me. I think the new api is much cleaner(!) than the old. The only thing is that I think the clean_XXX should be passed the cleaned value so far since you most likely will be doing: def clean_XXX(self): value =

Http request

2007-01-22 Thread Chatchai Neanudorn
I 'm implementing file upload app. A client can be both web and desktop application. I have tested using html form and receive file via request.FILES, it success. For desktop app, I use python urllib which data can be encoded into python dictionary (urllib.urlencode) and send it to my django web wi

admin calendar and clock in my code

2007-01-22 Thread Giorgio Salluzzo
Hi all, I'm trying to include in my templates django admin calendar and clock for date and datetime fields. I searched the solution here in Django users Group but, to be honest, I'm still having some problems. First of all, I have to include in my page .js files, done. Second, in which way I ge

Re: catching database error

2007-01-22 Thread Russell Keith-Magee
On 1/22/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Thanks for your advice, > > I tried to use > try: > except DoesNotExist: > > and this gave a error that DoesNotExist is not defined. Ok; I was shorthanding a little in my example. I thought the problem was that you didn't know you could

Re: catching database error

2007-01-22 Thread [EMAIL PROTECTED]
Thanks for your advice, I tried to use try: except DoesNotExist: and this gave a error that DoesNotExist is not defined. DatabaseError i didn't try yet thinking there was another method that should be used. if DatabaseError works it's oke the other error i will get will only be the DoesNotExist

Re: SSL and Django ?

2007-01-22 Thread [EMAIL PROTECTED]
Thanks for reply There was a CSS file in template which was import("http://mysite.com/style.css";); instead of importing through https I fixed it Thanks Amaltas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dja