Re: Schema Alteration update

2012-09-28 Thread Andrew Godwin
Yeah, I think I mentioned it a couple of times at DjangoCon but perhaps not
loudly enough - Jacob and I had a talk at DjangoCon EU where he said he
wanted it all in core, and I tend to agree.

Preston has had a look at what I'm doing/planning with AppCache and
apparently it'll be compatable with what's in app-loading with a little
work, which is reassuring.

Only remaining question is whether migration-runner (the smarts) should be
in contrib or core. I know Alex believes core; I'm split, seeing as some
people will want to turn it off (so contrib), but it overrides core
commands like syncdb (so core would be cleaner).

Andrew

On Fri, Sep 28, 2012 at 3:22 AM, Russell Keith-Magee <
russ...@keith-magee.com> wrote:

> On Fri, Sep 28, 2012 at 8:29 AM, Jacob Kaplan-Moss 
> wrote:
> > On Fri, Sep 28, 2012 at 4:55 AM, Russell Keith-Magee
> >  wrote:
> >> Have I missed part of the discussion here? At DjangoCon, South was
> >> still going to exist (as the "smarts" part of the problem) -- has this
> >> changed?
> >
> > Obviously nothing's really decided, but I've been asking Andrew to
> > push for getting full-blown solution into core. I just don't see the
> > point in beating around the bush any more. The lack of a built-in
> > schema migration tool in Django is a major wart, so let's just fix it.
>
> No disagreement from me that this is a big wart that needs to be
> addressed. I just missed the memo about us merging the smarts bit into
> trunk.
>
> Russ %-)
>
> --
> 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.
>
>

-- 
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: #3011 - Custom User Models -- Call for final review

2012-09-28 Thread rizumu

It is great to see this merged, it has been a long time coming. :)

I would like to add backwards compatibility to some apps and I'm looking 
for a recommended technique. Could the following, or a better option, find 
its way into the docs in a section specific to app developers tasked with 
adding support for auth_user_model. Having a recommendation in the docs 
would make pull requests with this feature more likely and easier to handle.


try:
from django.contrib.auth import get_user_model
auth_user_model = get_user_model()
except ImportError:
from django.contrib.auth.models import User
auth_user_model = User

class SomeModel(models.Model):

author = models.ForeignKey(auth_user_model)

Because this isn't backwards compatible:
   
class SomeModel(models.Model):

author = models.ForeignKey(settings.AUTH_USER_MODEL)

best,
Tom


-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-developers/-/xrDV4FTmGkgJ.
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: #3011 - Custom User Models -- Call for final review

2012-09-28 Thread Mark Lavin


I've been thinking about external app compatibility as well and it seems like:


from django.conf import settings


AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')


class SomeModel(models.Model):

author = models.ForeignKey(AUTH_USER_MODEL)

is the easiest solution to me.


Best,


Mark


On Friday, September 28, 2012 8:14:57 AM UTC-4, rizumu wrote:
>
>
> It is great to see this merged, it has been a long time coming. :)
>
> I would like to add backwards compatibility to some apps and I'm looking 
> for a recommended technique. Could the following, or a better option, find 
> its way into the docs in a section specific to app developers tasked with 
> adding support for auth_user_model. Having a recommendation in the docs 
> would make pull requests with this feature more likely and easier to handle.
>
>
> try:
> from django.contrib.auth import get_user_model
> auth_user_model = get_user_model()
> except ImportError:
> from django.contrib.auth.models import User
> auth_user_model = User
>
> class SomeModel(models.Model):
>
> author = models.ForeignKey(auth_user_model)
>
> Because this isn't backwards compatible:
>
> class SomeModel(models.Model):
>
> author = models.ForeignKey(settings.AUTH_USER_MODEL)
>
> best,
> Tom
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-developers/-/NukaEX99YXQJ.
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: #3011 - Custom User Models -- Call for final review

