Re: djangobook.com, chapter 5, __init__() got an unexpected keyword argument 'maxlength'

2008-12-01 Thread Roland van Laar
djan wrote: > Hello, > > I'm following along with djangobook.com, and I have a problem in > chapter 5 that I cannot resolve. I am using OpenSuSE-11.0, Python > 2.5.2, sqlite3-3.5.7-17.1 (and incidentally, this same error occurs > with MySQL). > > > File "$HOME/djcode/mysite/books/models.py",

Re: Usage of {% url %}

2008-12-01 Thread Roy
I see, so I cannot use {% url %} in this case. Thanks! On Dec 1, 3:53 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sun, 2008-11-30 at 23:42 -0800, Roy wrote: > > Hi, > > > I have the following in one of my templates: > > Flag > > > But I'm getting a TemplateSyntaxError: > > > Caught a

Re: Django - processing flatpages problem.

2008-12-01 Thread Grzegorz Szymański
I used DEBUG_PROPAGATE_EXCEPTIONS variable and thanks to this found a bug in my application. On Sunday 30 of November 2008 12:22:25 Grzegorz Szymański wrote: > Thank you for the tip. It works well. > > I have problem with processing flat pages. > When debug is switched to True the error appear in

Re: OpenId

2008-12-01 Thread Roland van Laar
Chris wrote: > I have been looking into using OpenId and I discovered that there are > to 2 django libraries that handle this: django_openId and > django_authopenid. Any opinions on the two? Not sure which one I > should go with. > I depends on what you want to do, be a relying party, i.e. the

Re: Does Django have a function that can be called by every view function ?

2008-12-01 Thread David Shieh
Thanks , David Zhou , I will find some information for decorator And also , I will surf for middleware . Thank you very much , Malcolm. On Dec 1, 3:55 pm, "David Zhou" <[EMAIL PROTECTED]> wrote: > On Mon, Dec 1, 2008 at 2:23 AM, David Shieh <[EMAIL PROTECTED]> wrote: > > I dont' know whether thi

Re: djangobook.com, chapter 5, __init__() got an unexpected keyword argument 'maxlength'

2008-12-01 Thread Praveen
write max_length instead of maxlength On Dec 1, 1:01 pm, Roland van Laar <[EMAIL PROTECTED]> wrote: > djan wrote: > > Hello, > > > I'm following along with djangobook.com, and I have a problem in > > chapter 5 that I cannot resolve. I am using OpenSuSE-11.0, Python > > 2.5.2, sqlite3-3.5.7-17.1 (

Form POST Issue

2008-12-01 Thread please smile
Hi All, I need to pass the "totalItems" value as argument to Paginator(disp, totalItems) function if It is POST. But it throws the error "coercing to Unicode: need string or buffer, int found" How do I rectify it. Thanks def detail(request, gallery_slug, page=0): if request.m

How can I use more than 24 hours in TimeField?

2008-12-01 Thread K*K
As you know time data type in mysql allow to be used more than 24 hours, but when there is a more than 24 hours record in the table such as 72:00:00, and then query the table with Django ORM, it will report 'ValueError hour must be in 0..23'. I'm porting a old program that record rum times of th

limiting admin's access on a per site basis

2008-12-01 Thread Evan Reiser
We have multiple django sites using the same database, and have different admins for each of the django sites who's access we would like to limit on a per site basis. I was wondering if anyone had an experience or advice about how to do this. I think it would be possible to accomplish by creating

Debugging Django with PyDev

2008-12-01 Thread Awad
Hi All, I've recently just updated my eclipse to Ganymede and Pydev to 1.3.24. And ever since then, I've been unable to debug any of my Django Projects. I've gone through the process of setting up a debug launch configuration with the "runserver --noreload" argument and yet, after adding breakpo

different database access

2008-12-01 Thread ReneMarxis
hi i am new to django and evaluating if i could use it for one new application. I did some mal app with django last days and i am impressed :) however i need some infomation from expirienced developers. 1) Is it possible to connect to more than one database, and beeing able to use the model-fun

Naming a ForeignKey field in the Admin

2008-12-01 Thread The Agregator
Hi I'm new here - in Django and python, more of a Php and wordpress myself. anyway - here is my question, hope someone knows the answer. I have 2 classes - components and customers. every component has a field that says whos the related customer. like this: class Component(models.Model): #

