Oh, thanks, that works!

On 26 ноя, 13:03, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Nov 26, 10:01 am, Denis Cheremisov <denis.cheremi...@gmail.com>
> wrote:
>
> > I have models directory with several files in it (models/__init__.py,
> > models/main.py, ...)
> > I have basic "Article" model and many models derived from it. So, I
> > would like to place them into separate file: models/article.py
> > But I also have several models ("Image" and "Section") which contain
> > ForeignKey(Article,...) and, on the  other hand, Article also has
> > ForeingKey on them. I tried to use "<app name>.models.main.Image" and
> > "<app name>.models.main.Section" as model name, but it didnt' work.
> > Is there any way to place Article and Article-based models into
> > separate file
>
> As long as your __init__.py is importing all the models from the
> various files, you can just refer to them as appname.Image,
> appname.Section etc.
> --
> DR.

--

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.


Reply via email to