2012-09-28 Thread Russell Keith-Magee
On Fri, Sep 28, 2012 at 8:14 PM, rizumu  wrote:
>
> It is great to see this merged, it has been a long time coming. :)
>
> I would like to add backwards compatibility to some apps and I'm looking for
> a recommended technique. Could the following, or a better option, find its
> way into the docs in a section specific to app developers tasked with adding
> support for auth_user_model. Having a recommendation in the docs would make
> pull requests with this feature more likely and easier to handle.

Adding a backwards compatibility shim has already been discussed (a
few messages earlier in this thread). The plan is to back port two
parts of the #3011 patch to 1.4:

 * The global setting AUTH_USER_MODEL = 'auth.User'

 * An implementation of get_user_model() that always returns auth.User.

This means that when 1.5 is released (and we release 1.4.2), the same
User access code will run on the current stable and security versions.
I haven't added this code to the 1.4 branch yet, but my intention is
to do so before the 1.5 release is finalised.

Yours,
Russ Magee %-)

-- 
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.



localflavor for Singapore

2012-09-28 Thread James Rivett-Carnac
I have created a ticket for and submitted a patch for the creation of 
Singapore local flavor.

Includes ID numbers (NRIC, FIN), telephones (landlines, mobile phones), and 
postal codes (based on ura.gov.sg list).

regards,

James

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-developers/-/oX8mqcIslDsJ.
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: localflavor for Singapore

2012-09-28 Thread James Rivett-Carnac
forgot to include the ticket number:
https://code.djangoproject.com/ticket/19037

On Friday, 28 September 2012 22:15:54 UTC+8, James Rivett-Carnac wrote:
>
> I have created a ticket for and submitted a patch for the creation of 
> Singapore local flavor.
>
> Includes ID numbers (NRIC, FIN), telephones (landlines, mobile phones), 
> and postal codes (based on ura.gov.sg list).
>
> regards,
>
> James
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-developers/-/hK4NkTAKCeQJ.
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.



django 1.3 google3 statics files not found

2012-09-28 Thread sandeez
Hi I am newbie to django in google3 app engine. I am currently working on a 
project and am using django 1.3 in appengine. Everytime I build the 
project, statics are not found. Please suggest any settings required for 
this.I have refferred following link to build the project. 
https://sites.google.com/a/google.com/django/home/hosting-platforms/app-engine

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-developers/-/aArr60smSFEJ.
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: django 1.3 google3 statics files not found

2012-09-28 Thread Aymeric Augustin
Hello,

Please post questions about using Django to django-users.

The topic of this list is the development of Django itself.

Thanks!

-- 
Aymeric.

Le 28 sept. 2012 à 21:36, sandeez  a écrit :

> Hi I am newbie to django in google3 app engine. I am currently working on a 
> project and am using django 1.3 in appengine. Everytime I build the project, 
> statics are not found. Please suggest any settings required for this.I have 
> refferred following link to build the project. 
> https://sites.google.com/a/google.com/django/home/hosting-platforms/app-engine
> 
> Thanks.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django developers" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/django-developers/-/aArr60smSFEJ.
> 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.

-- 
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: django 1.3 google3 statics files not found

2012-09-28 Thread Marijonas Petrauskas
Also, you should not post confidential stuff here (the link is only
accessible from internal network).

On Fri, Sep 28, 2012 at 8:50 PM, Aymeric Augustin <
aymeric.augus...@polytechnique.org> wrote:

> Hello,
>
> Please post questions about using Django to django-users.
>
> The topic of this list is the development of Django itself.
>
> Thanks!
>
> --
> Aymeric.
>
> Le 28 sept. 2012 à 21:36, sandeez  a écrit :
>
> Hi I am newbie to django in google3 app engine. I am currently working on
> a project and am using django 1.3 in appengine. Everytime I build the
> project, statics are not found. Please suggest any settings required for
> this.I have refferred following link to build the project.
> https://sites.google.com/a/google.com/django/home/hosting-platforms/app-engine
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-developers/-/aArr60smSFEJ.
> 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.
>
>
>  --
> 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.
>

