birth date in a model form

2009-01-05 Thread DragonSlayre
Hi, I've got a ModelForm, and the model for it contains a birth date field (as a DateField): class FiremanForm(ModelForm): class Meta: model = Fireman Currently a single text box is rendered to enter the date, but I'd like to have a drop down list for day, month, year. I'm

Does PhoneNumberField for models exist?

2009-01-05 Thread DragonSlayre
http://docs.djangoproject.com/en/dev/topics/forms/modelforms/ This lists PhoneNumberField as being a field type, but in the models documentation, http://docs.djangoproject.com/en/dev/ref/models/fields/#ref-models-fields there is no such field. Does anybody know if this field exists? I'd quite

Re: birth date in a model form

2009-01-05 Thread DragonSlayre
m working with the latest patch from #6231 and so the widget is now > useful for me. But I hope that this patch find it's way into django > trunk! > > ~Bernd > > On Jan 5, 11:00 pm, DragonSlayre <lssay...@gmail.com> wrote: > > > Hi, > > > I've got a Mo

Re: Does PhoneNumberField for models exist?

2009-01-05 Thread DragonSlayre
Thanks :) On Jan 6, 12:46 pm, "Karen Tracey" <kmtra...@gmail.com> wrote: > On Mon, Jan 5, 2009 at 5:33 PM, DragonSlayre <lssay...@gmail.com> wrote: > > >http://docs.djangoproject.com/en/dev/topics/forms/modelforms/ > > > This lists PhoneNumberFie

Re: birth date in a model form

2009-01-05 Thread DragonSlayre
rm(forms.ModelForm): >     birth_date = forms.DateField(widget=widgets.SelectDateWidget()) > > On Jan 6, 12:11 am, DragonSlayre <lssay...@gmail.com> wrote: > > > I've tried using it, but I'm still quite new to django - I put it into > > my model file for now, and made my mod

Passing a form a user before validation

2009-01-08 Thread DragonSlayre
I'm trying to generate a form with a user's details, so that they can change the details they've submitted. One of my forms is a ModelForm, which is the profile of the User object. I also want to show the first name, last name and email from the User object, so I've created a form for that

Re: Passing a form a user before validation

2009-01-08 Thread DragonSlayre
Thank you thank you thank you Cheers Malcolm, you're the best! On Jan 9, 2:31 pm, Malcolm Tredinnick <malc...@pointy-stick.com> wrote: > On Thu, 2009-01-08 at 17:09 -0800, DragonSlayre wrote: > > I'm trying to generate a form with a user's details, so that they can > &g

MEDIA_ROOT, MEDIA_URL and upload_to confusion (~.~)

2009-01-16 Thread DragonSlayre
I'm using django-thumbs (http://code.google.com/p/django-thumbs/) to create some thumbnails for my site: class Image(models.Model): title = models.CharField(max_length=50, blank=True, null=True) caption = models.CharField(max_length=100, blank=True, null=True) photo =

Re: MEDIA_ROOT, MEDIA_URL and upload_to confusion (~.~)

2009-01-16 Thread DragonSlayre
) and > MEDIA_URL = 'static/' to: MEDIA_URL = '/site_media/' I think I get it now - the media_root is where django uploads images to, and the media_url is where the images will be linked from. - hopefully that is what they mean :) On Jan 17, 6:06 pm, DragonSlayre <lssay...@gmail.com>

Re: MEDIA_ROOT, MEDIA_URL and upload_to confusion (~.~)

2009-01-16 Thread DragonSlayre
Yeah, that makes good sense - I tried finding out info on djangoproject but didn't quite understand what they were for. Thanks On Jan 17, 7:04 pm, Malcolm Tredinnick <malc...@pointy-stick.com> wrote: > On Fri, 2009-01-16 at 21:06 -0800, DragonSlayre wrote: > > I'm using djan

How do you get the time and date out of a datetimefield object?

2009-01-17 Thread DragonSlayre
Hi, As I'm relatively new to python and django, I'm unsure how to get the date and time out of a DateTimeField. How I usually work with this sort of thing is to 'python manage.py shell' and then import whatever class i'm interested in and then do a dir() on the object to find out what methods

