Re: OneToOneFields: How do you use them?

2009-07-22 Thread Dudley Fox
ith" > > add this here so it gets an id?? > f.save() > >>>> p.friend = f >>>> p.save() > > On Jul 22, 12:15 pm, Dudley Fox wrote: >> I have a simple test model defined: >> >> class Friend(models.Model): >>name = models.CharF

OneToOneFields: How do you use them?

2009-07-22 Thread Dudley Fox
I have a simple test model defined: class Friend(models.Model): name = models.CharField(max_length=120) class Person(models.Model): name = models.CharField(max_length=120) friend = models.OneToOneField(Friend) Here is a sample of usage, and obviously I am doing something wrong... >>> p

Re: How to implement a custom field (or relation) which supports List of Strings

2009-07-18 Thread Dudley Fox
On Fri, Jul 17, 2009 at 3:45 PM, Sam Tregar wrote: > On Fri, Jul 17, 2009 at 3:23 PM, Dudley Fox wrote: >> >> Should I have posted this to the developer's list? I ask because I >> have received no responses yet. Not even a "...you shouldn't do that."

Re: How to implement a custom field (or relation) which supports List of Strings

2009-07-17 Thread Dudley Fox
Should I have posted this to the developer's list? I ask because I have received no responses yet. Not even a "...you shouldn't do that." :) Sincerely, Dudley On Wed, Jul 15, 2009 at 11:38 AM, Dudley Fox wrote: > I want to create a new type of field for django model

How to implement a custom field (or relation) which supports List of Strings

2009-07-15 Thread Dudley Fox
I want to create a new type of field for django models that is basically a ListOfStrings. So in your model code you would have the following: models.py: from django.db import models class ListOfStringsField(???): ??? class myDjangoModelClass(): myName = models.CharField(