Re: Django, python, MYSQL, Eclipse3.7
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAEBAgAGBQJR2XWcAAoJECtGpaYHamaxLR0QAJymwLm3wzDRF/XZ6WHwsGVQ
S635TtWmQk6pVaKonQu4wlUZQ03BCPiNBUYnmxNy1Fxt7YIkfdO3HvFUfY0/EIU0
fmfpjiQLHvUJ+tcZMSS+oF3GudS8xZ3uj9Kly/dR7iCiICsYsUx6Dh2wYvojsg8d
0LAt4AH67k3fOs9Lj0yD8Rc0OZsmIjvrf6vFQ/N1i3KD43VM2tWQlBAOpb9Xx+xx
4tCfEEU2ctNAtgvk3CtRwSDpgosQsOvaHgsV4lg5wWd5D1UvFBK8CBTOGd8FGJ9M
rvn9GR2pgBK6naH8GJ6hLSULuwn6oCNpxPh2F9MPYWYSuEqCQYW895vOoJrpLFTP
T9icArjG2SNXSOXMZFrdWWzxgw3Nr6dZ47VdD3FFrhKyfuz8tU/SWhmyCwSRoFDS
4w84PBpdU/L4I54kJQM0ivOpknLsSusISBVQO87PkdQEMmItZYVfeY0yh8/Mh0cH
1bBZq5if/A70Tqg0xPWElXI6j1OBhTPpKsUxlz1QGOp7YCTK+VzFlBw98DFzqpP1
2W30WjAjK5GGbDf1oULJ+mOuaSORZA/+Xofwa7nbLQ3aIuYpU6tlhjpDuHjOkucM
7oePbRRGasZPB7TJcuUUSYjNTI5VoV7qbLkFae8CL/5FJdCUCbmWeiYDRiiEfrjq
GojkPbVqhhB0F6d9D1Ni
=GdKK
-----END PGP SIGNATURE-----
On Wed, 3 Jul 2013 15:30:16 -0300
"Rafael E. Ferrero" <rafael.ferrero@gmail.com> wrote:
> just import one model into another using import statement.
>
>
> 2013/7/3 Branko Majic <branko@majic.rs>
>
> > On Wed, 3 Jul 2013 05:03:35 -0700 (PDT)
> > Vamsi Popuri <vamsi.popuri@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: branko@majic.rs
Please use only Free formats when sending attachments to me.
Бранко Мајић
Џабер: branko@majic.rs
Молим вас да додатке шаљете искључиво у слободним форматима.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home