Models?  Where do I find an example?

I've got Pro Django, Definitive Guide to Django, Python Essential Reference, 
and I've read the online django tutorial and a bunch of random docs.  I have 
yet to see an instance of mapping a url to a model.

Or, I don't know what you mean by model vs view (because when I say view - I 
mean just a function that takes a request, returns a response, and lives in a 
file called views.py).

What am I missing?

On Dec 3, 2009, at 11:58 AM, bruno desthuilliers wrote:

> On 3 déc, 20:42, Todd Blanchard <tblanch...@mac.com> wrote:
>> On Dec 3, 2009, at 10:46 AM, Javier Guerra wrote:
>> 
>>> remember that an app can do a lot more than provide views.
>> 
>> Explain this one to me.  AFAICS, its just http request/response all the way 
>> down and this is basically done by getting a request to a view that spits 
>> out a response.  Side effects like updating the database sometimes occur.
> 
> An app can expose views, indeed. It can also expose models - one of
> the most important parts of an application -, templatetags, filters,
> forms, fields, widgets etc. FWIW, the views are perhaps one of the
> less important thing an app has to offer - and obviously the most easy
> to factor out, cf genericviews. Models, OTHO, are really the core. If
> you end up writing most of your code in views, then you more than
> probably failed to identify what belongs to the model and what belongs
> to the views. The fact that "views" are a mandatory part of the
> request-response cycle doesn't mean they are the most important part
> of the app.
> 
> --
> 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 
> 

--

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


Reply via email to