On Fri, Oct 3, 2008 at 5:13 PM, Gerard Petersen <[EMAIL PROTECTED]> wrote:
>
> I examined the svn tree and the patches. It seems that the diffs are for the 
> widget.py file under 'newforms', but this directory does not exist in the svn 
> tree. I've tried appending the widget classes from the ticket to:
>
> /usr/lib/python2.5/site-packages/django_src/django/forms/widgets.py
>
> I then end up in an 'import galore', that results in modifying files in the 
> app and the django source tree in more places then seems healthy. Also ending 
> up changing referencing, e.g. adding the extra 'widgets.' like this 
> widget=widgets.DateFormattedTextInput() for instance.
>
> Then the best scenario I got without errors was a form.as_table that dit not 
> generate a form. And the funny thing is everything does work when testing in 
> './manage.py shell'
>
> Besides all that, the actual way that really works, was to simply add a 
> 'datetimewidgets.py' with the classes to my app and import it.
>
> Since I would like to have it in the source tree properly ...
>
> Is the aformentionted widgets.py the right file (couldn't find that in the 
> ticket) to place the new classes?
> Should this sysadmin stay with the simple solution ... :-) and not put it in 
> the source tree?
> Is there (besides the source code ... ;-) any reading in regards to Django 
> how this is setup?

You have correctly identified the right file. The django/newforms
package was renamed to django/forms in the final days leading to the
v1.0 release, but other than this rename, there weren't any major
changes. widgets.py in the old directory corresponds to widgets.py in
the new directory. As a result of the rename, the patch won't apply
completely cleanly. This means there will be a little effort required
to update the patch for a post v1.0 source tree.

As for the 'right way' to do this - that's entirely up to you and how
comfortable you are with the tools required.

Personally - I have no problems running a heavily patched version of
Django - but then, I'm a core developer who knows the internals of
Django and is very comfortable with the git/svn/diff/patch tool set.
If you're not as comfortable with these tools, and/or you'd rather
just use a vanilla checkout, then you might want to look at
alternative approaches.

I wouldn't pin your hopes on the patch making it into trunk. I simply
can't give you any indication of when it will happen. I might happen
next week, it might happen next year. Until it happens, we won't know.
I can tell you that this isn't particular ticket isn't on my personal
to-do list.

A better approach from your perspective may be to step completely out
of the Django tree itself. Django widgets are not _required_ to be in
newforms/widgets.py (or forms/widgets.py) - they are normal Django
code, and as long as you can import the code, they can live anywhere
you want. You may find that it is easier to create your own
'gerard_widgets.py' in your own project, put the modified widgets in
that packaged, and reference those widgets rather than the Django
defaults. This means you will need to learn how to override the Django
default widgets, but that is an area that has much better
documentation.

Yours,
Russ Magee %-)

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

Reply via email to