Re: ManyToOne to auth.models.User

2009-12-26 Thread TiNo
On Mon, Dec 14, 2009 at 15:52, Itay Donenhirsch  wrote:

> any progress?
>

Well, I guess I'll use a 'profile' although it feels like there should be
more logical way, but I guess that depends on the extensibility of the User
model...

On Wed, Dec 9, 2009 at 12:09 PM, Itay Donenhirsch  wrote:
> > use a userprofile
> > see http://docs.djangoproject.com/en/dev/topics/auth/, search for
> "userprofile"
> > also take a look at
> >
> http://www.b-list.org/weblog/2006/jun/06/django-tips-extending-user-model/
> >
> >
> > On Tue, Dec 8, 2009 at 11:53 PM, TiNo  wrote:
> >> On Tue, Dec 8, 2009 at 12:58, Itay Donenhirsch  wrote:
> >>>
> >>> one to many from year to user is same as many to one from a
> >>> user to a year.
> >>
> >> Yes, but how? :D I can't place a FK on the User...
> >>
> >> --
> >>
> >> 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+unsubscr...@googlegroups.com
> .
> >> For more options, visit this group at
> >> http://groups.google.com/group/django-users?hl=en.
> >>
> >
>

--

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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: ManyToOne to auth.models.User

2009-12-09 Thread Itay Donenhirsch
use a userprofile
see http://docs.djangoproject.com/en/dev/topics/auth/, search for "userprofile"
also take a look at
http://www.b-list.org/weblog/2006/jun/06/django-tips-extending-user-model/


On Tue, Dec 8, 2009 at 11:53 PM, TiNo  wrote:
> On Tue, Dec 8, 2009 at 12:58, Itay Donenhirsch  wrote:
>>
>> one to many from year to user is same as many to one from a
>> user to a year.
>
> Yes, but how? :D I can't place a FK on the User...
>
> --
>
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

--

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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: ManyToOne to auth.models.User

2009-12-08 Thread TiNo
On Tue, Dec 8, 2009 at 12:58, Itay Donenhirsch  wrote:

> one to many from year to user is same as many to one from a
> user to a year.
>

Yes, but how? :D I can't place a FK on the User...

--

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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: ManyToOne to auth.models.User

2009-12-08 Thread Itay Donenhirsch
oopsy, one to many from year to user is same as many to one from a
user to a year.

On Tue, Dec 8, 2009 at 1:57 PM, Itay Donenhirsch  wrote:
> hey there,
> why not do one to many from each user to a year? same thing as many to
> one from a year to a user...
> itay
>
>
> On Tue, Dec 8, 2009 at 1:51 PM, TiNo  wrote:
>>> TiNo wrote:
>>> > On Sun, Nov 15, 2009 at 09:31, Dennis Kaarsemaker
>>> > wrote:
>>> >
>>> >
>>> >> On za, 2009-11-14 at 15:53 -0800, TiNo wrote:
>>> >>
>>> >>
>>> >>> In my apps, Users of the app participate in a certain Year. I would
>>> >>> like a Year to continue a ManyToOne relationship with a User.
>>> Don't you need a many to many relationship anyway?  Will a user only be
>>> limited to one year?
>>
>> A User only participates in one year, yes. So a ManyToMany would not be
>> good.
>> Anybody else a solution?
>> Tino
>>
>> --
>>
>> 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+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>

--

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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: ManyToOne to auth.models.User

2009-12-08 Thread Itay Donenhirsch
hey there,
why not do one to many from each user to a year? same thing as many to
one from a year to a user...
itay


On Tue, Dec 8, 2009 at 1:51 PM, TiNo  wrote:
>> TiNo wrote:
>> > On Sun, Nov 15, 2009 at 09:31, Dennis Kaarsemaker
>> > wrote:
>> >
>> >
>> >> On za, 2009-11-14 at 15:53 -0800, TiNo wrote:
>> >>
>> >>
>> >>> In my apps, Users of the app participate in a certain Year. I would
>> >>> like a Year to continue a ManyToOne relationship with a User.
>> Don't you need a many to many relationship anyway?  Will a user only be
>> limited to one year?
>
> A User only participates in one year, yes. So a ManyToMany would not be
> good.
> Anybody else a solution?
> Tino
>
> --
>
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

