Re: Error when I use datetime.now()

2007-10-19 Thread Michael Newman
try datetime.now().__str__() or if you want to make it pretty try datetime.now().strftime(YourCustomFormatHere). Look at http://docs.python.org/lib/strftime-behavior.html#strftime-behavior Your problem is a datetime object is a not a string. Both those above examples turn it into a string. On

Error when I use datetime.now()

2007-10-19 Thread Greg
Hello, I have a class called Orders that tries to add the current date to it's comments field when it's saved. Here is my code: from datetime import datetime class Order(models.Model): comments = models.TextField("Comments", maxlength=1000) etc... def save(self):

Re: How do I do this JOIN...

2007-10-19 Thread Malcolm Tredinnick
On Fri, 2007-10-19 at 15:04 -0700, Dr Stitch wrote: > Greeting all! > > CAVEAT: I'm a Django newbie. I've spent about 3 hours searching, > reading, hazing over all the documentation and tutorials and it's > quite likely I have missed it or I'm way too new to Django to > understand the

Re: python mvc framework and java mvc framework

2007-10-19 Thread Kenneth Gonsalves
On 20-Oct-07, at 7:22 AM, Laszlo Marai wrote: > You can host multiple applications in django but as far as I could see > from the mailing list you'll have some problem if you want to have two > different django instances running under mod_python. not so. There have been reports of over 70

Re: Problem with query on m2m relation

