Re: How to use next with comments?

2009-05-30 Thread Eric Abrahamsen
On May 29, 2009, at 5:40 AM, Kevin Fullerton wrote: > > > On Thu, May 28, 2009 14:31, Eric Abrahamsen wrote: >> >> The default comment form does not include a next parameter, so if you >> don't override the builtin comment templates you won't get any next >> parameters in the forms. The most su

Re: forms / confirmation

2009-05-30 Thread V
I think not using a form in itself is not a problem, it's more a way of organising your code which would let you add all the user interaction in forms. And actually, you could still do it even without a POST method. You have request.GET or request.REQUEST to store the passed variables. To get the

Re: Creating fixtures that has relationship to other object

2009-05-30 Thread Karen Tracey
On Sat, May 30, 2009 at 11:21 PM, Joshua Partogi wrote: > Dear all, > > I'd like to create fixture that has relationship to other object. Let's say > I have a Member object that has foreign key to Country. > > class Member(User): >country = models.ForeignKey(Country) > > I created the fixtures

Re: Newbie, hierarchical models, url.py problem

2009-05-30 Thread adelaide_mike
Thanks Gabriel. I think it would be good if the tutorial included a three-level hierarchy sowing how to handle the url.py and views.py for the third layer. Anyway, I now understandone step more. Thanks and regards On May 31, 11:46 am, Gabriel wrote: > adelaide_mike escribió: > > > urlpatterns

Creating fixtures that has relationship to other object

