Re: Include form in template tag

2010-10-04 Thread olivergeorge
Hey Anton

Thanks for this.  I had the same problem and your "..forms" style
import statement solved it.

I'd love to get to the bottom of why this is necessary - something in
how tags are loaded I guess.

cheers, Oliver

On Sep 24, 12:41 am, Anton Danilchenko 
wrote:
> In my case this work well:
>
> from ..forms import MessageSearchForm
>
> Maybe we have other solution for this?
>
> On 23 сен, 16:46, Anton Danilchenko 
> wrote:
>
>
>
> > Hi!
>
> > I have created templatetag (used Django 1.2.3) in templatetags/
> > board.py file. I need import form class from application.
>
> > Structure of project is:
> > + board/
> > +++ views.py
> > +++ forms.py
> > +++ templatetags/
> > + board.py
> > + ... some other project applications ...
>
> > How can I do import of form from the file forms.py?
>
> > I try to do this:
> > 1) from models import Message
> > 2) from board.models import Message
> > 3) from myprojectname.board.models import Message
>
> > All this not work and show error message like this: "'board' is not a
> > valid tag library: ImportError raised loading
> > board.templatetags.board: No module named models"
>
> > Please help.

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



Styling a formset

2009-08-10 Thread olivergeorge

Hello

I'm trying to add some css styling to fields in a formset but there
aren't an good classes to work with.  Each field has a id which could
be used for styling but it has it's index embedded in it.

For example:
id="id_educationequipment_set-0-id"

That's not very helpful for CSS... I'd need to repeat my CSS styles
for every possible index!  Can anyone suggest a way to add extra css
markers to use?

This seems like adding some additional classes would work nicely:
class="field_column1 field_educationequipment_set"

Any advice greatly appreciated.

cheers, Oliver

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---