Re: meet issue in Django tutorail

2009-01-17 Thread Kenneth Gonsalves
On Saturday 17 Jan 2009 12:00:33 pm syo wrote: > thanks for replay , then is it safe to say there is something wrong in > this tutorial? no - nothing wrong with the tutorial. These things depend on what your system path is like -- regards KG http://lawgon.livejournal.com --~--~-~--~--

Re: NetBeans IDE for Python

2009-01-17 Thread Gautam
There is some problem with the parser recognizing package imports in the from ... import ... syntax. What seems to work is if you import packages directly as import ... as So for the django models import as: import django.db.models as models And voila, completion in Netbeans works! On Nov

How do you get the time and date out of a datetimefield object?

2009-01-17 Thread DragonSlayre
Hi, As I'm relatively new to python and django, I'm unsure how to get the date and time out of a DateTimeField. How I usually work with this sort of thing is to 'python manage.py shell' and then import whatever class i'm interested in and then do a dir() on the object to find out what methods an

Re: How do you get the time and date out of a datetimefield object?

2009-01-17 Thread Kenneth Gonsalves
On Saturday 17 Jan 2009 2:13:29 pm DragonSlayre wrote: > As I'm relatively new to python and django, I'm unsure how to get the > date and time out of a DateTimeField. > > How I usually work with this sort of thing is to 'python manage.py > shell' and then import whatever class i'm interested in an

Re: How do you get the time and date out of a datetimefield object?

2009-01-17 Thread Malcolm Tredinnick
On Sat, 2009-01-17 at 00:43 -0800, DragonSlayre wrote: > Hi, > > As I'm relatively new to python and django, I'm unsure how to get the > date and time out of a DateTimeField. > > How I usually work with this sort of thing is to 'python manage.py > shell' and then import whatever class i'm intere

Re: How do you get the time and date out of a datetimefield object?

2009-01-17 Thread Kenneth Gonsalves
On Saturday 17 Jan 2009 2:42:16 pm Malcolm Tredinnick wrote: > > How I usually work with this sort of thing is to 'python manage.py > > shell' and then import whatever class i'm interested in and then do a > > dir() on the object to find out what methods and fields it has. > > dir() is typically l

Re: How do you get the time and date out of a datetimefield object?

2009-01-17 Thread Malcolm Tredinnick
On Sat, 2009-01-17 at 14:47 +0530, Kenneth Gonsalves wrote: [...] > what you need to do is to use dir() to find out the method names and help on > the method you want to get more info Do I? Okay. Haven't had to do that before, though, since I apparently use a special version of Python where help

Re: How do you get the time and date out of a datetimefield object?

2009-01-17 Thread Kenneth Gonsalves
On Saturday 17 Jan 2009 2:57:21 pm Malcolm Tredinnick wrote: > > what you need to do is to use dir() to find out the method names and help > > on the method you want to get more info > > Do I? sorry - I did not mean *you* - I was addressing the OP and trying to supplement what you were saying. I

Re: How do you get the time and date out of a datetimefield object?

2009-01-17 Thread Kenneth Gonsalves
On Saturday 17 Jan 2009 3:33:58 pm Kenneth Gonsalves wrote: > On Saturday 17 Jan 2009 2:57:21 pm Malcolm Tredinnick wrote: > > > what you need to do is to use dir() to find out the method names and > > > help on the method you want to get more info > > > > Do I? > > sorry - I did not mean *you* -

Do Mysql Views and Django work together?

2009-01-17 Thread phoebebright
I say an earlier post that seemed to imply they did. I created a view in an existing db and wrote a model test to match it so syncdb works fine. But when I try to import it I get: ViewDoesNotExist: Could not import todo.views. Error was: cannot import name test The ability to use views would

Re: How do you get the time and date out of a datetimefield object?

2009-01-17 Thread DragonSlayre
Thanks for the tips, the help thing looks real - well... helpful! lol --~--~-~--~~~---~--~~ 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 unsub

Re: Do Mysql Views and Django work together?

2009-01-17 Thread Malcolm Tredinnick
On Sat, 2009-01-17 at 02:14 -0800, phoebebright wrote: > I say an earlier post that seemed to imply they did. Well, for reasonable values of "works", that's true. There's no special view handling code in Django, but, particularly for read-only code, they should work without any problem. You can c

