RE: "remote models" with django?

2008-07-11 Thread Emily Rodgers

So you want it to interact with the db that app A would normally interact
with (not just copy your schema / methods)?

I don't really know how you can do that :( 

I have managed to interact with my db, via my django models in an app
installed in project 'my_proj', from an external script using:

from django.core.management import setup_environ
import my_proj.settings
setup_environ(my_proj.settings)

But I don't know who you could go about this without effecting your existing
django environment :(

Unless of course you use an external script to do your interacting with app
A, and have some kind of interface into it?

Not really sure I can be of much help...

> -Original Message-
> From: django-users@googlegroups.com 
> [mailto:[EMAIL PROTECTED] On Behalf Of lgr888999
> Sent: 11 July 2008 12:48
> To: Django users
> Subject: Re: "remote models" with django?
> 
> 
> I was looking for something like rails activeresources
> 
> In app A, just a regular model
> 
> class Bar(models.Model):
> text = models.CharField(_('text'), max_length=140)
> 
> in app B
> 
> #ok i cant figure out any better name than RemoteModel atm 
> class Bar(models.RemoteModel):
>site = 'http://1.2.3.4/foo/bar
> 
> 
> in some view:
> Bar.objects.filter()
> Bar.objects.get(pk=2).delete()
> Bar(text='foo').save()
> etc and it will perform http GET, POST, PUT, DELETE etc to 
> http://1.2.3.4/foo/bar
> 
> 
> Obviously, it will only work with relations that already is 
> on app A, this is mosly for denormalizing stuff to be able to 
> scale in all directions.
> 
> 
> 
> On 11 Juli, 12:35, "Emily Rodgers" <[EMAIL PROTECTED]> wrote:
> > Also, what do you mean by 'a restful model backend instead of a 
> > database backend'?
> >
> > What are you trying to do? I have some ideas, but I may be 
> barking up 
> > the wrong tree!!
> >
> >
> >
> > > -Original Message-
> > > From: django-users@googlegroups.com
> > > [mailto:[EMAIL PROTECTED] On Behalf Of lgr888999
> > > Sent: 11 July 2008 11:10
> > > To: Django users
> > > Subject: Re: "remote models" with django?
> >
> > > nope different sites on different IPs
> >
> > > On 11 Juli, 11:44, "Emily Rodgers" <[EMAIL PROTECTED]> wrote:
> > > > Are they in the same project?
> >
> > > > > -Original Message-
> > > > > From: django-users@googlegroups.com 
> > > > > [mailto:[EMAIL PROTECTED] On Behalf Of lgr888999
> > > > > Sent: 11 July 2008 10:33
> > > > > To: Django users
> > > > > Subject: "remote models" with django?
> >
> > > > > Lets say i have two django apps A and B. Lets say A has
> > > some models,
> > > > > Foo and Bar.
> >
> > > > > Now i know there are plenty of implementations to make
> > > Foo and Bar
> > > > > restfuly available via http but is there anything built
> > > yet to make
> > > > > Foo and Bar available as Models on B via http? Ie a restful 
> > > > > model backend instead of a database backend.
> >
> > --
> > IMPORTANT NOTICE: The contents of this email and any 
> attachments are confidential and may also be privileged. If 
> you are not the intended recipient, please notify the sender 
> immediately and do not disclose the contents to any other 
> person, use it for any purpose, or store or copy the 
> information in any medium.  Thank you.
> > 
> 



--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: "remote models" with django?

2008-07-11 Thread lgr888999

I was looking for something like rails activeresources

In app A, just a regular model

class Bar(models.Model):
text = models.CharField(_('text'), max_length=140)

in app B

#ok i cant figure out any better name than RemoteModel atm
class Bar(models.RemoteModel):
   site = 'http://1.2.3.4/foo/bar


in some view:
Bar.objects.filter()
Bar.objects.get(pk=2).delete()
Bar(text='foo').save()
etc and it will perform http GET, POST, PUT, DELETE etc to 
http://1.2.3.4/foo/bar


Obviously, it will only work with relations that already is on app A,
this is mosly for denormalizing stuff to be able to scale in all
directions.



On 11 Juli, 12:35, "Emily Rodgers" <[EMAIL PROTECTED]> wrote:
> Also, what do you mean by 'a restful model backend instead of a database
> backend'?
>
> What are you trying to do? I have some ideas, but I may be barking up
> the wrong tree!!
>
>
>
> > -Original Message-
> > From: django-users@googlegroups.com
> > [mailto:[EMAIL PROTECTED] On Behalf Of lgr888999
> > Sent: 11 July 2008 11:10
> > To: Django users
> > Subject: Re: "remote models" with django?
>
> > nope different sites on different IPs
>
> > On 11 Juli, 11:44, "Emily Rodgers" <[EMAIL PROTECTED]> wrote:
> > > Are they in the same project?
>
> > > > -Original Message-
> > > > From: django-users@googlegroups.com
> > > > [mailto:[EMAIL PROTECTED] On Behalf Of lgr888999
> > > > Sent: 11 July 2008 10:33
> > > > To: Django users
> > > > Subject: "remote models" with django?
>
> > > > Lets say i have two django apps A and B. Lets say A has
> > some models,
> > > > Foo and Bar.
>
> > > > Now i know there are plenty of implementations to make
> > Foo and Bar
> > > > restfuly available via http but is there anything built
> > yet to make
> > > > Foo and Bar available as Models on B via http? Ie a restful model
> > > > backend instead of a database backend.
>
> --
> IMPORTANT NOTICE: The contents of this email and any attachments are 
> confidential and may also be privileged. If you are not the intended 
> recipient, please notify the sender immediately and do not disclose the 
> contents to any other person, use it for any purpose, or store or copy the 
> information in any medium.  Thank you.
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



RE: "remote models" with django?

2008-07-11 Thread Emily Rodgers

Also, what do you mean by 'a restful model backend instead of a database
backend'?

What are you trying to do? I have some ideas, but I may be barking up
the wrong tree!!

> -Original Message-
> From: django-users@googlegroups.com 
> [mailto:[EMAIL PROTECTED] On Behalf Of lgr888999
> Sent: 11 July 2008 11:10
> To: Django users
> Subject: Re: "remote models" with django?
> 
> 
> nope different sites on different IPs
> 
> On 11 Juli, 11:44, "Emily Rodgers" <[EMAIL PROTECTED]> wrote:
> > Are they in the same project?
> >
> > > -Original Message-
> > > From: django-users@googlegroups.com
> > > [mailto:[EMAIL PROTECTED] On Behalf Of lgr888999
> > > Sent: 11 July 2008 10:33
> > > To: Django users
> > > Subject: "remote models" with django?
> >
> > > Lets say i have two django apps A and B. Lets say A has 
> some models, 
> > > Foo and Bar.
> >
> > > Now i know there are plenty of implementations to make 
> Foo and Bar 
> > > restfuly available via http but is there anything built 
> yet to make 
> > > Foo and Bar available as Models on B via http? Ie a restful model 
> > > backend instead of a database backend.
> > 
> 

-- 
IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium.  Thank you.



--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: "remote models" with django?

2008-07-11 Thread lgr888999

nope different sites on different IPs

On 11 Juli, 11:44, "Emily Rodgers" <[EMAIL PROTECTED]> wrote:
> Are they in the same project?
>
> > -Original Message-
> > From: django-users@googlegroups.com
> > [mailto:[EMAIL PROTECTED] On Behalf Of lgr888999
> > Sent: 11 July 2008 10:33
> > To: Django users
> > Subject: "remote models" with django?
>
> > Lets say i have two django apps A and B. Lets say A has some
> > models, Foo and Bar.
>
> > Now i know there are plenty of implementations to make Foo
> > and Bar restfuly available via http but is there anything
> > built yet to make Foo and Bar available as Models on B via
> > http? Ie a restful model backend instead of a database backend.
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



RE: "remote models" with django?

2008-07-11 Thread Emily Rodgers

Are they in the same project? 

> -Original Message-
> From: django-users@googlegroups.com 
> [mailto:[EMAIL PROTECTED] On Behalf Of lgr888999
> Sent: 11 July 2008 10:33
> To: Django users
> Subject: "remote models" with django?
> 
> 
> Lets say i have two django apps A and B. Lets say A has some 
> models, Foo and Bar.
> 
> 
> Now i know there are plenty of implementations to make Foo 
> and Bar restfuly available via http but is there anything 
> built yet to make Foo and Bar available as Models on B via 
> http? Ie a restful model backend instead of a database backend.
> > 
> 



--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---