--

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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: ManyToOne to auth.models.User

2009-12-08 Thread TiNo
>
> TiNo wrote:
> > On Sun, Nov 15, 2009 at 09:31, Dennis Kaarsemaker <
> den...@kaarsemaker.net>wrote:
> >
> >
> >> On za, 2009-11-14 at 15:53 -0800, TiNo wrote:
> >>
> >>
> >>> In my apps, Users of the app participate in a certain Year. I would
> >>> like a Year to continue a ManyToOne relationship with a User.
> Don't you need a many to many relationship anyway?  Will a user only be
> limited to one year?
>

A User only participates in one year, yes. So a ManyToMany would not be
good.

Anybody else a solution?

Tino

--

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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: ManyToOne to auth.models.User

2009-12-07 Thread Carl Zmola


TiNo wrote:
> On Sun, Nov 15, 2009 at 09:31, Dennis Kaarsemaker 
> wrote:
>
>   
>> On za, 2009-11-14 at 15:53 -0800, TiNo wrote:
>>
>> 
>>> In my apps, Users of the app participate in a certain Year. I would
>>> like a Year to continue a ManyToOne relationship with a User. 
Don't you need a many to many relationship anyway?  Will a user only be 
limited to one year?

I added a user profile to add a many to many field to user.  I just need 
to figure out how to get it to show up in the admin for my "year" model. 
It shows up fine in the user model now.

Carl

-- 
Carl Zmola
301-562-1900 x315
czm...@woti.com


--

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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: ManyToOne to auth.models.User

2009-11-15 Thread Andy Mckay
On 09-11-15 7:00 AM, TiNo wrote:
> On Sun, Nov 15, 2009 at 09:31, Dennis Kaarsemaker
> mailto:den...@kaarsemaker.net>> wrote:
>
> On za, 2009-11-14 at 15:53 -0800, TiNo wrote:
>
>  > In my apps, Users of the app participate in a certain Year. I would
>  > like a Year to continue a ManyToOne relationship with a User. As
>  > creating a ForeignKey on a User is not possible, what would be the
>  > best way to do this? I don't need a full-blown profile for a user,
>  > just this connection with a year.
>
> Creating a ForeignKey to django.contrib.auth.models.User is definitely
> possible.
>
>
> Of course. But having each User have a ForeignKey to a Year is not..
> Which is what I want.

You could write your own user model. But if you don't want to do that, 
make a profile and put the year on that. Or use model inheritance. Or 
make a foreign key on another model to the User object (as Dennis noted) 
and then use reverse lookups.

Personally I would recommend making a profile, you'll likely be adding 
more to it.
-- 
   Andy McKay, @clearwind
   Training: http://clearwind.ca/training/

--

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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=.




Re: ManyToOne to auth.models.User

2009-11-15 Thread TiNo
On Sun, Nov 15, 2009 at 09:31, Dennis Kaarsemaker wrote:

> On za, 2009-11-14 at 15:53 -0800, TiNo wrote:
>
> > In my apps, Users of the app participate in a certain Year. I would
> > like a Year to continue a ManyToOne relationship with a User. As
> > creating a ForeignKey on a User is not possible, what would be the
> > best way to do this? I don't need a full-blown profile for a user,
> > just this connection with a year.
>
> Creating a ForeignKey to django.contrib.auth.models.User is definitely
> possible.
>

Of course. But having each User have a ForeignKey to a Year is not.. Which
is what I want.

Tino

--

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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=.




Re: ManyToOne to auth.models.User

2009-11-15 Thread Dennis Kaarsemaker
On za, 2009-11-14 at 15:53 -0800, TiNo wrote:

> In my apps, Users of the app participate in a certain Year. I would
> like a Year to continue a ManyToOne relationship with a User. As
> creating a ForeignKey on a User is not possible, what would be the
> best way to do this? I don't need a full-blown profile for a user,
> just this connection with a year.

Creating a ForeignKey to django.contrib.auth.models.User is definitely
possible.

-- 
Dennis K.

The universe tends towards maximum irony. Don't push it.

--

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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=.