Re: Why does get_profile exist?

2009-04-13 Thread Adi Sieker

Hi,

On 13.04.2009, at 22:30, Glenn Maynard wrote:

>
> Why do get_profile() and AUTH_PROFILE_MODULE exist, instead of just
> declaring the Profile to User relationship as OneToOne and using the
> auto-generated User.profile relationship?
>
> I just changed my Profile's User relationship from ForeignKey to
> OneToOne (the docs say to use ForeignKey, not OneToOne--is this an
> error?) and it works fine.
>
> It does mean you can access the profile without knowing the name of
> the class, but you need to know the contents of the model to do
> anything with it anyway.  Do user profiles predate reverse
> relationships?  I'm just curious about the the design rationale here.
>

oh, and this list is for the development of django.
Question about the usage of django should be directed at django-users.

adi

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---



Re: Why does get_profile exist?

2009-04-13 Thread Adi Sieker


On 13.04.2009, at 22:30, Glenn Maynard wrote:

>
> Why do get_profile() and AUTH_PROFILE_MODULE exist, instead of just
> declaring the Profile to User relationship as OneToOne and using the
> auto-generated User.profile relationship?

Probably because third party apps can then get the user profile and
don't have to rely on the profile being called profile or whatever.

adi

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---



Re: IPAddressField

2009-03-14 Thread Adi Sieker
Hi,

On 14.03.2009, at 19:22, Gregor Kling wrote:

>
> Hello,
>> The way I read the comments on the ticket the last patch supports  
>> IPv4
>> and IPv6 address.
>> See: http://code.djangoproject.com/ticket/811#comment:16
>
> Adi, if you mean this:
>*  attachment ipv6-9781.diff added.
>IPv6 patch for trunk, revision 9781
> yes you are right, there was added an IP6AddressField that handles the
> ipv6 stuff.
> The existing IPAddressField further on cares about the IPv4.

The IP6AddressField also handles IPv4 addresses, as mentioned in the  
docs section of the patch.

+.. class:: IP6AddressField([**options])
+
+An IPv4 or IPv6 address, in string format (e.g. "192.0.2.30" or
+"2a01:5d8:25ae:9451:20d:39bc:1e6:cab:b2c"). The admin represents this  
as an
+ (a single-line input).


and I guess the IPAddressField didn't get changed because the IPv6  
addresses need a longer database field,
so changing the IPAddressField would break backward compatibility.

adi


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---



Re: IPAddressField

2009-03-14 Thread Adi Sieker
Hi,

On 14.03.2009, at 10:20, Gregor Kling wrote:

>
> Hello,
> Ian Kelly schrieb:
>> On Fri, Mar 13, 2009 at 1:58 PM, Gregor Kling
>>  wrote:
>>
>>> Hello there,
>>>
>>> Regrettably the IPAddressField implementation is not what I  
>>> expect :-(.
>>> Is there by any chance, the possibilty to have a solution that  
>>> works for
>>> ipv4 *and* ipv6  in the near future ?
>>>
>>
>> See ticket #811: http://code.djangoproject.com/ticket/811
>>
> Hm, thanks for the link Ian.
> But I have some problems to understand the actual state of the patch.
> It is not yet in the trunk right now. So will it make it in 1.1 ?
>
> Barring the actual state, I do not have a good feeling about this  
> patch.
> Foremost, I think IPy really should be used, last but not lease to
> follow DRY.
>
> From a design point of view, I think the IPAddressField should rule  
> all
> ip versions.
> Certainly it is not a bad idea, to have IPv4 and IPv6 versions of this
> field.
>

The way I read the comments on the ticket the last patch supports IPv4  
and IPv6 address.
See: http://code.djangoproject.com/ticket/811#comment:16

adi


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---