Re: proposal: post-collectstatic signal

2012-11-13 Thread Donald Stufft
On Tuesday, November 13, 2012 at 10:43 PM, Justin Holmes wrote:
> 
> My only concern is that we'll limit our audience by requiring users to use a 
> specific STATICFILES_STORAGE.  What if they're already using a custom one?
 Put the meat of your backend in a mixin, provide options for the default ones, 
and
instructions on mixing it into custom ones.

-- 
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: proposal: post-collectstatic signal

2012-11-13 Thread Justin Holmes
Ptone: Coldbrew already uses a templatetag for development, but for
production, we want people to be able to have the collectstatic experience
and simple find collected coffee as compiled JS in their static directories.

As you suggest, I have reluctance about Bruno's solution.  Also, I'd be
concerned about the message sent to future generations by amending the docs
to read, "ensure that 'coldbrew' appears after 'staticfiles' in your
INSTALLED_APPS tuple."

Wrapping collectstatic is an enormously simple and elegant solution - to my
knowledge, this hadn't even crossed our minds at slashRoot.

Janis: I hadn't noticed that we can obtain a list of collected paths from
post_process - this is wonderful!  This seems like a winning solution at
least for obtaining a list of directories in which we need to search for
unbrewed coffee.  Come to think of it - is this the best way to do this?
Or is there a STATICFILES_STORAGE agnostic way of obtaining an
authoritative list of staticfiles locations?

My only concern is that we'll limit our audience by requiring users to use
a specific STATICFILES_STORAGE.  What if they're already using a custom one?




On Mon, Nov 12, 2012 at 3:08 PM, Jannis Leidel  wrote:

>
> On 11.11.2012, at 17:09, Justin Holmes  wrote:
>
> > My sense is that there are a growing number of use cases, but the one
> that I currently have in mind is for django-coldbrew.  I want to be
> able to compile all the coffeescript in a project during the collectstatic
> process.  Currently, we have a management command, "collect_coldbrew" - but
> I'd like to allow users to have this occur automatically during
> collectstatic.
>
> The collectstatic command calls a method "post_process" method [1] of the
> staticfiles storage if it exists and passes a list of file paths that have
> been collected [2].
>
> In other words, hooking into collectstatic is as easy as writing an own
> subclass of StaticFilesStorage (or whatever storage backend you've set
> STATICFILES_STORAGE) and implement the method.
>
> Would that suffice for your use case?
>
> Jannis
>
> 1:
> https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#django.contrib.staticfiles.storage.StaticFilesStorage.post_process
> 2:
> https://github.com/django/django/blob/master/django/contrib/staticfiles/management/commands/collectstatic.py#L116-127
>
> > I'm not sure if the best timing for the signal is at the end of the
> complete collectstatic process or at the end of each iteration (ie, one
> signal for each static directory that django finds).
> >
> >
> > On Sun, Nov 11, 2012 at 4:55 AM, Alex Gaynor 
> wrote:
> > What's the use case?
> >
> > Alex
> >
> >
> > On Sat, Nov 10, 2012 at 8:48 PM, Justin Holmes 
> wrote:
> > Currently, our only built-in management signal is post-syncdb.
> >
> > I propose (and, notwithstanding objection, will build)
> post-collectstatic.
> >
> > Is this reasonable?  Is there another, less invasive way to hook logic
> into collectstatic?
> >
> >
> > --
> > Justin Holmes
> > Chief Chocobo Breeder, slashRoot
> >
> > slashRoot: Coffee House and Tech Dojo
> > New Paltz, NY 12561
> > 845.633.8330
> >
> > --
> > 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.
> >
> >
> >
> > --
> > "I disapprove of what you say, but I will defend to the death your right
> to say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
> > "The people's good is the highest law." -- Cicero
> >
> >
> > --
> > 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.
> >
> >
> >
> > --
> > Justin Holmes
> > Chief Chocobo Breeder, slashRoot
> >
> > slashRoot: Coffee House and Tech Dojo
> > New Paltz, NY 12561
> > 845.633.8330
> >
> > --
> > 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 

Re: Testing documentation

2012-11-13 Thread Tim Graham
This looks great, thanks for your work on this!  I've made some minor 
revisions and put up an HTML version of the new tutorial for easier review.

http://techytim.com/django/9962/intro/tutorial05.html

On Monday, November 5, 2012 12:06:53 PM UTC-5, Daniele Procida wrote:
>
> I have done some work on writing up a tutorial for testing (part 5 of the 
> existing tutorial, in effect). 
>
> My draft so far: 
>
> <
> https://github.com/evildmp/django/blob/testing-tutorial/docs/intro/tutorial05.txt>
>  
>
>
> I'd really appreciate feedback, on any aspect of this. 
>
> Trac ticket is . 
>
> Thanks, 
>
> Daniele 
>
>

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



Feature Request: Support for abstract models in ModelForm

2012-11-13 Thread Rohit Banga
I have some abstract models and I have created several concrete 
implementations of each of these models. The usecase is create multiple 
sets of tables across each having the same set of fields. When I use 
abstract models for modelforms it works fine until I get a unique key in 
the picture. Details of the problem I faced are detailed in this django 
ticket.
https://code.djangoproject.com/ticket/19271

Working version of code: (Works just by chance - Apparently it is not 
supported)
https://github.com/iamrohitbanga/django_ticket_19271/tree/code_working

Non-Working verison of the code (unique key in abstract model)
https://github.com/iamrohitbanga/django_ticket_19271/tree/code_not_working

Is it possible to support this feature in a future release?

Thanks
Rohit

-- 
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/-/AUVSzY--ynoJ.
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.