Re: Do Mysql Views and Django work together?

2009-01-17 Thread Malcolm Tredinnick
On Sat, 2009-01-17 at 02:14 -0800, phoebebright wrote: > I say an earlier post that seemed to imply they did. > > I created a view in an existing db and wrote a model test to match it > so syncdb works fine. Hm ... it just occurred to me: whilst running syncdb probably works if you've specified

Re: Do Mysql Views and Django work together?

2009-01-17 Thread phoebebright
That sounds like a very useful feature - gets my vote. Will have another go at getting django to read a view with mysql - could well be a silly error of mine causing the problem. On Jan 17, 10:47 am, Malcolm Tredinnick wrote: > On Sat, 2009-01-17 at 02:14 -0800, phoebebright wrote: > > I say an

Sites issue

2009-01-17 Thread Bobby Roberts
Hi Group... below you will see a code snippet which records a testimonial submitted off of a form into the database. Here's my setup... I'm hosting at webfaction with 3 instances of django running with 3 sites, 4 sites and 4 sites (only way I can avoid running over my RAM allotment). The sites

Regroup models in administration

2009-01-17 Thread didier rano
Hi all, In Django administration page, models are grouped by application/folder. Is it possible to change behavior by code ? Bye Didier Rano --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: ForeignKeys and select_related

2009-01-17 Thread cptnwinky
Thanks once again Karen. Could you throw me a bone though and explain how I extract the instance? I'm rather new to python and django; I come from a PHP background so I'm used to results from a db being rather straightforward. Thanks, Dave --~--~-~--~~~---~--~~ Yo

Re: ForeignKeys and select_related

2009-01-17 Thread Daniel Roseman
On Jan 17, 3:35 pm, cptnwinky wrote: > Thanks once again Karen. Could you throw me a bone though and explain > how I extract the instance? I'm rather new to python and django; I > come from a PHP background so I'm used to results from a db being > rather straightforward. > > Thanks, > > Dave res

Re: ForeignKeys and select_related

2009-01-17 Thread cptnwinky
Ah, I think I see. Thank you so much for your help. --~--~-~--~~~---~--~~ 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 gro

Re: ForeignKeys and select_related