Re: How do you get the time and date out of a datetimefield object?

2009-01-17 Thread DragonSlayre
Thanks for the tips, the help thing looks real - well... helpful! lol --~--~-~--~~~---~--~~ 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

Multiple images in form

2009-01-19 Thread DragonSlayre
Hi, I've seen some posts from a while back, but didn't find any real solution when searching to find out how to put multiple images (or any field for that matter) into a form (mainly a ModelForm) Basically what I want to have is a form that has a one to many relationship from a post to images,

Re: Multiple images in form

2009-01-19 Thread DragonSlayre
0, 5:48 pm, DragonSlayre <lssay...@gmail.com> wrote: > Hi, > > I've seen some posts from a while back, but didn't find any real > solution when searching to find out how to put multiple images (or any > field for that matter) into a form (mainly a  ModelForm) > > Ba

Re: Multiple images in form

2009-01-20 Thread DragonSlayre
to choose an image. - is there anyway to tell the foreignkey field to render the items pointed to by the foreign key, rather than just render a drop down list? On Jan 21, 3:14 am, "Karen Tracey" <kmtra...@gmail.com> wrote: > On Tue, Jan 20, 2009 at 2:28 AM, DragonSlay

sqlite3 problems setting up

2009-01-24 Thread DragonSlayre
I've just done a fresh install of python 2.6 and django 1.0.2, and sqlite3 in ubuntu, and I've cloned my repository, and tried python manage.py runserver, but then I get this error: File "/usr/local/lib/python2.6/site-packages/django/db/backends/ sqlite3/base.py", line 27, in raise

Re: sqlite3 problems setting up

2009-01-24 Thread DragonSlayre
25, 3:22 pm, DragonSlayre <lssay...@gmail.com> wrote: > I've just done a fresh install of python 2.6 and django 1.0.2, and > sqlite3 in ubuntu, and I've cloned my repository, and tried python > manage.py runserver, but then I get this error: > > File "/usr/local/lib/python2

Re: sqlite3 problems setting up

2009-01-24 Thread DragonSlayre
Importing sqlite3 fails as well (if I type this into a python shell) import sqlite3 Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.6/sqlite3/__init__.py", line 24, in from dbapi2 import * File "/usr/local/lib/python2.6/sqlite3/dbapi2.py",

Re: sqlite3 problems setting up

2009-01-24 Thread DragonSlayre
Just doing some exploring - noticing that: * /usr/lib/python2.5/site-packages has a pysqlite2 folder as well as a PIL folder * /usr/local/lib/python2.6/site-packages has just django in it I'm not sure how the whole site-packages things work, or why python 2.5 is in /usr/lib/ and python 2.6 is

Re: sqlite3 problems setting up

2009-01-24 Thread DragonSlayre
On Jan 25, 6:04 pm, Steve Holden wrote: > > When you install something by running > >   python setup.py install > > it gets installed into the python that is used to run setup.py. It looks > like you had /usr/local/bin on your path when you installed django, but > not when

How to change python version in ubuntu???

2009-01-26 Thread DragonSlayre
Hi, I've made a total mess of python (I installed python2.6 from source, installed python 2.6 from an installer (http://jaredforsyth.com/ content/install-python-26-ubuntu)). The source version installed into /usr/local/, and the installer version installed into /usr/. After installing python

Re: How to change python version in ubuntu???

