Re: #7198 - Better error message when app is missing models.py

2011-09-13 Thread Russell Keith-Magee
On Tue, Sep 13, 2011 at 4:41 PM, Jannis Leidel  wrote:
> On 12.09.2011, at 22:44, Carl Meyer wrote:
>
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>>
>> Hi Gary,
>>
>> On 09/12/2011 12:04 AM, Gary Wilson Jr. wrote:
>>> I'm a fan of not requiring a models.py, as IMHO it shouldn't be any
>>> different than other common files found in an app e.g. urls.py,
>>> templatetags dir, etc.  If I don't need any models for my app, then
>>> why must I still have a models.py?  That said, it also seems there
>>> could be some backwards incompatibilities if code or external tools
>>> rely on a valid app including a models.py file.
>>
>> Actually, I think there's generally consensus that requiring models.py
>> is not ideal. There's already an existing GSoC branch (app-loading),
>> which already fixes the models.py issue (AFAIK) but is somewhat
>> languishing for lack of attention. So I think the best path towards
>> getting that fixed is to check out that branch and help get it in
>> merge-ready shape. Jannis was the mentor for that GSoC, he or Arthur
>> Koziel (the student) can probably comment most knowledgeably about what
>> needs to be done.
>
>
> Right now this needs a thorough code review to decide how to go forward. There
> are several open questions, e.g. how to get the general (non-app-loading) test
> suite integrated with the changes of the app loading. The main problem there
> is that runtests.py has a hardwired assumption about how the app cache works,
> basically a chicken-egg problem. That said, the app-loading changes itself is
> well tested separately as pure-Python unit tests [1].
>
> Some people have started to review but never got back to me, which -- and I
> hate to write that since Arthur and me spent so much time on it -- makes me
> wonder if we ever get close enough to merging this. I'm convinced it's really
> useful, but as it's such a core part of Django it also definitely needs more
> than two sets of eyes. Was there any interest at DjangoCon US?

Yes - there was a huge amount of interest; especially, given that it
provides a way to solve the "app startup" problem, and provides the
starting point for addressing the custom User model problem.

As one of the people who has let you down on reviews -- I apologize. I
was hoping to get a chance to look at this at DjangoCon, but I didn't
get the time. Now I'm back in the office, I'm being slowly swallowed
by work. I'd like to be able to commit to doing a review in the near
future, but being realistic, that isn't going to happen any time soon.

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: #7198 - Better error message when app is missing models.py

2011-09-13 Thread Jannis Leidel
On 12.09.2011, at 22:44, Carl Meyer wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Hi Gary,
> 
> On 09/12/2011 12:04 AM, Gary Wilson Jr. wrote:
>> I'm a fan of not requiring a models.py, as IMHO it shouldn't be any
>> different than other common files found in an app e.g. urls.py,
>> templatetags dir, etc.  If I don't need any models for my app, then
>> why must I still have a models.py?  That said, it also seems there
>> could be some backwards incompatibilities if code or external tools
>> rely on a valid app including a models.py file.
> 
> Actually, I think there's generally consensus that requiring models.py
> is not ideal. There's already an existing GSoC branch (app-loading),
> which already fixes the models.py issue (AFAIK) but is somewhat
> languishing for lack of attention. So I think the best path towards
> getting that fixed is to check out that branch and help get it in
> merge-ready shape. Jannis was the mentor for that GSoC, he or Arthur
> Koziel (the student) can probably comment most knowledgeably about what
> needs to be done.


Right now this needs a thorough code review to decide how to go forward. There
are several open questions, e.g. how to get the general (non-app-loading) test
suite integrated with the changes of the app loading. The main problem there
is that runtests.py has a hardwired assumption about how the app cache works,
basically a chicken-egg problem. That said, the app-loading changes itself is
well tested separately as pure-Python unit tests [1].

Some people have started to review but never got back to me, which -- and I
hate to write that since Arthur and me spent so much time on it -- makes me
wonder if we ever get close enough to merging this. I'm convinced it's really
useful, but as it's such a core part of Django it also definitely needs more
than two sets of eyes. Was there any interest at DjangoCon US?

Jannis

