Enable users to input formatted text

2009-12-20 Thread Continuation
I have a TextField() field that stores user entered text. However the formatting is a bit weird, eg. new lines are lost when displaying that field. What is the best way to retain that formatting and also enable users to format their inputs with either HTML tags or some rich text editors? -- You

Re: Root url returning 302 FOUND

2009-12-20 Thread Kieran Brownlees
I probably should of tried it first. Your url setup works fine for me. Kieran On Dec 21, 5:10 pm, Kieran Brownlees wrote: > My guess would be the root url never ends without a '/' - ie to match > the root url you need a '/' somewhere. > > Try making the home_view regex r'^/$' > > Kieran > > On D

Re: Root url returning 302 FOUND

2009-12-20 Thread Kieran Brownlees
My guess would be the root url never ends without a '/' - ie to match the root url you need a '/' somewhere. Try making the home_view regex r'^/$' Kieran On Dec 21, 5:05 pm, Kegan Gan wrote: > Anyone can shed some light to the matter? > > * Bring this post to the front. > > On Dec 18, 1:21 am,

Re: Root url returning 302 FOUND

2009-12-20 Thread Kegan Gan
Anyone can shed some light to the matter? * Bring this post to the front. On Dec 18, 1:21 am, Kegan Gan wrote: > In myrooturls.py I have the following: > > urlpatterns = patterns('', >     (r'^', include('story.urls')), > ) > > In my story app, I have the following urls.py: > > urlpatterns = pat

"OneToOneField doesn't allow assignment of None"

2009-12-20 Thread Kieran Brownlees
Hello All, In http://code.djangoproject.com/browser/django/trunk/django/forms/models.py line 53 it states: 53 # OneToOneField doesn't allow assignment of None. Guard against that 54 # instead of allowing it and throwing an error. 55 if isinstance(f, models.O

use_for_related_fields and filtering results - really a no-go?

2009-12-20 Thread kahless
hi, the documentation for use_for_related_fields states that it shouldn't be used for filtering results: http://docs.djangoproject.com/en/dev/topics/db/managers/#do-not-filter-away-any-results-in-this-type-of-manager-subclass i just wanted to know if this advice should always be followed (or when

Re: Humble-structure sites on Django // Suggestion needed

2009-12-20 Thread Brian McKeever
If the about page is static, you probably don't need any models for it. A simple template should do, or you could use flat pages if you want your client to be able to edit it easily on their own. http://docs.djangoproject.com/en/dev/ref/contrib/flatpages/ The contacts page probably just needs a Co

Re: choice model with objects.values_list options

2009-12-20 Thread Mark Schuuring
Dear Daniel, Thanks for your quick response. As you suggested i applied the code to the forms.py http://dpaste.com/135885/ Though it fails on line 25 self.fields["url"].queryset = Image.objects.values_list('image') with a KeyError. Does this suggest a failure in line 20 because to my knowledge the

Re: django 1.1 - Fetching month based data.. No data

2009-12-20 Thread ~km
Sorry I couldn't finish it all... Here's the complete post: http://pastebin.com/f36abac82 -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send em

django 1.1 - Fetching month based data.. No data

2009-12-20 Thread ~km
Problem plot: I get no data (blog entries) when querying the monthly and daily archive, making use of the date based generic views from Django 1.1. Can you see the problem? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: HELP PyAMF - Django + FLEX

2009-12-20 Thread Rafael Vieira
> > look this link http://sseetharaman.wordpress.com/2009/10/21/django-pyamf/ > > -- > > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send ema

Re: Display images in template using ManyToMany

2009-12-20 Thread Osiaq
Thank you :) That was the only thing I didn't try :) It works flawlessly :) On Dec 20, 8:39 pm, rebus_ wrote: > {% for a in p.gallery.all %} >        <--- TRY THIS > {% endfor %} > > http://docs.djangoproject.com/en/dev/ref/files/file/#django.core.file... -- You received this message because y