2009-01-26 Thread DragonSlayre
Ok, well I reinstalled ubuntu. It'd still be good to know how to change python versions easily, if anybody knows how to do this - it seems like it's not documented anywhere :( --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: How to change python version in ubuntu???

2009-01-26 Thread DragonSlayre
On Jan 27, 1:41 pm, wrote: > Does this help? Found via google and ubuntu > forums.https://launchpad.net/~doko/+archive > > Sorry, I run Debian (which ubuntu is based on), I just apt-get install all of > the > available python versions and then run /usr/bin/python to

Re: How to change python version in ubuntu???

2009-01-26 Thread DragonSlayre
On Jan 27, 3:15 pm, Steve Holden <holden...@gmail.com> wrote: > DragonSlayre wrote: > That's most easily done by controlling your PATH so the the version you > want to prefer is found first when python is called for. > > regards &g

Re: How to change python version in ubuntu???

2009-01-26 Thread DragonSlayre
RE Steve - I tried earlier to change the PYTHONHOME variable (seen in the man pages - http://linux.die.net/man/1/python), the python path urls changed, but they were a bit screwed up. The way I changed it was by editing the .bashrc (hidden) file in my home directory. I think I wrote something

Re: How to change python version in ubuntu???

2009-01-26 Thread DragonSlayre
On Jan 27, 4:11 pm, Steve Holden <holden...@gmail.com> wrote: > DragonSlayre wrote: > > > On Jan 27, 3:15 pm, Steve Holden <holden...@gmail.com> wrote: > > >> DragonSlayre wrote: > > How do you do this? > > http://www.swc.scipy.org/lec/shell

Re: How to change python version in ubuntu???

2009-01-27 Thread DragonSlayre
Thanks Waylan - http://achinghead.com/archive/83/installing-multiple-versions-python/ is just what I needed. Thanks Shaleh, I appreciate the detailed explanation :) Yes - the shell is something that I have to get more familiar with - I've only really recently started using ubuntu for

Validating and rendering dynamic form

2009-01-29 Thread DragonSlayre
I've created a dynamic form to allow users to upload images, and I'm trying to validate the form. - it displays fine, but when I validate and return a response, I get either a Key Error at the line (data = self.cleaned_data[dataName] ) in _clean_photo or I get a render error in my template at {{

Re: Model for newbie

2009-01-29 Thread DragonSlayre
I'm guessing that you might have tried to do a ForeignKey(User) for the other_invited. If that is the case, then I think you need to add a related_name e.g. ForeignKey(User, related_name="group_invited_to"). You may have to do a related name for the creator as well. I hope that helps. On Jan

Apache ImportError: Could not import settings

2009-01-31 Thread DragonSlayre
Hi, I'm at the final stage in one of my django developments, and am trying to get my site live. I've been following instructions on http://www.jeffbaier.com/2007/07/26/installing-django-on-an-ubuntu-linux-server/ but got the following error: File

Re: Validating and rendering dynamic form

2009-01-31 Thread DragonSlayre
Solved my problem - data = self.cleaned_data[dataName] should have been: data = self.cleaned_data.get(dataName) Silly me --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Import error exception "No module named urls" when running from eclipse

2008-10-21 Thread DragonSlayre
Hi, I'm new to django/python, and I'm testing out eclipse for development. I'm using pydev, and managed to run my app, but then when I go to the web page, I get: ImportError at /time/ No module named urls Request Method: GET Request URL:http://localhost:8080/time/ Exception Type:

Re: Import error exception "No module named urls" when running from eclipse

2008-10-21 Thread DragonSlayre
version, then I should probably find out why my version doesn't support rename. Louis On Oct 22, 2:03 pm, Jeff Anderson <[EMAIL PROTECTED]> wrote: > DragonSlayre wrote: > > Hi, I'm new to django/python, and I'm testing out eclipse for > > development. > > > I'm using py

Best IDE for Django and python?

2008-11-25 Thread DragonSlayre
Hey, I'm getting started with a friend in developing a site with Django, and we're both new to this, so I am wondering what people use to manage all their files, and for looking at documentation etc. Having come from a Java background, I'm used to great documentation, and suspect that Java is

Re: Best IDE for Django and python?

2008-11-25 Thread DragonSlayre
Well maybe the problem is that the answer is not obvious On Nov 25, 3:42 am, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > On Tuesday 25 November 2008 01:57:09 pm DragonSlayre wrote: > > > How do you develop your django projects, and where do you go when you > > ne

Django is changing my html!

2008-12-04 Thread DragonSlayre
Hi, for some reason my hyperlink is not coming out as I expect it to. Here is my code in my template: {% for category in categories %} {{ category.name }} {% endfor %} The outcome is the following html code: Books I've checked and I only have one 'little'

Re: Django is changing my html!

2008-12-04 Thread DragonSlayre
If the problem is inside my view, shouldn't the output generated look more like this though: Books What i don't understand, is how 1) ' ' is showing up, and 2) why it doesn't have the tags inside. For 1, I can understand how the problem might be in my view, but

Re: Django is changing my html!

2008-12-04 Thread DragonSlayre
www.openrpg.com > > On Thu, Dec 4, 2008 at 7:58 PM, Malcolm Tredinnick > > <[EMAIL PROTECTED]> wrote: > > > On Thu, 2008-12-04 at 18:49 -0800, DragonSlayre wrote: > >> Hi, > > >> for some reason my hyperlink is not coming out as I expect it to. > >>

Really easy DateTimeField question

2008-12-09 Thread DragonSlayre
Hi, I've seen some code with the following in, but can't find what the string 'date added' is representing in the documentation. What is the string for? models.DateTimeField('date added') Thank you! I know it's easy, but it'd take me forever to find out.

Re: Really easy DateTimeField question

2008-12-09 Thread DragonSlayre
Thanks a lot ! On Dec 10, 1:24 pm, friggstad <[EMAIL PROTECTED]> wrote: > It is the human-friendly name used in the admin. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

coercing to Unicode: need string or buffer, tuple found

2008-12-09 Thread DragonSlayre
Hi, I've just made a new 'Student' model, and was trying to create a new Student in the admin interface, and I got the following error: Environment: Request Method: POST Request URL: http://localhost:8000/admin/student/student/add/ Django Version: 1.0.2 final Python Version: 2.5.2 Installed

Re: coercing to Unicode: need string or buffer, tuple found

2008-12-09 Thread DragonSlayre
Oh ok, thanks a lot!! Yes, I'm learning python too at the same time as django... On Dec 10, 4:35 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Tue, 2008-12-09 at 19:23 -0800, DragonSlayre wrote: > > Hi, > > > I've just made a new 'Student' model, and wa

passing extra parameters with named urls

2008-12-18 Thread DragonSlayre
Hi, I'm currently working with django-registration, and have the following url pattern (it's included from my other url pattern): url(r'^register/$', register, name='registration_register', ), This calls a view:

Re: passing extra parameters with named urls

2008-12-18 Thread DragonSlayre
url(r'^register/$', register, {'extra_context' : {'currentmaintab' : 'account'}}, name='registration_register', ), It would have been nice if you could have told me straight up.

Problem saving a User object to a profile

2008-12-19 Thread DragonSlayre
I've got a profile model which has a django.contrib.auth.models.User as a foreign key. I am trying to assign the User object to my profile model after I've checked that the user is valid and that the profile contents are also valid. Once I've saved my user object, I then call profile_form.user

Re: Problem saving a User object to a profile

2008-12-19 Thread DragonSlayre
Ok - I'm digging deeper, and I realise that my form doesn't have a user, as it's excluded from the form using exclude = ('user'). I'll carry on looking... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: Problem saving a User object to a profile

2008-12-19 Thread DragonSlayre
com> wrote: > On Dec 19, 8:28 pm, nbv4 <cp368...@ohio.edu> wrote:> On Dec 19, 3:15 pm, > DragonSlayre <lssay...@gmail.com> wrote: > > > > profile_form.user = user; > > > profile_form.save() > > > The problem is that you can't assign fields in

Re: Problem saving a User object to a profile

2008-12-19 Thread DragonSlayre
Actually, it seems a bit redundant doesn't it? I see there is a get_profile, but nothing to set it anyway. I guess it's derived information from the database Yay! such simple solutions, I'm so happy to be able to register. On Dec 20, 9:42 am, DragonSlayre <lssay...@gmail.com> wrote:

MultiValueDictKeyError when accessing POST items

2008-12-22 Thread DragonSlayre
I've created my own form: Login: Username: Password: I am mappying /accounts/login/ to a view of mine, which is then calling: if request.method == 'POST': username = request.POST['login_username'] I have no idea why I'm getting the error - "Key 'login_username' not

Re: MultiValueDictKeyError when accessing POST items

2008-12-23 Thread DragonSlayre
:03 -0800, DragonSlayre wrote: > > I've created my own form: > > > > >   Login: > >   Username: > >   > >   Password: > >   > >   > > > > > I am mappying /accounts/login/ to a view of mine, which is then > > calling: > > >