1: https://github.com/jezdez/django/tree/app-loading/tests/appcachetests

-- 
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: #7198 - Better error message when app is missing models.py

2011-09-12 Thread Jacob Kaplan-Moss
On Mon, Sep 12, 2011 at 3:44 PM, Carl Meyer  wrote:
> Actually, I think there's generally consensus that requiring models.py
> is not ideal.

Yeah, that sounds about right. I get bitten by missing models.py all
the time, and I should supposedly know better. It's lousy usability,
so let's focus on getting rid of the requirement not fixing the error
message.

Jacob

-- 
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: #7198 - Better error message when app is missing models.py

2011-09-12 Thread Carl Meyer
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Gary,

On 09/12/2011 12:04 AM, Gary Wilson Jr. wrote:
> I'm a fan of not requiring a models.py, as IMHO it shouldn't be any
> different than other common files found in an app e.g. urls.py,
> templatetags dir, etc.  If I don't need any models for my app, then
> why must I still have a models.py?  That said, it also seems there
> could be some backwards incompatibilities if code or external tools
> rely on a valid app including a models.py file.

Actually, I think there's generally consensus that requiring models.py
is not ideal. There's already an existing GSoC branch (app-loading),
which already fixes the models.py issue (AFAIK) but is somewhat
languishing for lack of attention. So I think the best path towards
getting that fixed is to check out that branch and help get it in
merge-ready shape. Jannis was the mentor for that GSoC, he or Arthur
Koziel (the student) can probably comment most knowledgeably about what
needs to be done.

Carl
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5ub0QACgkQ8W4rlRKtE2cISACgh/lYqhb4OR4aqllMPR4xyG4P
c8MAnRyh+tdcXCpxTq6Z8g5L+MNNC7ZX
=pVuz
-END PGP SIGNATURE-

-- 
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: #7198 - Better error message when app is missing models.py

2011-09-12 Thread Gary Wilson Jr.
On Fri, Sep 9, 2011 at 4:35 PM, Justin Lilly  wrote:
> Not sure why this particular ticket is marked as DDN, as it seems like
> a no-brainer. The patch provides a more clear error message when a
> user is attempting to load an app which doesn't have a models.py.
>
> https://code.djangoproject.com/ticket/7198
> https://github.com/django/django/pull/39
>
> Happy to respond to any feedback, as I think this is a worthwhile
> change.

As Carl recently commented on the referenced ticket, the DDN was
likely due to a decision on whether or not to require a models.py at
all.

I'm a fan of not requiring a models.py, as IMHO it shouldn't be any
different than other common files found in an app e.g. urls.py,
templatetags dir, etc.  If I don't need any models for my app, then
why must I still have a models.py?  That said, it also seems there
could be some backwards incompatibilities if code or external tools
rely on a valid app including a models.py file.

For the record, about 20% of the models.py files in the django
codebase are empty (or just contain a comment):
$ find . -size -60c -name 'models.py' | wc -l
44
$ find . -name 'models.py' | wc -l
211

The issue of a missing models.py file also seems to be a frequent
visitor to our ticketing system:
https://code.djangoproject.com/ticket/3125
https://code.djangoproject.com/ticket/3310
https://code.djangoproject.com/ticket/4153
https://code.djangoproject.com/ticket/6883
https://code.djangoproject.com/ticket/7198
https://code.djangoproject.com/ticket/10661
https://code.djangoproject.com/ticket/13985
https://code.djangoproject.com/ticket/15605

...and there's been a few occasions where we've had our own issues
with missing models.py files:
https://code.djangoproject.com/changeset/6991
https://code.djangoproject.com/changeset/7950
https://code.djangoproject.com/changeset/12156
https://code.djangoproject.com/changeset/12170
https://code.djangoproject.com/changeset/13670

Gary

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



#7198 - Better error message when app is missing models.py

2011-09-09 Thread Justin Lilly
Not sure why this particular ticket is marked as DDN, as it seems like
a no-brainer. The patch provides a more clear error message when a
user is attempting to load an app which doesn't have a models.py.

https://code.djangoproject.com/ticket/7198
https://github.com/django/django/pull/39

Happy to respond to any feedback, as I think this is a worthwhile
change.

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