XML templates

2008-12-01 Thread Vicky
Can we use XML files as templates instead of HTML? --~--~-~--~~~---~--~~ 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 grou

Re: XML templates

2008-12-01 Thread Eric Abrahamsen
On Dec 1, 2008, at 7:51 PM, Vicky wrote: > > Can we use XML files as templates instead of HTML? Anything that comes as a plain text file can be produced by a template: HTML, XML, plain text, email, iCAL, source code... Yours, Eric > > > --~--~-~--~~~---~--~---

Re: Naming a ForeignKey field in the Admin

2008-12-01 Thread Fabio Natali
The Agregator wrote: [...] > CustomerID = models.ForeignKey(Customer) > The problem is that I want it to say something else, like "Customer > Name" Try with CustomerID = models.ForeignKey(Customer, verbose_name="Customer Name") HTH, -- Fabio Natali --~--~-~--~~-

Re: Naming a ForeignKey field in the Admin

2008-12-01 Thread Nitzan Brumer
Worked like a charm Thanks On Mon, Dec 1, 2008 at 1:50 PM, Fabio Natali <[EMAIL PROTECTED]>wrote: > > The Agregator wrote: > [...] > > CustomerID = models.ForeignKey(Customer) > > > The problem is that I want it to say something else, like "Customer > > Name" > > Try with > > Customer

Re: Image uploads on media temple (gs) failing

2008-12-01 Thread Adda Badda
Okay, perhaps someone could suggest possible techniques for debugging file uploads? On Nov 29, 4:10 pm, Adda Badda <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm having difficulties getting image uploads to work on my > mediatemple gs hosting as part of an admin system. Occasionally one > file will

printing from the admin?

2008-12-01 Thread Nitzan Brumer
I have a class called customers which generates in the admin some kind of a "phone book". I want to allow the user to print all the records using a print button. I guess I can do it with a custom CSS file but I hope there is a simple way. Is there? -- Nitzan Brumer Http://n2b.org --~--~---

Re: Does Django have a function that can be called by every view function ?

2008-12-01 Thread martyn
David, +1 for decorator. That let you use it or not in each view. On Dec 1, 9:30 am, David Shieh <[EMAIL PROTECTED]> wrote: > Thanks , David Zhou , I will find some information for decorator > And also , I will surf for middleware . > > Thank you very much , Malcolm. > > On Dec 1, 3:55 pm, "Dav

urlpatterns question

2008-12-01 Thread Earl Lapus
hi all, I'm new to django and python. I have a small question about urlpatterns and it may sound silly to some so please bear with me. I noticed a bit of difference between a urlpatterns callback function of an admin site from that of an app. The callback function for an app requires single quot

Displaying items of a linked object in a template

2008-12-01 Thread Marco
Hello, I have this in my models.py : class Device(models.Model): name = models.CharField(max_length=30) class DeviceProperty(models.Model): key = models.CharField(max_length=30) value = models.CharField(max_length=80) device = models.ForeignKey(Device) In my vie

Re: Displaying items of a linked object in a template

2008-12-01 Thread Daniel Roseman
On Dec 1, 12:15 pm, Marco <[EMAIL PROTECTED]> wrote: > Hello, > > I have this in my models.py : > > class Device(models.Model): >         name = models.CharField(max_length=30) > > class DeviceProperty(models.Model): >         key = models.CharField(max_length=30) >         value = models.CharFiel

Re: Form POST Issue

2008-12-01 Thread Karen Tracey
On Mon, Dec 1, 2008 at 4:08 AM, please smile <[EMAIL PROTECTED]>wrote: > Hi All, > > I need to pass the "totalItems" value as argument to Paginator(disp, > totalItems) function > > if It is POST. > > But it throws the error > > "coercing to Unicode: need string or buffer, int found" > > > How do

Re: urlpatterns question

2008-12-01 Thread Karen Tracey
On Mon, Dec 1, 2008 at 7:42 AM, Earl Lapus <[EMAIL PROTECTED]> wrote: > > hi all, > > I'm new to django and python. I have a small question about > urlpatterns and it may sound silly to some so please bear with me. > > I noticed a bit of difference between a urlpatterns callback function > of an a

Full time Django developer wanted in/near Atlanta

