Awesome. Thanks for the great response. Greatly appreciated. 

On Monday, May 6, 2013 6:11:15 PM UTC-6, Russell Keith-Magee wrote:
>
> Hi Brandon,
>
> Essentially, there shouldn't be any difference between a normal and a 
> readonly Django project. You set up a Django project as would usually would 
> -- you just don't ever do anything that results in a call to save(). 
>
> If you want some extra protection, you could go the extra step of writing 
> a model base class that overrides the behaviour of save() to raise an 
> exception (or fail silently). You could do similar things for calls like 
> update() on a query set. However, all this will do is catch the errors a 
> little earlier -- if your readonly database has been set up so that you 
> don't have write permissions, any attempt to issue an INSERT or UPDATE call 
> at a SQL level should result in an error.
>
> As for getting set up -- you can use the inspectdb management command [1] 
> to get a first draft of your models ready. You'll probably need to tweak 
> the output of that command, but it should get the broad strokes correct - 
> at least enough to see if the approach will work.
>
> You might also want to look into the "managed" Meta-flag [2]. This will 
> provide some protection to make sure that you don't accidentally try to 
> synchronise models onto the database.
>
> [1] https://docs.djangoproject.com/en/1.5/howto/legacy-databases/
> [2] 
> https://docs.djangoproject.com/en/1.5/ref/models/options/#django.db.models.Options.managed
>
> Yours,
> Russ Magee %-)
>
> On Tue, May 7, 2013 at 5:32 AM, Brandon Reynolds 
> <brand...@gmail.com<javascript:>
> > wrote:
>
>> Hello Everyone!
>>
>> I am new to Django and intermediate with Python. I have a client looking 
>> to have me build something that integrates with there rent management 
>> system. The comapny providing there system offers a feature called open 
>> access so that you can read there property database. However you only have 
>> rad only access to it. I need to know how to access, query and display data 
>> from that db using django. I don't need the admin interface implemented. I 
>> would however want to use something like haystack to provide a search 
>> function. What is the best way to do this? Would i write models that mirror 
>> the current database? Or is there mechanism that generates them 
>> automagically? I have had trouble finding much info on using read-only db's 
>> with django. Thanks for your answers! And thanks for the great software.
>>
>> ~Brandon
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com <javascript:>.
>> To post to this group, send email to django...@googlegroups.com<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to