2009-05-30 Thread Joshua Partogi
Dear all, I'd like to create fixture that has relationship to other object. Let's say I have a Member object that has foreign key to Country. class Member(User): country = models.ForeignKey(Country) I created the fixtures member.json and define it as such: [ { "model": "member.Member",

Re: Newbie, hierarchical models, url.py problem

2009-05-30 Thread Gabriel
adelaide_mike escribió: > urlpatterns = patterns('whasite.wha.views', > > (r'^address/{{street.id}}/(?P\d+)/$', 'select_event'), > (r'^address/(?P\d+)/$', 'select_property'), > (r'^address/$', 'select_street'), > (r'^$', 'address'), > ) (r'^address/(?P\d+)/(?P\d+)/$', 's

Newbie, hierarchical models, url.py problem

2009-05-30 Thread adelaide_mike
I have model classes Suburb, Street ,Property and Event. Each has a name , a foreign key to the model above, and the id provided by default. In the admin everything is fine. The template address.html has a search field and returns a startswith query that generates streets. Clicking a line in t

Re: Comparing timestamps

2009-05-30 Thread Damien GOMBAULT
Write a method is_modified in your Post model. You can use datetime.timedelta to compare dates. def is_modified(self): second = datetime.timedelta(seconds=1) delta = self.last_modified - self.created return delta >= second Then use it in your template : {% if post.is_modified %} {{ ...

Comparing timestamps

2009-05-30 Thread K.Berkhout
Hi, Let's say I have the following post model: class Post(models.Model): text = models.TextField() created = models.DateTimeField(auto_now=False, auto_now_add=True) last_modified = models.DateTimeField(auto_now=True, auto_now_add=False) I want to display the last_modifi

Re: form fun

2009-05-30 Thread Wim Feijen
The source code for the form generator is now on github at: http://github.com/wimfeijen/trumpet_form_generator - Wim On May 30, 7:29 pm, Wim Feijen wrote: > Hello, > > Several clients asked me whether they could have a form on their > website, which displays like this: > > Description of field

Re: Temporary urls for tests

2009-05-30 Thread Filip Gruszczyński
Should have check those docs, sorry. Next time I'll make sure I've checked it all. Thanks for you help. W dniu 30 maja 2009 15:43 użytkownik Ramiro Morales napisał: > > 2009/5/30 Filip Gruszczyński : >> >> I am building a library for Django that provides some abstract views >> (I am using classe

form fun

2009-05-30 Thread Wim Feijen
Hello, Several clients asked me whether they could have a form on their website, which displays like this: Description of field 1 Title: (input field) help_text Description of field 2 Title2: (input field2) help_text2 etc. I was wondering whether this is a common case and I like to poll you:

Re: How to modify and object before saving it in ModelForm [was] Newbie needs help

2009-05-30 Thread Andy
Thanks Kenneth. I'll check out the link and use better subject lines in the future...unless you want to send a donation! On May 30, 1:38 am, Kenneth Gonsalves wrote: > On Saturday 30 May 2009 12:47:27 Andy wrote: > > > I would like to set the order_number in my model to be equal to the > > auto

Re: Sending POST data and Redirecting to external website from a view

2009-05-30 Thread Lacrima
Hello! This is impossible to redirect a user to external site with post. urllib and urllib2 can only help to fetch data, but not to redirect a user. So if you do not use ssl, you have to use hidden fields where you should specify id and pin. You can make payments much secure using hash algorithm

select size box error

2009-05-30 Thread Jesse
I have three drop down select boxes, which I have to expand for web visibility reasons with the size='' option. If I select one from each box I receive no errors, but if I leave one or more boxes without a selection I receive an error. {% for pathology in pathology_list %} {{ pathology

Re: filter date in view.py

2009-05-30 Thread Jesse
Hello Derek, The grantstartdt field has a date format, the Year field (drop down) is a list of years in format, but the field is character. I need to parse the from the date field to match the of the Year value. When I changed the code as you suggested I received this error: da

Re: Temporary urls for tests

2009-05-30 Thread Ramiro Morales
2009/5/30 Filip Gruszczyński : > > I am building a library for Django that provides some abstract views > (I am using classes instead of functions), that can be used subclassed > and used in any app. I would like to be able to test those views, so I > subclass them during testing and would like to

Re: Using CheckboxSelectMultiple with a many to many relationship.

2009-05-30 Thread Steve Holden
julianb wrote: > On Aug 22, 4:32 pm, acreek wrote: >> I just have not figured out the correct way to pass along the coupons >> that are a part of the Flyer model. Can anyone give me a hint on how >> to go about this properly? > > Here's how I'd do it: > http://dpaste.com/hold/73229/ > > Now you

Re: using Iframes?

2009-05-30 Thread Dmitry Dzhus
ydjango wrote: > I have two django based websites and I want show pages from one > website in another. Is Iframe the best way to do it or is there some > other better. I read somewhere that Iframes should be avoided but > never got any good reasons why? You should rely on syndicated high-level da

Re: How to use next with comments?

2009-05-30 Thread Dmitry Dzhus
Kevin Fullerton wrote: > I'm working with django.contrib.comments at the moment, and so far most > things are working as expected. > > I'm building the submission form using {% get_comment_form for object as > form %} and have added the following as part of the form > > > > As I understand it, th

Temporary urls for tests

2009-05-30 Thread Filip Gruszczyński
I am building a library for Django that provides some abstract views (I am using classes instead of functions), that can be used subclassed and used in any app. I would like to be able to test those views, so I subclass them during testing and would like to be able to attach them to some url, so t

Re: problem with virtualenv django versions and postgresql

2009-05-30 Thread Kenneth Gonsalves
On Saturday 30 May 2009 17:23:01 Kenneth Gonsalves wrote: > this problem may not be django related at all, but maybe someone here could > tell me how to debug it. > > I have a VPS on Gandi with several .90 django sites and some running on > latest trunk. I had set up virtualenv to run the sites on

problem with virtualenv django versions and postgresql

2009-05-30 Thread Kenneth Gonsalves
hi, this problem may not be django related at all, but maybe someone here could tell me how to debug it. I have a VPS on Gandi with several .90 django sites and some running on latest trunk. I had set up virtualenv to run the sites on trunk. The sites on trunk run perfectly. The .90 sites als

Re: How to modify and object before saving it in ModelForm [was] Newbie needs help

2009-05-30 Thread Kenneth Gonsalves
On Saturday 30 May 2009 12:47:27 Andy wrote: > I would like to set the order_number in my model to be equal to the > automatically assigned ID plus 10,000.  Can anybody tell me how to > achieve this? check out commit=False in this document: http://docs.djangoproject.com/en/dev/topics/forms/modelf

Newbie needs help

2009-05-30 Thread Andy
Hello, I am new to Django and Python but am determined to learn. I am creating a page that asks for some user input. My model looks like this: from django.db import models from django.forms import ModelForm floor_plan_choices = ( ('A', 'Square'), ('B', 'Rectangular'),