Hi Fabien. > App User: > class User: > #some fields > > App Blog > class Blog: > author = models.ForeignKey(User.user) > > Is-it possible to do that ?
Sure. Models are regular python classes, all you must do is to import it's module before using it. Like: from django.contrib.auth.models import User (now you can use the User model on you bloggin app) If you want to import the Blog model from another app ,you can do the same: form myproject.blog.models import Blog # here myproject is the name where the blog app sits. One caveat though. If you are importing the user model, you can be sure that i will be on every django install and you already know the path to it. If you plan to "plug" you blog app into other projects, you have no way to know where on the path it will be (for example it could be on fabienapps.blog or myclient.blog). in this case you can find out where the app lives : from django.db.models.loading import get_app blog = get_app('blog') from blog.models import Blog cheers arthur > -- > Fabien SCHWOB > _____________________________________________________________ > Derrière chaque bogue, il y a un développeur, un homme qui s'est trompé. > (Bon, OK, parfois ils s'y mettent à plusieurs). --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---