2008-12-01 Thread Chris H.
We're looking for a great Django/Python developer to join our small team at ajc.com. Check out the job posting at Django Gigs [0] or at Craigslist[1]. Here are some of the benefits to working on our team: * We're a small team -- but full of great people like Maura [2] and Zellyn [3] * Our pro

Local flavor and admin (zip-code)

2008-12-01 Thread Fabio Natali
Hi everybody! I'm having difficulties while trying to insert a zip-code field in one of my models. I'd like to rely upon some italian local flavor stuff, so to get some validation for free. Here comes my models.py: from django.contrib.localflavor.it import forms class DittaDipendenti(models.Mo

testing template tags

2008-12-01 Thread Richard Szopa
Hello, I have written some doctests for my custom template tags, but `manage.py test my_app' doesn't seem to notice it. There is an __init__.py file in the templatetags directory, but apparently that is not sufficient. Thanks in advance, -- Richard --~--~-~--~~~-

Re: Does Django have a function that can be called by every view function ?

2008-12-01 Thread Jon Loyens
Another +1 for decorators. In fact, the example David S uses authentication and logins as an example of what he wants to do and its already handled as a decorator thus giving him a decent pattern to follow. David S, I'd suggest you look up the @login_required decorator and even look through the

Re: GeoDjango question about US zipcode lookup and spatial query

2008-12-01 Thread Justin Bronn
> Thanks Justin, I was using MySQL and it looks like I do need Postgres to get > the best gis support. > Do people normally switch their DB backend entirely or do they start a new > project for geo stuff and connect the main site to this as a separate > backend? I can see the pros and cons of each

Re: Multi Table Inheritance with Mulitple Children

2008-12-01 Thread ttw
bit worrying that you consider the traceback to be 'gumph' but since the error says specifically that the 'created' column cannot be null, it sounds like your DB and model are out of sync. as for the actual problem, you'll have to appreciate that creating a 'User' also creates a 'Person', who's a

Re: Displaying items of a linked object in a template

2008-12-01 Thread bruno desthuilliers
On 1 déc, 14:20, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Dec 1, 12:15 pm, Marco <[EMAIL PROTECTED]> wrote: > > > > > Hello, > > > I have this in my models.py : > > > class Device(models.Model): > > name = models.CharField(max_length=30) > > > class DeviceProperty(models.Model): > >

Re: Multi Table Inheritance with Mulitple Children

2008-12-01 Thread Fergus
On Dec 1, 3:48 pm, ttw <[EMAIL PROTECTED]> wrote: > bit worrying that you consider the traceback to be 'gumph' ... Gumph in the sense that it didn't seem awfully relevant in this case, as the exception was reasonably self-explanatory. I'm very grateful for Python's stack trace in other circumstan

Re: djangobook.com, chapter 5, __init__() got an unexpected keyword argument 'maxlength'

2008-12-01 Thread djan
Thank you all! This did the trick, and I'm sure it will help be avoid future problems. On Dec 1, 9:57 am, Praveen <[EMAIL PROTECTED]> wrote: > write max_length instead of maxlength > > On Dec 1, 1:01 pm, Roland van Laar <[EMAIL PROTECTED]> wrote: > > > djan wrote: > > > Hello, > > > > I'm followi

Overwriting Django Authentication / Session Logic

2008-12-01 Thread Devye
Hi, I am trying to integrate a Django app with an in-house developed webapp. The biggest hurdle is to consolidate the two sets of users data and session mechanism. I was wondering if it is easy in Django to customize the authentication logic and session logic? If so, how would I go about it? I d

Re: Overwriting Django Authentication / Session Logic

2008-12-01 Thread Alex Koshelev
Have you read this - http://docs.djangoproject.com/en/dev/topics/auth/#other-authentication-sources? On Mon, Dec 1, 2008 at 19:02, Devye <[EMAIL PROTECTED]> wrote: > > Hi, > > I am trying to integrate a Django app with an in-house developed > webapp. The biggest hurdle is to consolidate the two

Re: Multi Table Inheritance with Mulitple Children

2008-12-01 Thread tofergus
On 01.12-07:59, Fergus wrote: [ ... ] > > bit worrying that you consider the traceback to be 'gumph' ... > > Gumph in the sense that it didn't seem awfully relevant in this case, > as the exception was reasonably self-explanatory. I'm very grateful > for Python's stack trace in other circumstance

Re: Receiving xml via HTTP POST

2008-12-01 Thread chefsmart
Daniel Roseman suggests a very simple and easy to implement solution. Malcolm Tredinnick explained the usage of request.POST and request.raw_post_data. I think I would like to keep it pure and go towards implementing django views that will access and process request.raw_post_data. The AIR app will

Re: printing from the admin?

2008-12-01 Thread David Zhou
On Mon, Dec 1, 2008 at 7:33 AM, Nitzan Brumer <[EMAIL PROTECTED]> wrote: > I have a class called customers which generates in the admin some kind of a > "phone book". > I want to allow the user to print all the records using a print button. > > I guess I can do it with a custom CSS file but I hope

Custom inline form

2008-12-01 Thread mrsource
In the inline model option I have overriden the inline form with a custom form where I only added a choices widget, now the validation has a wrong behaviour...more precisely if I have set extra property to 2 in inline model options, when I click "Save" django try to validate even the two empty ex

Re: Is the initial value of a form field available in the template?

2008-12-01 Thread ChrisK
> I think you really need to explain what the real problem is that you're > trying to solve, because you're asking a question that is too specific. Fair enough. It's been several days, so I had to dredge a bit to remember :-) I think the basic issue is that there are some fields in the object t

typo in the Django book

2008-12-01 Thread coldlight
I have just start to read the on-line Django book.I don't know whether this is the best place to report typos, or whether typos are expected to be reported at all. But here is one, at http://www.djangobook.com/en/1.0/chapter03/ in the small selection of the regular expression table, the followi

Database model fields question

2008-12-01 Thread sned
Is there a way to tell django to use a specific function when selecting data from a model? The sql is relatively simple, but I don't know how to convert that to model syntax. Here's the issue: a table I'm working with stores ip addresses as a 10 digit integer. To get the ip address out of that

Model similar to a spreadsheet

2008-12-01 Thread Stefan
Hello, I'm new to Django and have some problems on how to create the models. What I want to do is something similar to a spreadsheet, but with more than one data field per intersection. Basically like this: (http://dpaste.com/hold/95128/) Items/Members: Person_A | Person_B | Person_C Item_1: x

Using % with psycopg2

2008-12-01 Thread Siah
Hi, The following code fails on windows, and works just fine on my unix box. To fix the problem in windows, I must replace('%', '%%') so its internal string formatting doesn't fail on me. Should I file this bug for psycopg2? from django.db import connection cursor=connection.cursor() cursor.exec

Re: How can I use more than 24 hours in TimeField?

2008-12-01 Thread julianb
On Dec 1, 11:03 am, "K*K" <[EMAIL PROTECTED]> wrote: > As you know time data type in mysql allow to be used more than 24 > hours, but when there is a more  than 24 hours record in the table > such as 72:00:00, and then query the table with Django ORM, it will > report 'ValueError hour must be in 0

Re: Database model fields question

2008-12-01 Thread Daniel Roseman
On Dec 1, 6:48 pm, sned <[EMAIL PROTECTED]> wrote: > Is there a way to tell django to use a specific function when > selecting data from a model? > > The sql is relatively simple, but I don't know how to convert that to > model syntax. > > Here's the issue:  a table I'm working with stores ip addr

Re: Receiving xml via HTTP POST

2008-12-01 Thread Daniel Roseman
On Dec 1, 12:48 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sun, 2008-11-30 at 01:15 -0800, Daniel Roseman wrote: > > [...] > > > No doubt someone will correct me if I'm wrong, but I don't think there > > *is* any other way of receiving a file via POST except via a form. > > You gave an

Re: typo in the Django book

2008-12-01 Thread coldlight
Another one: in the file http://new-media.djangobook.com/content/en/1.0/chapter03/404.png there listed ^/now$, but the book used ^/time$ instead. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Re: typo in the Django book

2008-12-01 Thread James Bennett
On Mon, Dec 1, 2008 at 3:05 PM, coldlight <[EMAIL PROTECTED]> wrote: > Another one: in the file Please don't do this; this is not the errata mailing list for "The Definitive Guide to Django", it is the mailing list for discussion of and by users of Django, and every time you post a message here y

Re: Is the initial value of a form field available in the template?

2008-12-01 Thread DavidA
> I think the basic issue is that there are some fields in the object > that I'd like to display but not have editable, and it's not at all > clear to me how to make that happen in the form processor. The values > are dynamic, so they can't be in the template. I often have this need so I created

Re: Form POST Issue

2008-12-01 Thread Karen Tracey
In the future, if you click "Switch to copy-and-paste-view" and then just copy and paste the contents of the traceback window, that is generally easier to deal with. The traceback in your screenshot (which shows your photosapp/views.py on line 104 calling paginator.page) doesn't match up with the

How to return Admin to previous filters after save?

2008-12-01 Thread cyberjack
I have an admin interface managing a few thousand records. Finding a record requires heavy use of multiple list_filter selections. However, once a user edits a record, the admin interface redirects to the root admin URL and loses the filter state. Is there an easy way to have the admin editor ret

django-admin makemessages - excluding folders

2008-12-01 Thread Aljosa Mohorovic
i usually use svn:externals to add django, extensions, evolution and other stuff to my projects but when i use makemessages in this situation it generates locale for everything in current folder. i've added some code to makemessages to enable excluding folders by pattern to resolve my current situ

Re: Does Django have a function that can be called by every view function ?

2008-12-01 Thread David Shieh
Thank you , guys ~ Your help are really good for me ~ On Dec 1, 11:23 pm, Jon Loyens <[EMAIL PROTECTED]> wrote: > Another +1 for decorators.  In fact, the example David S uses > authentication and logins as an example of what he wants to do and its > already handled as a decorator thus giving him

Re: testing template tags

2008-12-01 Thread Malcolm Tredinnick
On Mon, 2008-12-01 at 07:14 -0800, Richard Szopa wrote: > Hello, > > I have written some doctests for my custom template tags, but > `manage.py test my_app' doesn't seem to notice it. There is an > __init__.py file in the templatetags directory, but apparently that is > not sufficient. Are you

Re: urlpatterns question

2008-12-01 Thread Earl Lapus
On Mon, Dec 1, 2008 at 10:06 PM, Karen Tracey <[EMAIL PROTECTED]> wrote: >> >> So, what is the difference between a callback function that is >> enclosed on single quotes from that which is not? > > Nothing really: > > http://docs.djangoproject.com/en/dev/topics/http/urls/#passing-callable-objects

Re: How to return Admin to previous filters after save?

2008-12-01 Thread Malcolm Tredinnick
On Mon, 2008-12-01 at 14:54 -0800, cyberjack wrote: > I have an admin interface managing a few thousand records. Finding a > record requires heavy use of multiple list_filter selections. However, > once a user edits a record, the admin interface redirects to the root > admin URL and loses the fil

Re: Is the initial value of a form field available in the template?

2008-12-01 Thread ChrisK
> I often have this need so I created a custom widget where I just set > the readonly attribute on a TextInput widget: > > class LabelWidget(forms.TextInput): Thanks but ... it seems that form.as_p doesn't understand how to display this! --~--~-~--~~~---~--~~ You

Re: django-admin makemessages - excluding folders

2008-12-01 Thread Malcolm Tredinnick
On Mon, 2008-12-01 at 16:00 -0800, Aljosa Mohorovic wrote: > i usually use svn:externals to add django, extensions, evolution and > other stuff to my projects but when i use makemessages in this > situation it generates locale for everything in current folder. > i've added some code to makemessag

Re: Is the initial value of a form field available in the template?

2008-12-01 Thread ChrisK
On Dec 1, 5:44 pm, ChrisK <[EMAIL PROTECTED]> wrote: > > I often have this need so I created a custom widget where I just set > > the readonly attribute on a TextInput widget: > > > class LabelWidget(forms.TextInput): > > Thanks but ... it seems that form.as_p doesn't understand how to > display

Re: urlpatterns question

2008-12-01 Thread Malcolm Tredinnick
On Tue, 2008-12-02 at 09:31 +0800, Earl Lapus wrote: > On Mon, Dec 1, 2008 at 10:06 PM, Karen Tracey <[EMAIL PROTECTED]> wrote: > >> > >> So, what is the difference between a callback function that is > >> enclosed on single quotes from that which is not? > > > > Nothing really: > > > > http://do

Re: mod_python setup on Apache virtual host

2008-12-01 Thread Abe
I just witnessed the same behavior but haven't found the solution. I'm using Ubuntu 8.04, Django 1.0, and Apache 2.2 with mod_python. Abe On Nov 15, 10:16 pm, Chuck22 <[EMAIL PROTECTED]> wrote: > I did not use ErrorDocument directives in my httpd.config. > > Here is my Apache error log: > > [Su

Re: urlpatterns question

2008-12-01 Thread Earl Lapus
On Tue, Dec 2, 2008 at 9:50 AM, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > Yes, because admin.site.root isn't a function. It's a method on a class > (which implies a difference in the way things are called). > > There's a bit of history going on here: in the early days, all the view > fun

Re: urlpatterns question

2008-12-01 Thread Malcolm Tredinnick
On Tue, 2008-12-02 at 10:07 +0800, Earl Lapus wrote: > On Tue, Dec 2, 2008 at 9:50 AM, Malcolm Tredinnick > <[EMAIL PROTECTED]> wrote: > > > > > > Yes, because admin.site.root isn't a function. It's a method on a class > > (which implies a difference in the way things are called). > > > > There's

Model that only needs 1 data row

2008-12-01 Thread JGAllen23
I am building a website for a client and one of the pages they need is an "about us" page which would just require 1 row of data. What is the best way to handle this case where a model would only need 1 data row? --~--~-~--~~~---~--~~ You received this message beca

Re: Model that only needs 1 data row

2008-12-01 Thread alex.gay...@gmail.com
Take a look at django.contrib.flatpages. On Dec 1, 9:36 pm, JGAllen23 <[EMAIL PROTECTED]> wrote: > I am building a website for a client and one of the pages they need is > an "about us" page which would just require 1 row of data.  What is > the best way to handle this case where a model would on

Re: Model that only needs 1 data row

2008-12-01 Thread CLIFFORD ILKAY
JGAllen23 wrote: > I am building a website for a client and one of the pages they need is > an "about us" page which would just require 1 row of data. What is > the best way to handle this case where a model would only need 1 data > row? Override the save() method for that model. E.g. class Feat

admin.py -- AlreadyRegistered

2008-12-01 Thread djan
Hello. I'm following along with djangobook.com and trying to make necessary changes to port django to version 1.0. In Django's Site Administration, chapter 6, I run into the error: Exception Type: AlreadyRegistered Exception Value:The model Book is already registered Exception L

Re: Model similar to a spreadsheet

2008-12-01 Thread Dan
I don't understand what you are trying to do. Would you mind describing the real life problem under it rather than how you try to solve it? It would help understand what you need. On Mon, Dec 1, 2008 at 2:10 PM, Stefan <[EMAIL PROTECTED]> wrote: > > Hello, > > I'm new to Django and have some prob

Getting form data using Form object

2008-12-01 Thread Felipe Sodré Silva
Hi everyone. When I get the data from a form, I'm processing it using request.POST object, like this: def process(request): ..var = request.POST['some_field_id'] I want to know if it's possible to get these values using a Form object, like this: def process(request): ..form = MyFormClass(reques

Re: Getting form data using Form object

2008-12-01 Thread Malcolm Tredinnick
On Tue, 2008-12-02 at 02:30 -0200, Felipe Sodré Silva wrote: > Hi everyone. > > When I get the data from a form, I'm processing it using request.POST > object, like this: > > def process(request): > ..var = request.POST['some_field_id'] > > I want to know if it's possible to get these values u

time help (again)

2008-12-01 Thread Bobby Roberts
ok day 7 and no luck. I really need help. I need to calculate the difference between two dates, one pulled from the database, and one as the NOW time. I'm hoping someone out there can help me and explain the code to me. Yes I've read the docs but they don't make sense to me thus the reason i'm

Re: Getting form data using Form object

2008-12-01 Thread Felipe Sodré Silva
Thanks a lot Malcolm! On Tue, Dec 2, 2008 at 2:46 AM, Malcolm Tredinnick <[EMAIL PROTECTED] > wrote: > > > On Tue, 2008-12-02 at 02:30 -0200, Felipe Sodré Silva wrote: > > Hi everyone. > > > > When I get the data from a form, I'm processing it using request.POST > > object, like this: > > > > def

Re: time help (again)

2008-12-01 Thread Kenneth Gonsalves
On Tuesday 02 Dec 2008 10:22:21 am Bobby Roberts wrote: > Can anyone tell me how to do this in python.  I'm coming from an asp > background where there is a built in function to determine this. http://www.python.org/doc/2.5.2/lib/datetime-timedelta.html -- regards KG http://lawgon.livejournal.c

Re: time help (again)

2008-12-01 Thread Bobby Roberts
> http://www.python.org/doc/2.5.2/lib/datetime-timedelta.html yeah i said I don't understand this. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django

Re: time help (again)

2008-12-01 Thread Malcolm Tredinnick
On Mon, 2008-12-01 at 21:01 -0800, Bobby Roberts wrote: > > http://www.python.org/doc/2.5.2/lib/datetime-timedelta.html > > yeah i said I don't understand this. Well, you said you didn't understand "the docs", but you didn't mention which documentation you had found. So Kenneth's answer isn

Re: time help (again)

2008-12-01 Thread Malcolm Tredinnick
On Mon, 2008-12-01 at 20:52 -0800, Bobby Roberts wrote: > ok day 7 and no luck. I really need help. I need to calculate the > difference between two dates, one pulled from the database, and one as > the NOW time. I'm hoping someone out there can help me and explain > the code to me. Yes I've

Re: time help (again)

2008-12-01 Thread Kenneth Gonsalves
On Tuesday 02 Dec 2008 10:31:11 am Bobby Roberts wrote: > > http://www.python.org/doc/2.5.2/lib/datetime-timedelta.html > > yeah i said I don't understand this. >>> x =datetime(2008,12,10,20) >>> y=datetime(2008,12,10,23) >>> z = y-x >>> z datetime.timedelta(0, 10800) >>> print z 3:00:00 --

Re: time help (again)

2008-12-01 Thread humanstalker
Hi Just thought i would help out anyway even though this is solved. d = datetime.datetime.now() - datetime.datetime.strptime (dbValueHere,"%Y-%m-%d") # Does a date diff between today and the date from the DB, change "%Y-%m-%d" to suit the format of you string.Also make sure you set the dbValueHe

Re: Form POST Issue

2008-12-01 Thread please smile
Thanks Karen Tracey,I typecast the posted value as integer. now Its works fine. On Tue, Dec 2, 2008 at 3:28 AM, Karen Tracey <[EMAIL PROTECTED]> wrote: > In the future, if you click "Switch to copy-and-paste-view" and then just > copy and paste the contents of the traceback window, that is gene

Re: XML templates

2008-12-01 Thread Vicky
I tried the code below: from django.template import loader, Context def NewspaperSelect(request,u_id): t=loader.get_template(r'C:\django\noddler\news\template.vxml') c=Context({ 'topic':'news', 'content':pn }) return HttpResponse(t.render(c), mimetype='application/xml') I

Re: XML templates

2008-12-01 Thread Malcolm Tredinnick
On Mon, 2008-12-01 at 22:20 -0800, Vicky wrote: > I tried the code below: > > from django.template import loader, Context > > def NewspaperSelect(request,u_id): > t=loader.get_template(r'C:\django\noddler\news\template.vxml') > c=Context({ 'topic':'news', 'content':pn }) >

Re: admin.py -- AlreadyRegistered

2008-12-01 Thread Roland van Laar
djan wrote: > Hello. > > I'm following along with djangobook.com and trying to make necessary > changes to port django to version 1.0. In Django's Site > Administration, chapter 6, I run into the error: > > > Exception Type: AlreadyRegistered > Exception Value: The model Book is already

Re: GeoDjango in Ubuntu 8.10, Segmentation Fault

2008-12-01 Thread Info Cascade
FWIW -- I got this working in CentOS5.2 by removing the default (yum installed) version of apache, and compiling the latest version, 2.2.10. While I was at it, I compiled the latest version of mod_python. That was all it took, and now, no more segmentation violations. Thanks, Liam Justin Bronn

Configuring Paths for FileField ?

2008-12-01 Thread Eric
Hi! I'm new at Django, but I've been having relatively good luck. I've recently hit a big of a wall using FileField. I have set up the paths correctly enough that I can upload files to /my_site/uploads/photos, but when I view the model containing the FileField in the admin interface, it shows