Re: ForeignKey to_field problem

2010-08-09 Thread bhuztez
Without to_field, it works. But, setting to_field to name, you can simply type name in the input field of django admin, instead of id. I am just wondering why the api behaves differently if to_field is set to another field other than id. We create like this: >>> pet = Pet.objects.create(owner

Re: Django on Mac OS X

2010-08-09 Thread Daniel França
Hi, thanks, I didn't know this werkzeug debuger. Now I can see exactly where it raises the error and can print the variables values, here's the output with some values: File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line *20

Re: ForeignKey to_field problem

2010-08-09 Thread Renne Rocha
Try defining the pet model like this: class Pet(models.Model): owner = models.ForeignKey(Person) name = models.CharField(max_length=30) Than it will work. On Fri, Aug 6, 2010 at 7:25 AM, bhuztez wrote: > I have my models declared in this way: > >class Person(models.Model):

filtering related object in template

2010-08-09 Thread Martin Tiršel
Hello, I can do: {% for image in gallery.image_set.all %} ... {% endfor %} but my image model has: is_thumbnail = models.BooleanField() and I want to limit displaying only these images which have is_thumbnail=True. I can create a method on the image model, which returns images I want to, b

How to pass session to form and customize error_message value based on session variable

2010-08-09 Thread ydjango
I have class NewEventForm(ModelForm): Event_name = forms.CharField(label='Event Name*',widget=forms.TextInput(attrs={'size':'82','maxlength':'100','tabindex':'1'}),error_messages={'required':'! You must enter Event Name.'}) description=forms.CharField(label='Event Description*', widget=Ti

ManyToManyField limiting choices

2010-08-09 Thread Martin Tiršel
Hello, I have a gallery model and an image model. First, I create some galleries, then I insert images into them. But now, I want to add multiple thumbnails feature for galleries (thumbnails representing the gallery, not thumbnails for images inside gallery), so I added ManyToManyField and

Re: Django on Mac OS X

2010-08-09 Thread Xavier Ordoquy
Please, install django_extentions, werkzeug debuger and try to see what exactly where the issue is with the runserver_plus command (in browser debugger so you'll get the variables that are missing here. Most probably, your timezone field causes the issue. Regards, Xavier. Le 9 août 2010 à 22:40

Re: New server set up

2010-08-09 Thread XTCHost
Yes I do have ssh - I have just tried yum update bur nothing new was updated. How do I update On Aug 9, 10:27 pm, Boguslaw Faja wrote: > Hm, unfortunately I don't use apache. Nginx is better for me. But for > other group members answers for something else may be important: why > are you using pyt

Re: I did something wrong while registered

2010-08-09 Thread Nick Arnett
On Mon, Aug 9, 2010 at 1:50 PM, John Fabiani wrote: > Hi, > I recently registered for the group and I must have done something wrong > because I am receiving every posting twice (duplicates). Can someone fix > the > problem or direct me to where I can fix it. > > Have you looked at the headers o

Re: custom vocabularies vs translation

2010-08-09 Thread cootetom
Using the language files is the solution here. Even if your site only supports the English language, it still means that you can have .po files for just English. Once you understand how it all hangs together you'll be away. http://docs.djangoproject.com/en/1.1/topics/i18n/#topics-i18n I have a si

Re: Translation

2010-08-09 Thread cootetom
It's all there, you just need to implement it. http://docs.djangoproject.com/en/1.1/topics/i18n/#topics-i18n If you'd like a tool to help edit the translation files then check out one of the following: http://poedit.tomcoote.co.uk/ http://code.google.com/p/django-rosetta/ http://translate.sourcefo

Re: New server set up

2010-08-09 Thread Boguslaw Faja
Hm, unfortunately I don't use apache. Nginx is better for me. But for other group members answers for something else may be important: why are you using python in version 2.4? It's a bit old. Do you have access to console (ssh) or only for some web panel (cpanel, direct)? Best regards, On Mon, Au

I did something wrong while registered

2010-08-09 Thread John Fabiani
Hi, I recently registered for the group and I must have done something wrong because I am receiving every posting twice (duplicates). Can someone fix the problem or direct me to where I can fix it. Thanks in advance Johnf -- You received this message because you are subscribed to the Google

Re: New server set up

2010-08-09 Thread XTCHost
Sorry, forgot to mention It is a CentOS based VPS runing Parallels Virtuozzo with apache and python 2.4 All I have done is a simple install of Django to the root and run setup.py install There seem various ways to install it but I wish to be able to set up multiple domains through WHM using CPan

Re: Django on Mac OS X

2010-08-09 Thread Daniel França
Thanx for all the help, I tried to run on Sqlite3, and I don't if it's bad or good news, but there's error even in Sqlite3 just when I tried to create the db (syncdb) I get just after I input my users data or when I try to create a user in shell: Traceback (most recent call last): File "manage.p

Re: accessing a dictionary in template

2010-08-09 Thread owidjaya
Yes i'm trying to display a table with dynamic columns. my intention was to pass the queryset object to template and pass the column names so that the template can generate the table dynamically. On Aug 9, 12:06 pm, Sævar Öfjörð wrote: > I take it that you absolutely need to dynamically access t

Re: Registration

2010-08-09 Thread Ovnicraft
2010/8/9 kostia > A. If we have a form of registration only with password and username > fields. Then the user may write some fake email (foreign). > > B. We use registration activation link sent into email like it is done > on Facebook, Linkedin, Twitter and so on. > > Why B is better than A? Wh

Re: Registration

2010-08-09 Thread Casey S. Greene
What if the user puts in a "fake" e-mail that belongs to someone else? Then any service notifications go to the poor person who owns the e-mail address, not the person who signed up for the account. Also the user would get to take advantage of the benefits of the service. With B only the init

Translation

2010-08-09 Thread kostia
And now there is a time for stupid question: how to translate my English site onto different languages? -- 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

Re: Registration

2010-08-09 Thread kostia
A. If we have a form of registration only with password and username fields. Then the user may write some fake email (foreign). B. We use registration activation link sent into email like it is done on Facebook, Linkedin, Twitter and so on. Why B is better than A? Why A is a wrong solution? Any a

Re: accessing a dictionary in template

2010-08-09 Thread Tim Sawyer
On 09/08/10 19:56, owidjaya wrote: in php i can do this $some_mapping = array( "var1" : content_var1, "var2" : content_var2, ) for($i =1; $i< 3; $i++){ echo $some_mapping["var"+$i]; } can i do this in django template

Re: New server set up

2010-08-09 Thread Boguslaw Faja
Hi, What kind of http server are you going to use? Nginx ? Apache? It somehow defines possible options. best regards, On Mon, Aug 9, 2010 at 9:04 PM, XTCHost wrote: > I have installed Django in the root directory of a VPS supplied by > hostagtor. My aim is to provide any domain with Django. Not

Re: accessing a dictionary in template

2010-08-09 Thread Sævar Öfjörð
I take it that you absolutely need to dynamically access the values through generated keys? Not just a regular for loop? {% for var in some_mapping %} {{ var }} {% endfor %} - Sævar On Aug 9, 8:56 pm, owidjaya wrote: > in php i can do this > > $some_mapping = array( "var1" : content_var1, >

New server set up

2010-08-09 Thread XTCHost
I have installed Django in the root directory of a VPS supplied by hostagtor. My aim is to provide any domain with Django. Not that there will be many. It is running I am just not sure how to proceed to make sure it is done right Any advice help would be welcome Many Thanks Russell -- You rec

accessing a dictionary in template

2010-08-09 Thread owidjaya
in php i can do this $some_mapping = array( "var1" : content_var1, "var2" : content_var2, ) for($i =1; $i < 3; $i++){ echo $some_mapping["var"+$i]; } can i do this in django template? -- You received this message because

accessing a dictionary in template

2010-08-09 Thread owidjaya
in php i can do this $some_mapping = array( "var1" : content_var1, -- 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 email to django-users+u

Re: Unicode challenged

2010-08-09 Thread Joakim Hove
Thank you for answering; > Are you sure that you get '?' on the file if you write it this way, or > it's just > the console/editor that you're using to see the file's contents that > cannot handle > the text's encoding? When it comes to Unicode and such I am not sure about anything. But you are p

Re: Need help with my Form.save() method. Trouble with ForeignKey and ManyToMany Fields.

2010-08-09 Thread Nuno Maltez
>        def clean_username(self): >                data = self.cleaned_data['username'] >                try: >                        User.objects.get(username=data) >                except User.DoesNotExist: >                        return >                raise forms.ValidationError('The userna

Re: Unicode challenged

2010-08-09 Thread Nuno Maltez
> I have also tried replacing the write() statement with > write( string_content.encode( '' )) where I have tried the > encodings 'latin-1' and 'utf-8'; then it does not fail hard, but > instead of the wanted 'øåæ' characters I get '?' marks. Are you sure that you get '?' on the file if you wr

custom vocabularies vs translation

2010-08-09 Thread bobhaugen
I want to provide customizable vocabularies for an open-source django project, where each deployer can use different terms for strings that appear in templates (e.g. field names, form field descriptions, help text, page titles, etc.) Would django language files work for this purpose? Everything w

Unicode challenged

2010-08-09 Thread Joakim Hove
Hello, I am developing a Django application, and have some Unicode problems. I must admit I do not really understand if my problems are with Django or Python or ... ; but hopefully someone her can shed some light on the problem. Setup: 1. The application is developed for the Scandinavian countri

Re: Web site Mail Inbox

2010-08-09 Thread Michael Schade
On Mon, Aug 9, 2010 at 7:21 AM, kostia wrote: > Hi, > > I want to create an Inbox service for users of my django site. Can > anybody point me to the right direction? Any modules or it is better > to do myself? > As to whether or not it is best to do it yourself, that depends on if another module

Re: where is the link of password reset page on djangoproject.com ?

2010-08-09 Thread nyambaa
Thanks On Aug 9, 8:55 pm, rebus_ wrote: > On 9 August 2010 14:30, nyambaa wrote: > > > Hello guys, > > please help, I've not found the password reset page on > > djangoproject.com > > where is it? > > > thanks > > > -- > > You received this message because you are subscribed to the Google Groups

Re: Django on Mac OS X

2010-08-09 Thread Russell Keith-Magee
I use PostgreSQL on my Mac as well as MySQL, and I've had many fewer problems with PostgreSQL than I've had with MySQL. My personal opinion: Ignore all the ports/fink stuff, and get a good native PostgreSQL install: http://postgresqlformac.com The 8.4.3 installer has some known problems (easy to

Re: Django on Mac OS X

2010-08-09 Thread tsmets
Daniel, Did you manage to have the application running on sqlite3 ... ? I develop on Mac & have few issues... so may be you could first ensure everything is working without postgresql connector ... ? \T, On Aug 9, 4:24 am, Daniel França wrote: > tried, nothing :( > I'm getting crazy with Mac OS

Simple FormWizard wizard howto/example

2010-08-09 Thread PieterB
Hi, I'm still pretty new to django and searching some simple FormWizard examples What I want to do: First step: ModelChoiceField is populated with queryset Second step: A ChoiceField needs to be populated with object.get(model__field__exact=resultfromstep1)' In the last step I want to show al

Re: Django on Mac OS X

2010-08-09 Thread lukaszb
I haven't read all the comments here but if you've just started working on osx you should definitely check out http://github.com/mxcl/homebrew - it's a package manager which works like a charm most of the time. Installation is extremely simple (there is even one-liner available). If your problem i

Re: where is the link of password reset page on djangoproject.com ?

2010-08-09 Thread rebus_
On 9 August 2010 14:30, nyambaa wrote: > Hello guys, > please help, I've not found the password reset page on > djangoproject.com > where is it? > > thanks > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send emai

Re: Registration

2010-08-09 Thread Steve Holden
On 8/9/2010 8:40 AM, kostia wrote: > What is the purpose of email activation? > > Why can't we just use username/password on the site. > > The one bad fact - is when somebody uses foreign email address. This > is not a reason to use activation. Show me more facts please. > The e-mail response se

Registration

2010-08-09 Thread kostia
What is the purpose of email activation? Why can't we just use username/password on the site. The one bad fact - is when somebody uses foreign email address. This is not a reason to use activation. Show me more facts please. -- You received this message because you are subscribed to the Google

where is the link of password reset page on djangoproject.com ?

2010-08-09 Thread nyambaa
Hello guys, please help, I've not found the password reset page on djangoproject.com where is it? thanks -- 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 thi

How to handle invalid deleted forms in formsets

2010-08-09 Thread Tomi Pieviläinen
(Using formset_factory, if that makes a difference) If the user fills a form in formset incompletely and then marks it for deletion, my form handling dies horribly. The deleted forms prevent formset.cleaned_data from working as they don't validate and thus the form doesn't have a cleaned_data attr

Web site Mail Inbox

2010-08-09 Thread kostia
Hi, I want to create an Inbox service for users of my django site. Can anybody point me to the right direction? Any modules or it is better to do myself? Kostia -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: Django on Mac OS X

2010-08-09 Thread Xavier Ordoquy
I doubt it's a mac issue. I already ran in a couple of very painful issues with postgresql on Linux while having no issue with mysql on mac. My feeling is that postgresql require far more attention than mysql and is more sensitive to small changes. Regards, Xavier. Le 9 août 2010 à 05:32, Danie

Re: Django on Mac OS X

2010-08-09 Thread Daniel França
yeah, psycopg2 On Mon, Aug 9, 2010 at 1:27 AM, Sam Lai wrote: > 2010/8/9 Daniel França : > > I tried to reinstall everything... installing python+postgres from ports > > and I get the Symbol not found: _PQbackendPID error again from psycopg. > > I guess the best solution is run Ubuntu on a virtu

Re: manually add objects to a QuerySet

2010-08-09 Thread Daniel Roseman
On Aug 9, 8:13 am, chefsmart wrote: > I already have the objects in an earlier chunk of the code. I don't > want to hit the database again to get something I already have in > another form. That is what I mean when I say that code like my_qs = > MyModel.objects.filter(pk=obj1.pk) is utterly silly.

Re: Come on, share your django powered sites with others.//Fwd: A tornado powered site to show any project powered sites(open source)

2010-08-09 Thread Stone Puzzle
Yes, but this site can show more powered by information. For example: A site powered by python/django/jquery/apache/memcached, the site will be listed at http://django.poweredsites.org and http://python.poweredsites.org and http://jquery.poweredsites.org etc, so it's more easy to share powered b

Re: Search Field on All Pages

2010-08-09 Thread Wesley Childs
Thanks for everyone's advice. My final solution will be to use template inheritance to have the same form across the site and to use the action="/search" to ensure I don't have to import a search function into every single view. Thanks again Wes On 8 August 2010 19:36, kostia wrote: > Yes, so

Re: HttpResponseRedirect

2010-08-09 Thread bagheera
Dnia 07-08-2010 o 14:56:57 JeffH napisał(a): Another approach that I used recently: # urls.py (r'^ThankYou/(?P\d{4})/$', views.ThankYou), # message defs in views.py # messages for ThankYou page ty_messages = { '' : 'Invalid message specified.', '0001' : 'Pending dealer record h

Re: manually add objects to a QuerySet

2010-08-09 Thread chefsmart
I already have the objects in an earlier chunk of the code. I don't want to hit the database again to get something I already have in another form. That is what I mean when I say that code like my_qs = MyModel.objects.filter(pk=obj1.pk) is utterly silly. I already have the objects from earlier db q