On Wed, 3 Jul 2013 15:30:16 -0300 "Rafael E. Ferrero" <rafael.ferr...@gmail.com> wrote:
> just import one model into another using import statement. > > > 2013/7/3 Branko Majic <bra...@majic.rs> > > > On Wed, 3 Jul 2013 05:03:35 -0700 (PDT) > > Vamsi Popuri <vamsi.pop...@micropyramid.com> wrote: > > > > > I have 2 projects. They are* project 1* and *project 2*. > > > > > > *Project 2* has > > > *models.py* > > > class Address(models.Model): > > > Street = models.CharField(max_length=50) > > > pin = models.CharField(max_length=20) > > > > > > *forms.py * > > > class Address(forms.Form): > > > ...... > > > > > > My question is, In *project 1* i wanna access Address model in the > > *project > > > 2*....Is it possible, then please let me know how to do .. > > > > > > Thanks for advance > > > > > > > Are you trying to access the _data_ (in database) from project 1, or do > > you want to reuse the model definition in project 2 (where project 2 > > would have its own data independent from project 1)? > > In that case you can either: 1. Copy the model definition from project 1's application models.py to project 2's application models.py. 2. Create a small shared application for this purpose and have it included in both projects (this is worth the effort if you think you'll be reusing the model definition over and over again in multiple applications, and you expect to make lots of changes to it). Best regards -- Branko Majic Jabber: bra...@majic.rs Please use only Free formats when sending attachments to me. Бранко Мајић Џабер: bra...@majic.rs Молим вас да додатке шаљете искључиво у слободним форматима.
signature.asc
Description: PGP signature