-- 
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: DatabaseFeatures and supports_transactions

2012-09-28 Thread Andy Dustman
On Tue, Sep 25, 2012 at 7:57 PM, Russell Keith-Magee
 wrote:
> On Tue, Sep 25, 2012 at 11:24 PM, maxi  wrote:
>> No, I just answer because it caught my attention. Why not just trust in a
>> True/False property ?
>
> As I recall, the reason we can't just use a property is MySQL. There's
> no reliable way to tell whether the database has been set up as
> InnoDB, which supports transactions, or MyISAM, which doesn't. An
> experimental approach allows us to be certain.

Actually, there are several database engines in MySQL that support
transactions, not just InnoDB, though that's the most popular.

>> BTW, What do you mean with "commit/rollback/etc are simply no-ops" ?
>
> Exactly that. On databases that don't support transactions,
> commit/rollback etc are no-ops.

Not exactly. MySQLdb starts in transactional mode (required by
PEP-249), but if for some reason it's switched to autocommit mode,
rollback throws an exception. There's probably nothing in Django that
would set the connection to autocommit mode, though.

Additionally, MySQL (at least as of 5.0) will throw a warning ("Some
non-transactional changed tables couldn't be rolled back") if you do
try rollback on non-transactional tables If you run your MySQL session
in ANSI mode, this becomes an error and will produce an exception in
MySQLdb.

http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-transactions.html

I've kicked around the idea of making a mysql_ansi database driver for
Django but there hasn't been a compelling reason to do it.
-- 
Question the answers

-- 
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: localflavor for Singapore

2012-09-28 Thread Russell Keith-Magee
Hi James,

Thanks for the submission. Two quick points:

 1) As we describe in our contributors guide, there's no need to post
a message to django-dev letting us know you've opened a ticket. Trac
has plenty of triggers and notifications to let people know about new
tickets, including an email feed of every ticket update that is made.

 2) We're looking to prune localflavor out of Django in the near
future -- probably for the 1.5 timeframe. When we do this, we'll be
opening up maintenance of the individual localflavor packages to the
community.

Yours,
Russ Magee %-)

On Fri, Sep 28, 2012 at 10:15 PM, James Rivett-Carnac
 wrote:
> I have created a ticket for and submitted a patch for the creation of
> Singapore local flavor.
>
> Includes ID numbers (NRIC, FIN), telephones (landlines, mobile phones), and
> postal codes (based on ura.gov.sg list).
>
> regards,
>
> James
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-developers/-/oX8mqcIslDsJ.
> 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.

-- 
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: DatabaseFeatures and supports_transactions

2012-09-28 Thread Russell Keith-Magee
On Sat, Sep 29, 2012 at 5:27 AM, Andy Dustman  wrote:
> On Tue, Sep 25, 2012 at 7:57 PM, Russell Keith-Magee
>  wrote:
>> On Tue, Sep 25, 2012 at 11:24 PM, maxi  wrote:
>>> No, I just answer because it caught my attention. Why not just trust in a
>>> True/False property ?
>>
>> As I recall, the reason we can't just use a property is MySQL. There's
>> no reliable way to tell whether the database has been set up as
>> InnoDB, which supports transactions, or MyISAM, which doesn't. An
>> experimental approach allows us to be certain.
>
> Actually, there are several database engines in MySQL that support
> transactions, not just InnoDB, though that's the most popular.

For sure. My point is that it isn't as simple as "MySQL supports (or
doesn't support) transactions", so it can't be a simple boolean flag.

Yours,
Russ Magee %-)

-- 
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: Streaming HttpResponse revisted. Any core devs, please take a look if you can :)

2012-09-28 Thread Tai Lee
Docs have been added (patch should be complete now) and pull request has 
been opened, at Anssi's request.

https://groups.google.com/d/topic/django-developers/RrNPfuJxnlM/discussion

Cheers.
Tai.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-developers/-/iOkzMIonkdsJ.
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.