2009-01-17 Thread ptone
As another person new to this, let me take a stab at this from a newcomers perspective. The result of the Torrent.objects.filter* statement returns a QuerySet object, which in a way is just a list of Torrent object instances, with a bunch of functions to further work with that list of instances (

Re: How do I manage the order of related objects?

2009-01-17 Thread scelerat
On Jan 15, 2:44 am, Beres Botond wrote: > And I'm not sure why you need the order, since they will be already > ordered by primary key (the most recent activity part added will have > highest primary key), and you can just use that. I need to keep track of the order explicitly because I may w

Definitive Captcha?

2009-01-17 Thread Tim
Hi - can anyone tell me what the de-facto standard is for adding Captcha support to a Django project? I have seen many implementations - the first Google hit for "django captcha" describes itself as "rough around the edges" and seems to not have much associated activity. By standard I just mean a

Queryset API distinct does not work?

2009-01-17 Thread neo
# Dummy model class Message(models.Model): """ """ subject = models.CharField(max_length=100) pub_date = models.DateTimeField(default=datetime.now()) class Topic(models.Model): """ """ title = models.CharField(max_length=100) message = models.ManyToManyField(Message, verbos

Re: Forwarding emails through django

2009-01-17 Thread Brian Victor
CLIFFORD ILKAY wrote: > Brian Victor wrote: >> I'd like to forward incoming emails to a distribution list defined by >> querying the User table. > In our hosting operation, we store virtual domain, virtual user, and > forwarder data for Postfix in PostgreSQL. The following should give you > some i

Changing data format in admin

2009-01-17 Thread Kless
I would show a numeric field with 3 digits into the admin interface list_display = ("%03d" % numeric,) But it fails because is required an int argument. Any idea to solve it? if there is solution. --~--~-~--~~~---~--~~ You received this message because you ar

Re: Changing data format in admin

2009-01-17 Thread Kless
Since admin interface isn't possible. On 17 ene, 17:19, Kless wrote: > I would show a numeric field with 3 digits into the admin interface > >    list_display = ("%03d" % numeric,) > > But it fails because is required an int argument. > > Any idea to solve it? if there is solution. --~--~---

Re: ForeignKeys and select_related

2009-01-17 Thread cptnwinky
Wow, this list is amazing. I've been asking questions on various python forums and never getting even a response. You all have helped me immensely and I really do appreciate it. Now, I suppose I should pay it forward by paying close attention to this list and helping others where I can. --~--~---

Re: Definitive Captcha?

2009-01-17 Thread Eric Abrahamsen
There's not really much needed to get captcha or recaptcha working with django, mostly just a class or two. When I was using recaptcha I found that this module: http://code.google.com/p/recaptcha-django/ did most of what I needed. If you're shopping, however, I'd recommend Akismet (http://ww

Re: Queryset API distinct does not work?

2009-01-17 Thread Karen Tracey
On Sat, Jan 17, 2009 at 10:30 AM, neo wrote: > > # Dummy model > > class Message(models.Model): > """ """ >subject = models.CharField(max_length=100) >pub_date = models.DateTimeField(default=datetime.now()) > > class Topic(models.Model): > """ """ >title = models.CharField(max_len

Re: unable to import django.forms.formsets

2009-01-17 Thread Atishay
On Jan 16, 10:06 pm, "alex.gay...@gmail.com" wrote: > On Jan 16, 5:47 pm, Atishay wrote: > > > > > Hi > > > when i try to import django formsets i get error. I am very new to > > django so was not able to fix this. > > > In [19]: from django.shortcuts import render_to_response > > > In [20]: fr

Re: unable to import django.forms.formsets

2009-01-17 Thread alex.gay...@gmail.com
On Jan 17, 12:59 pm, Atishay wrote: > On Jan 16, 10:06 pm, "alex.gay...@gmail.com" > wrote: > > > On Jan 16, 5:47 pm, Atishay wrote: > > > > Hi > > > > when i try to import django formsets i get error. I am very new to > > > django so was not able to fix this. > > > > In [19]: from django.sho

Re: unable to import django.forms.formsets

2009-01-17 Thread alex.gay...@gmail.com
On Jan 17, 12:59 pm, Atishay wrote: > On Jan 16, 10:06 pm, "alex.gay...@gmail.com" > wrote: > > > On Jan 16, 5:47 pm, Atishay wrote: > > > > Hi > > > > when i try to import django formsets i get error. I am very new to > > > django so was not able to fix this. > > > > In [19]: from django.sho

Django 1.0.2 runfcgi fails to start on Windows

2009-01-17 Thread Jon Prater
Hi, all. For various reasons, I prefer to use python 2.6 on my computer. Since mod_python and mod_wsgi won't work on Python 2.6, I have to use FCGI or switch to Python 2.5. I have flup installed without any problems. However, when I try to run this command: manage.py runfcgi method=threaded host

Re: ForeignKeys and select_related

2009-01-17 Thread cptnwinky
Now this is strange... >>> from torrent.search.models import Torrent >>> matching_torrents = Torrent.objects.filter(name__icontains='x360') >>> >>> for a_torrent in matching_torrents: ... dir(a_torrent) Produces this (of course more than once)... ['DoesNotExist', 'MultipleObjectsReturned',

Re: ForeignKeys and select_related

2009-01-17 Thread cptnwinky
Woops, nevermind. I found an error in my code above that. Sorry. On Jan 17, 12:28 pm, cptnwinky wrote: > Wow, this list is amazing. I've been asking questions on various > python forums and never getting even a response. You all have helped > me immensely and I really do appreciate it. > > Now,

Re: Django 1.0.2 runfcgi fails to start on Windows

2009-01-17 Thread Daniel Roseman
On Jan 17, 6:44 pm, Jon Prater wrote: > Hi, all. > For various reasons, I prefer to use python 2.6 on my computer.  Since > mod_python and mod_wsgi won't work on Python 2.6, I have to use FCGI > or switch to Python 2.5.  I have flup installed without any problems. > However, when I try to run thi

Re: unable to import django.forms.formsets

2009-01-17 Thread Daniel Roseman
On Jan 17, 5:59 pm, Atishay wrote: > On Jan 16, 10:06 pm, "alex.gay...@gmail.com" > wrote: > > What version of Django are you using? > > 0.96 version > > if it does not have formset then how can we do something like formset > without defining multiple forms in forms.py Upgrade to 1.02. Seriousl

Re: Django 1.0.2 runfcgi fails to start on Windows

2009-01-17 Thread Jon Prater
There are no precompiled binaries for mod_wsgi with Python 2.6. In order to use it, I would have to download the source code for it and compile it against Python 2.6, which I don't think is doable in Windows without making some sort of special adjustments to the source code. On Jan 17, 2:16 pm,

Re: Definitive Captcha?

2009-01-17 Thread Petite Abeille
On Jan 17, 2009, at 5:47 PM, Tim wrote: > Captcha Alternatively... "Stopping spambots with hashes and honeypots" -- Ned Batchelder, 2007 http://nedbatchelder.com/text/stopbots.html Cheers, -- PA. http://alt.textdrive.com/nanoki/ --~--~-~--~~~---~--~~ You re

Re: unable to import django.forms.formsets

2009-01-17 Thread Atishay
Thank you all. I will upgrade to 1.02 as well. Regards Atishay On Jan 17, 2:18 pm, Daniel Roseman wrote: > On Jan 17, 5:59 pm, Atishay wrote: > > > On Jan 16, 10:06 pm, "alex.gay...@gmail.com" > > wrote: > > > What version of Django are you using? > > > 0.96 version > > > if it does not have

Blueprint css versus YUI grids versus ?

2009-01-17 Thread ydjango
has anyone used Blue Print css? I have used YUI grids, yui is good, but I am having my share of problems with it. As soon as I need to float something, or add margins or padding, Yui grids go crazy? There has to be an easier solution than YUI grids for a 3 column layout. --~--~-~--~~

Trying to retrieve dynamically generated session key in template

2009-01-17 Thread dahpgjgamgan
Hi, A simple scenario: - A generic object detail view, on which I can vote for the displayed object. - vote is handled by custom view which sets a key in session (named "vote_) indicating that a vote was made - in the template I want to check for existance of this key, and if present, do

Re: Blueprint css versus YUI grids versus ?

2009-01-17 Thread Chris Amico
I found Blueprint pretty easy to grasp. I'm not a designer, but it's worked beautifully for me, at least on basic layouts, and from what I can tell it's a good foundation for building more complicated designs on top of. On Jan 17, 1:03 pm, ydjango wrote: > has anyone used Blue Print css? > > I h

Re: Blueprint css versus YUI grids versus ?

2009-01-17 Thread Petite Abeille
On Jan 17, 2009, at 10:03 PM, ydjango wrote: > has anyone used Blue Print css? Yes, Blueprint is a breeze to use as long as one enjoy grid based layouts. For example, Nanoki, a wiki engine implemented in Lua, uses Blueprint for its minimalist layout design. Online demo: http://svr225.ste

django searching wrong package for 'static.serve'

2009-01-17 Thread Tim Valenta
Hello all. Just trying to make django serve my static media files (css is my main test case right now) during development. I've included the lines in my URLconf as instructed by this page: http://docs.djangoproject.com/en/dev/howto/static-files/ My issue is that this line is causing a 500 error

Re: Blueprint css versus YUI grids versus ?

2009-01-17 Thread a b
can you please explain what are the differences between YUI and Blueprint? There is also http://960.gs/ Thanks On Sat, Jan 17, 2009 at 11:32 PM, Chris Amico wrote: > > I found Blueprint pretty easy to grasp. I'm not a designer, but it's > worked beautifully for me, at least on basic layouts, an

Re: django searching wrong package for 'static.serve'

2009-01-17 Thread Ramiro Morales
On Sat, Jan 17, 2009 at 6:19 PM, Tim Valenta wrote: > > Hello all. Just trying to make django serve my static media files > (css is my main test case right now) during development. I've > included the lines in my URLconf as instructed by this page: > http://docs.djangoproject.com/en/dev/howto/s

Re: Django 1.0.2 runfcgi fails to start on Windows

2009-01-17 Thread Graham Dumpleton
On Jan 18, 6:31 am, Jon Prater wrote: > There are no precompiled binaries for mod_wsgi with Python 2.6.  In > order to use it, I would have to download the source code for it and > compile it against Python 2.6, which I don't think is doable in > Windows without making some sort of special adju

Help using django audioplayer!

2009-01-17 Thread BTang
Hello everybody, I'm trying to add the django audioplayer from http://www.pyjax.net/blog/1/2007/06/27/django-flash-audioplayer/ to my site but am having probs so hopefully someone can help me :) I'm pretty new to all of this so I'll try and be as specific as possible since I'm sure it's not work

Re: Help using django audioplayer!

2009-01-17 Thread BTang
Looked into it a little bit more and opened up appenginetest2/pollango/audioplayer/templatetags/audioplayer.py One of the import statements is from django.utils.safestring import mark_safe This doesn't seem like a standard module in django... any thoughts? On Jan 17, 4:27 pm, BTang wrote: > H

Re: Help using django audioplayer!

2009-01-17 Thread Karen Tracey
On Sat, Jan 17, 2009 at 7:54 PM, BTang wrote: > > Looked into it a little bit more and opened up > appenginetest2/pollango/audioplayer/templatetags/audioplayer.py > > One of the import statements is > > from django.utils.safestring import mark_safe > > This doesn't seem like a standard module in

Re: Help using django audioplayer!

2009-01-17 Thread BTang
apparently safestring was introduced post .96 (-_-) http://groups.google.com/group/django-users/browse_thread/thread/433a486fec60ba2e Thanks I will continue updating my post :). haha On Jan 17, 4:54 pm, BTang wrote: > Looked into it a little bit more and opened up > appenginetest2/pollango/aud

Re: Django 1.0.2 runfcgi fails to start on Windows

2009-01-17 Thread Jon Prater
I don't have one, but if mingw would do I know where I can get it. On Jan 17, 5:19 pm, Graham Dumpleton wrote: > On Jan 18, 6:31 am, Jon Prater wrote: > > > There are no precompiled binaries for mod_wsgi with Python 2.6.  In > > order to use it, I would have to download the source code for it a

Re: Help using django audioplayer!

2009-01-17 Thread BTang
This is getting to be more difficult than I was expecting. Anyhoo since my last post I have dled the latest release of django (1.0.2 final) as for installing it... Is that even possible? I was reading up on it and it says that appengine has a limit of only allowing 1000 files and a maximum file si

Re: Form object has no attribute 'save' ( form.is_bound returns true )

2009-01-17 Thread shreyas k
noted . Thank you Malcolm . On Sun, Jan 11, 2009 at 3:17 PM, Malcolm Tredinnick wrote: > > On Sat, 2009-01-10 at 21:38 -0800, Dmitri13 wrote: >> Hi Guys, >> I am unable to save to table TEST_QST ,it returns error QstForm >> object has no attribute 'save' >> I have confirmed that >> form.is_bo

Re: Regroup models in administration

2009-01-17 Thread Malcolm Tredinnick
On Sat, 2009-01-17 at 10:00 -0500, didier rano wrote: > Hi all, > > In Django administration page, models are grouped by > application/folder. Is it possible to change behavior by code ? If you wanted something vastly different, you would need to override the AdminSite.index method (currently th

Re: unable to import django.forms.formsets

2009-01-17 Thread Atishay
Hello All Due to some production environment related issues, I am not able to upgrade to 1.02 to get formsets. I am able to create list of forms to emulate formset as suggested on http://collingrady.wordpress.com/2008/02/18/editing-multiple-objects-in-django-with-newforms/ However, I need somet

ELSE condition not working

2009-01-17 Thread shreyas k
Hi , I have pasted the code here , when i try to edit it always enters the else condition. delete works fine Please assist. if request.method == 'GET': #if request.has_key('edit_id'): if 'edit_id' in request.GET: # replace default form with form based on row to edit try: tst

Re: unable to import django.forms.formsets

2009-01-17 Thread Malcolm Tredinnick
On Sat, 2009-01-17 at 18:16 -0800, Atishay wrote: > Hello All > > Due to some production environment related issues, I am not able to > upgrade to 1.02 to get formsets. > > I am able to create list of forms to emulate formset as suggested on > http://collingrady.wordpress.com/2008/02/18/editing-

Re: ELSE condition not working

2009-01-17 Thread Malcolm Tredinnick
On Sun, 2009-01-18 at 10:21 +0800, shreyas k wrote: > Hi , > > I have pasted the code here , when i try to edit it always enters the > else condition. delete works fine > Please assist. There's a lot of code here and much of it isn't indented correctly (for example, there's a "try:" statement t

Re: Any libraries to create an online help system in Django or Python?

2009-01-17 Thread Jeff Anderson
alibongo wrote: > I admit I know little to nothing about Django and Python, but I've > been charged with creating an online help system to an application > we're writing in Django. I need to have online help features like > Search, Index, Next|Previous page, etc. So something that is displayed > in

Re: template tag not rendered - why not?

2009-01-17 Thread Brian Neal
I ran into this also. I need to do a {% get_comment_form for story as form %} early on in the template so I can do {{ form.media }} inside a block. I found that I had to call get_comment_form twice, once in a block for CSS and once in the block for content. {% extends 'base.html' %} {% block cus

Deploying Django tutorial part 4, redirecting problem, apache error

2009-01-17 Thread Adam Yee
It was a slam dunk for completing the tutorial in the development server, but I can't figure out this issue I'm having with the generic views while using my apache server. I'm unable to get the vote view to redirect correctly. My apache error seen here with both urls.py and views.py. The apache

Re: ELSE condition not working

2009-01-17 Thread shreyas k
Hi Malcolm, sorry the indent was lost when i copy pasted the code , the try statement is actually properly indented .And the if if request.method == 'GET': is followed by if request.method == 'POST': > i have also trimmed the code .I use post for update and add new .Editing and deleteing,listing i

Re: ELSE condition not working

2009-01-17 Thread Malcolm Tredinnick
On Sun, 2009-01-18 at 12:11 +0800, shreyas k wrote: > Hi Malcolm, > sorry the indent was lost when i copy pasted the code , the try > statement is actually properly indented .And the if if request.method > == 'GET': > is followed by if request.method == 'POST': > i have also trimmed the > code .I

Re: Any libraries to create an online help system in Django or Python?

2009-01-17 Thread Malcolm Tredinnick
On Sat, 2009-01-17 at 19:28 -0700, Jeff Anderson wrote: > I'd suggest using sphinx. It's designed for documenting Python projects, > and it's the documentation build system that Python and Django both use. Realise that Jeff means Sphinx as in http://sphinx.pocoo.org/ rather than Sphinx the SQL s

Re: Deploying Django tutorial part 4, redirecting problem, apache error

2009-01-17 Thread Malcolm Tredinnick
On Jan 18, 2:53 pm, Adam Yee wrote: > It was a slam dunk for completing the tutorial in the development > server, but I can't figure out this issue I'm having with the generic > views while using my apache server.  I'm unable to get the vote view > to redirect correctly. > > My apache error seen

Store python modules in a DB model

2009-01-17 Thread Greg Taylor
This is more of an experiment than anything, but I've got a model as such to store python modules: class StoredModule(models.Model): name = models.CharField() text = models.TextField() I want to be able to pull one of these and get access to the 'text' field as if it were a module. I can't

syncdb error

2009-01-17 Thread joti chand
hi all iam getting this error when i try to do syncdb please can anyone help c:\py_projects\mysite>python manage.py syncdb Traceback (most recent call last): File "manage.py", line 11, in execute_manager(settings) File "C:\Python25\Lib\site-packages\django\core\management\__init__.py",

Re: get_template & nodelist problem

2009-01-17 Thread Greg
> Nice to know - but I really wonder why it works that way (I guess I'll > have to look at this by myself). Perhaps would it be useful to > document that somewhere (djangosnippets or the wiki ?) I think so - had I known that was the problem it would have saved me a number of hours. I'm not entire

Re: syncdb error

2009-01-17 Thread Tirta K. Untario
You don't have mysqldb module on your system. Install it by using this: 'easy_install MySQLdb' --Tirta -Original Message- From: joti chand Date: Sun, 18 Jan 2009 20:21:45 To: Subject: syncdb error hi all iam getting this error when i try to do syncdb please can anyone help c:\py_