2007-10-19 Thread Malcolm Tredinnick
On Fri, 2007-10-19 at 08:24 -0700, web-junkie wrote: > Hi, > > I have a m2m relationship from books to authors. A book can have 0-n > authors (yes, don't ask why there can be no authors). If I want to do > a search where I it should match the title or authors, I just gives me > books that have

Re: python mvc framework and java mvc framework

2007-10-19 Thread Kenneth Gonsalves
On 20-Oct-07, at 7:46 AM, Laszlo Marai wrote: >> >> not so. There have been reports of over 70 django instances running >> under mod_python in the same server. I have 12 in one server without >> problems. > > Wasn't there a question here about mod_python a few days ago where the > solution was

Re: python mvc framework and java mvc framework

2007-10-19 Thread Laszlo Marai
On Sat, 20 Oct 2007 07:40:27 +0530 Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > > You can host multiple applications in django but as far as I could see > > from the mailing list you'll have some problem if you want to have two > > different django instances running under mod_python. > > not

Re: python mvc framework and java mvc framework

2007-10-19 Thread James Bennett
On 10/19/07, Laszlo Marai <[EMAIL PROTECTED]> wrote: > So the java solutions need more configuration work but they might be more > flexible in some cases. And don't forget that you're comparing a set of > components (java) against a full stack (django). The configuration work > can be alleviated

Re: python mvc framework and java mvc framework

2007-10-19 Thread Laszlo Marai
On Sat, 20 Oct 2007 00:53:45 - Francis <[EMAIL PROTECTED]> wrote: Hi, I'm quite new to django but have a little insight into java. > On the other hand, java web framework look quite complicated with lot > of xml and manual configuration with no real advantage. Java verbosity Well, it

Re: Custom middleware for logging

2007-10-19 Thread Jeremy Dunck
On 10/19/07, Steve Potter <[EMAIL PROTECTED]> wrote: > > I would like to put together a piece of code that will test the > referer for each request and if it matches a predefined pattern it > would log that request as well as place a cookie on the client. > > Is custom middleware the correct

Custom middleware for logging

2007-10-19 Thread Steve Potter
I would like to put together a piece of code that will test the referer for each request and if it matches a predefined pattern it would log that request as well as place a cookie on the client. Is custom middleware the correct place to do this? Also, I'm not exactly clear how

python mvc framework and java mvc framework

2007-10-19 Thread Francis
Hi, For personnal information and curiosity, I was looking at the available java mvc web framework out there. One thing that I found particular, is that the dynamic language camp market their framework as productive environnement, easy and so. While the java framework emphasis on the

Custom Validator inside of a Custom Manipulator

2007-10-19 Thread Michael Newman
I am so close to getting this project done. The last little bit is all about validation. I have been following the docs pretty closely and am really at a loss as to what is going on right now. The Error: TypeError at /videoUploader/ __init__() got an unexpected keyword argument 'field_name' Here

More friends more money,get friends while get paid

2007-10-19 Thread my god
More friends more money,get friends while get paid http://groups.google.com/group/all-good-things/web/get-friends-while-get-paid --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

How do I do this JOIN...

2007-10-19 Thread Dr Stitch
Greeting all! CAVEAT: I'm a Django newbie. I've spent about 3 hours searching, reading, hazing over all the documentation and tutorials and it's quite likely I have missed it or I'm way too new to Django to understand the simplicity of the solution for the problem I'm presenting. So, feel free

Re: two block template tags on after another

2007-10-19 Thread johnny
What I need to do is, get the records from the database and split fields contents. One of the field, has commas separated contents and another field has - separated fields. In my view, I just do fetchall of database records and send to view. From the view, I do a for loop to go through each

Re: two block template tags on after another

2007-10-19 Thread Karen Tracey
On 10/19/07, Marty Alchin <[EMAIL PROTECTED]> wrote: > > So instead of trying to use output.custom_format_string1(), you'd just > do whatever your template tag needs to do. Which brings up the question, what are you (johhny) trying to do? I'm unable to grasp the intent of the block tags code

custom field doesnot validating at admin page

2007-10-19 Thread ViX
Hi, I am trying a custom field with a special data field have to handle. The data is a 4 digit with or with a letter at the end. eg. 9(a), 99(a), 999(a), (a). class CustCharField(models.CharField): def __init__(self, *args, **kwargs): models.CharField.__init__(self, max_length=5,

Re: two block template tags on after another

2007-10-19 Thread Marty Alchin
On 10/19/07, johnny <[EMAIL PROTECTED]> wrote: > upper() in output.upper(), I am assuming is the name of the template > tag. When I try to do it as in this example, I get an error: > > > > I didn't understand the output.upper() part. I think the > documentation above is written for people who

Re: two block template tags on after another

2007-10-19 Thread johnny
I am looking at this documentation: http://www.djangoproject.com/documentation/templates_python/#parsing-until-another-block-tag-and-saving-contents It has the following code: output = self.nodelist.render(context) return output.upper() upper() in output.upper(), I am assuming is the

Re: access session out of view, howto find out sessionkey?

2007-10-19 Thread Simon Oberhammer
wow, I'm glad there is a cookbook entry for this :-) thank you On Oct 19, 3:30 pm, skam <[EMAIL PROTECTED]> wrote: > You should be able to build a middleware similar > tohttp://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser, > getting request.session instead of request.user

Djangonauts in Amsterdam, Prague, or Krakow?

2007-10-19 Thread Brian Luft
My wife and I are travelling through Eastern Europe for the next 2 months. (we're starting in Amsterdam though). I'd love to meet up with any Djangonauts for a little chat. I like beer, wine, Django, and open source software if anyone can spare a few minutes for a chat :) Cheers -Brian

Re: Python 2.3 deployment

2007-10-19 Thread Malcolm Tredinnick
On Fri, 2007-10-19 at 13:29 +0100, Chris Hoeppner wrote: > Huh I lied. The django update only forced me to call that view with > POST, and now that I'm doing, it's throwing the same traceback. I'm not > sure what this might be. I'll check again with the system admins. When you tested at the

Re: two block template tags on after another

2007-10-19 Thread Karen Tracey
I suspect the template processing code is getting confused by: {% end_custom_format_string2 %) Which should be: {% end_custom_format_string2 %} That is, sqiggly brace, not paren, at the end. Karen --~--~-~--~~~---~--~~ You received this message because you

Re: Problem with Pagination

2007-10-19 Thread Greg
Rob, Thanks for the reply. In looking at that link I found out about the Paginator Tag. Which I think is what I need. However, in reading the documenation about that tag. It says 'To be used in conjunction with the object_list generic view.' I am not using a generic view. I have the

Re: Is posted data always in order?

2007-10-19 Thread Marty Alchin
On 10/19/07, Ken <[EMAIL PROTECTED]> wrote: > Thanks for your reply. It was a great help. I followed up on reading > the HTML spec and the posted data is returned in document order. Next > section. Ah, so it is! Color me crazy, but when information about how browsers should process data

Re: two block template tags on after another

2007-10-19 Thread johnny
There is a problem with default django for loop tag {% for %} {% endfor%} . Django template doesn't seem to like nested block tag inside for loop tag. {% for a_object in object_list %} {% load custom_format %} {% custom_format_string1 a_object.3 %} {{split_string_data1}} {%

Re: Is posted data always in order?

2007-10-19 Thread Ken
On Oct 19, 10:37 am, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > [1]http://www.w3.org/TR/html401/interact/forms.html#h-17.13.3 Thanks for your reply. It was a great help. I followed up on reading the HTML spec and the posted data is returned in document order. Next section. Ken [1]

Re: Python 2.3 deployment

2007-10-19 Thread Chris Hoeppner
Hi guys! Thanks for those responses. So, the random.randint function does exist: # python Python 2.3.5 (#1, Aug 25 2005, 09:17:44) [GCC 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import random >>> random.randint >

Re: 0.96 login issue with cookies

2007-10-19 Thread web-junkie
Did you activate the cache in Django? I once discovered an issue with that.. --~--~-~--~~~---~--~~ 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

Re: Is posted data always in order?

2007-10-19 Thread Marty Alchin
I haven't done any testing on this, but I'd like to point out one thing. The HTML spec[1] doesn't specify anything about browsers having to assemble the data set in document order. This means that even if Django made sure that the multivalues are put in POST in the order they were received, there

Re: Problem with Pagination

2007-10-19 Thread Rob Hudson
I don't think it's 100% to your specs but take a look at this: http://blog.localkinegrinds.com/2007/09/06/digg-style-pagination-in-django/ It's close enough for tweaking to get you 95% of the way there (maybe). --~--~-~--~~~---~--~~ You received this message

Problem with query on m2m relation

2007-10-19 Thread web-junkie
Hi, I have a m2m relationship from books to authors. A book can have 0-n authors (yes, don't ask why there can be no authors). If I want to do a search where I it should match the title or authors, I just gives me books that have an author. Not the other matches. See here for the code:

Re: Is posted data always in order?

2007-10-19 Thread Ken
I would like to add (if anyone who writes django documentation is reading) a statement explicitly confirming or denying this in the documentation would be nice. The fact that django sub-classed a dict to handle multiple values posted by a form seems to suggest that multiple values are returned

Re: Is posted data always in order?

2007-10-19 Thread Ken
On Oct 18, 8:07 pm, Thejaswi Puthraya <[EMAIL PROTECTED]> wrote: > request.POST is a python dictionary and the keys need not be ordered. You misunderstand. I know dicts are not ordered in the sense lists are. My question is this: Suppose I have a form that returns multiple values for a

Re: py2app & py2ex

2007-10-19 Thread Francis Lavoie
Hi, I though of doing something similar a couple of month ago without reading about It, I somehow change my mind. I really like django, but I don't think it is well suite for this kind of use. What i decide to do is a python client application which use the web server as a web service to update

Re: Uploading and then accessing files ... ?

2007-10-19 Thread dbee
OK got it thanks - a redirect works fine :-) On Oct 19, 3:14 pm, dbee <[EMAIL PROTECTED]> wrote: > I'm using the Django alias site_media redirect to access static files > on my server. I have an aspect to my django application whereby the > user can upload his own files and then access those

Uploading and then accessing files ... ?

2007-10-19 Thread dbee
I'm using the Django alias site_media redirect to access static files on my server. I have an aspect to my django application whereby the user can upload his own files and then access those files to include them in newsletters etc... The problem of course is that the user will upload files to

Uploading and then accessing files ... ?

2007-10-19 Thread dbee
I'm using the Django alias site_media redirect to access static files on my server. I have an aspect to my django application whereby the user can upload his own files and then access those files to include them in newsletters etc... The problem of course is that the user will upload files to

Re: Ordering by foreign key, class Meta

2007-10-19 Thread Malcolm Tredinnick
On Fri, 2007-10-19 at 06:54 -0700, äL wrote: > I would like to order a list in a view by foreign key. If I try > ordering how in the > code below my list is ordered by 'person'. And this means that the > list > ist ordered by the ID of the table Person. But I need a list ordered > by 'nameLast'.

Anyone running mod_python for Python 2.5 on Mac OS X?

2007-10-19 Thread Ulf Kronman
Hi all, I have severe problems to get my Apache 2 to run mod_python together with Python 2.5 on Mac OS X 10.4.10. This is my sad story: I'm developing a small in-house publication database for bibliometric purposes. I run a Ubuntu Linux-based server with Apache, Python and PostgreSQL, but I

Ordering by foreign key, class Meta

2007-10-19 Thread äL
I would like to order a list in a view by foreign key. If I try ordering how in the code below my list is ordered by 'person'. And this means that the list ist ordered by the ID of the table Person. But I need a list ordered by 'nameLast'. Thus I changed ordering 'person' into 'person.nameLast'.

py2app & py2exe

2007-10-19 Thread ArqEco
Hello friends, "The Story That Won't Go Away" comes back! I am a newcomer to Django and just read some posts from one year ago about creating standalone programs with Django and py2app or py2exe. What is the status of this issue now? Anyone found a solution? I need to develop a very simple

Re: Getting contents of a Http Response Object

2007-10-19 Thread dbee
Aha, thanks dude :-) On Oct 19, 12:55 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Fri, 2007-10-19 at 04:32 -0700, dbee wrote: > > I'm creating a pdf document dynamically, I need to include barchart > > data in the document. The bar chart data is also created dynamically > > with

Re: Getting contents of a Http Response Object

2007-10-19 Thread dbee
Hi Matthew, Thanks. The problem is though, that I'm following the docs and using another class to 'shape' my barchart ... # Use this one for client signup class interests_class(Drawing): format = 'gif' def __init__(self, width=400, height=250, *args, **kw):

Re: access session out of view, howto find out sessionkey?

2007-10-19 Thread skam
You should be able to build a middleware similar to http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser , getting request.session instead of request.user --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: two block template tags on after another

2007-10-19 Thread Karen Tracey
On 10/18/07, johnny <[EMAIL PROTECTED]> wrote: [snip] {% custom_format_string1 a_object.3 %} ... {% custom_format_string2 a_object.4 %} ... @register.tag(name="custom_format_sting1") ... @register.tag(name="custom_format_sting2") The names you register are missing the r's in "string",

access session out of view, howto find out sessionkey?

2007-10-19 Thread Simon Oberhammer
I need to access a session-field in a model, I found this: http://www.djangoproject.com/documentation/sessions/#using-sessions-out-of-views but what would be the clean way to find out the session-key? or is there another way to get the "current" session in a model? btw: Users are not

Re: Python 2.3 deployment

2007-10-19 Thread Thomas Guettler
> File > "/usr/lib/python2.3/site-packages/django/contrib/sessions/models.py", line > 19, in get_new_session_key session_key = md5.new("%s%s%s%s" % > (random.randint(0, sys.maxint - 1), os.getpid(), time.time(), > settings.SECRET_KEY)).hexdigest() > > AttributeError: 'module' object has no

Re: two block template tags on after another

2007-10-19 Thread johnny
Can someone help me, plz? I have two block tags that take an argument and then sets a variable in the template. The two block tags are inside the template "for loop" tags, one after another. On Oct 18, 3:00 pm, johnny <[EMAIL PROTECTED]> wrote: > I have templatetags/custom_format.py, and in

Re: Python 2.3 deployment

2007-10-19 Thread Chris Hoeppner
Huh I lied. The django update only forced me to call that view with POST, and now that I'm doing, it's throwing the same traceback. I'm not sure what this might be. I'll check again with the system admins. El vie, 19-10-2007 a las 21:12 +1000, Malcolm Tredinnick escribi�: > On Fri, 2007-10-19

Getting contents of a Http Response Object

2007-10-19 Thread dbee
I'm creating a pdf document dynamically, I need to include barchart data in the document. The bar chart data is also created dynamically with report lab. I can get the barchart data at my url ... def barchart_interests(request): . #get a GIF (or PNG, JPG, or whatever)

Re: Python 2.3 deployment

2007-10-19 Thread Chris Hoeppner
Thanks, Malcolm! For some reason, updating django to trunk solved it. My system admins told me kindly that it's not their problem. Very nice indeed. El vie, 19-10-2007 a las 21:12 +1000, Malcolm Tredinnick escribi�: > On Fri, 2007-10-19 at 11:56 +0100, Chris Hoeppner wrote: > > Hey guys! > >

Re: Getting contents of a Http Response Object

2007-10-19 Thread Malcolm Tredinnick
On Fri, 2007-10-19 at 04:32 -0700, dbee wrote: > I'm creating a pdf document dynamically, I need to include barchart > data in the document. The bar chart data is also created dynamically > with report lab. I can get the barchart data at my url ... > > def barchart_interests(request): > >

Re: Python 2.3 deployment

2007-10-19 Thread Malcolm Tredinnick
On Fri, 2007-10-19 at 11:56 +0100, Chris Hoeppner wrote: > Hey guys! > > I have no choice but deploy to this server, running CentOS 4.4, with no > option to upgrade python beyond 2.3, and I'm getting this: > > Mod_python error: "PythonHandler django.core.handlers.modpython" > > Traceback (most

Python 2.3 deployment

2007-10-19 Thread Chris Hoeppner
Hey guys! I have no choice but deploy to this server, running CentOS 4.4, with no option to upgrade python beyond 2.3, and I'm getting this: Mod_python error: "PythonHandler django.core.handlers.modpython" Traceback (most recent call last): File

Re: Getting the right data to the template

2007-10-19 Thread Malcolm Tredinnick
On Thu, 2007-10-18 at 15:25 -0700, Mikkel Høgh wrote: > I have a bit of a problem - I'm creating a GTD-focused task management > app for Django, mainly for my own benefit, but it's open source if any > one cares. > > I've been trying to implement a taxonomy system like the one Drupal > uses.

Stub django project

2007-10-19 Thread Antoni Aloy
Hello! I have just created a project at http://code.google.com/p/appfusedjango/, the idea is to have a simple application to start with which shows and solves some of the common questions one can have when starts a project. Hope it helps! -- Antoni Aloy López Binissalem - Mallorca