i18n: date translation in Python

2009-12-20 Thread Baurzhan Ismagulov
Hello, I'd like to have translated week days in a bilingual (printed) form. Since templates support only one language, I want to do that in Python for now. I've looked at django.templates.defaultfilters.date and tried the following in my views.py: from django.utils.dateformat import format

Re: Django 1.1 and Jython

2009-12-20 Thread Leo Soto
Hello, Those problems were caused because django-jython 1.0.X is meant to be used with Django 1.0. We released django-jython 1.1.0 a few days ago[1], and the major news is that it works with Django 1.1.1. Feel free to give it a try and help us with some feedback! [1] http://blog.leosoto.com/2009

Re: Display images in template using ManyToMany

2009-12-20 Thread rebus_
{% for a in p.gallery.all %} <--- TRY THIS {% endfor %} http://docs.djangoproject.com/en/dev/ref/files/file/#django.core.files.File.url -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@go

Display images in template using ManyToMany

2009-12-20 Thread Osiaq
MODEL: class PropertyGallery(models.Model): link = models.ImageField(upload_to="gallery/props/") class Property(models.Model): name = models.CharField(max_length=200) gallery=models.ManyToManyField(PropertyGallery) ---

Re: Humble-structure sites on Django // Suggestion needed

2009-12-20 Thread tezro
Thanks for reply. The main trouble for me is nearly how to do that "right" with the MVT layer. I'm not really sure how to write models for such a small yet compound structure. How do I make, say, the first and second pages (about and contacs) with some different fields? I will reproduce the metho

Re: newbie question: .is_valid seems non-Boolean?

2009-12-20 Thread Łukasz Balcerzak
Well, Form.is_valid calculates the form and returns boolean, thats for sure. Specifically, ">> from django import forms >>> >>> class F(forms.Form): ... name = forms.CharField() ... >>> f = F() >>> f.is_valid > >>> f.is_valid() False >>> f = F({'name': 'Lukasz'}) >>> f.is_valid() True You ge

Re: newbie question: .is_valid seems non-Boolean?

2009-12-20 Thread Karen Tracey
On Sun, Dec 20, 2009 at 8:17 AM, BobAalsma wrote: > I'm following the The Django Book 2.0, trying to learn Django. > I'm on Apple OS X10.5.8, Python 2.5.1. > I have looked at FAQ, mailing lists, etc. but did not find any > situation looking like this. > > Question: > although all other parts seem

newbie question: .is_valid seems non-Boolean?

2009-12-20 Thread BobAalsma
I'm following the The Django Book 2.0, trying to learn Django. I'm on Apple OS X10.5.8, Python 2.5.1. I have looked at FAQ, mailing lists, etc. but did not find any situation looking like this. Question: although all other parts seem to work as described in the book, the .is_valid returns an unexp

Re: choice model with objects.values_list options

2009-12-20 Thread Daniel Roseman
On Dec 20, 4:26 am, GoSantoni wrote: > Found this (old) > posthttp://oebfare.com/blog/2008/feb/23/changing-modelchoicefield-queryset/ > > So i tried > > class Post(models.Model): >     blog = models.ForeignKey(blog) >     . >     url             = models.ModelChoiceField > (queryset=Image.obj

Re: Rails-style form value deserializer?

2009-12-20 Thread Russell Keith-Magee
On Sun, Dec 20, 2009 at 12:22 PM, Todd Blanchard wrote: > I think what i actually want is a form set, but I don't find that all that > well done either. I would like to point out that so far, you haven't actually told us what your problem *is*. You've asked how Django does something that Rails ca

Re: very noob : DRY violation in views.py

2009-12-20 Thread Osiaq
Just one word: wow! Yes, definitely I'm gonna dig into it :) On Dec 20, 2:34 am, Ethan Jucovy wrote: > Lately I have really liked using custom template tags for these sorts of > queries. > > Once you get the hang of writing them, it's very quick to build a little > library of queries in custom t