Re: " I would like to read about some best practices about midsize and
large Django projects."

I would recommend first implementing a small-ish but meaningful (i.e.
something that addresses a Real World problem, and that you will
actually use) project; that way you will see the overall structure and
shape of a typical project.  Trying to "brute force" PHP concepts into
a Python -based framework is a certain recipe for frustration... and
just reading about them will not help change your world view.  (My
2c)  I started with The Django Book - it starts very simply, with the
basic concepts, and someone with your skills should be able to work
through this fairly quickly.

On Jan 5, 12:06 am, Ondřej Mirtes <ond...@mirtes.cz> wrote:
> Hello,
> I am experienced PHP developer (and by PHP I mean advanced programming
> with MVC frameworks, TDD, ORM libraries, design patterns and such, so
> no scoffing please :)) and I would like to try something new. I've
> chosen Python and Django and I am building my bachelor thesis project
> with it.
>
> I dived directly into django-nonrel fork, because I am building the
> project on App Engine. However, I have few basic questions that
> concern basic relational Django as well.
>
> 1) Since Python has no object encapsulation, I have no idea how to
> implement computed columns in its models. E. g. I want to save forum
> post rating in the "posts" table even if I have related table with all
> the related post votes because it's faster and no joins are required
> to get the rating value.
>
> 2) I would like to perform some integrity checking before saving
> object to the database. I found here (http://docs.djangoproject.com/en/
> 1.2/topics/db/models/#overriding-predefined-model-methods) that I can
> override entity save method and stop it's execution before calling
> parent implementation. However, this didn't work for me for two
> reasons - it somehow caused 500 error on App Engine (because the app
> does not know that the object was not saved?) and it does not meet my
> needs - I would like to "attach" some error message to this
> application state and I would like this message to bubble up to the
> form errors (in case it happens when a form is submitted) in a way
> compatible with Django admin, so the user can fix the problem.
>
> 3) I would like to read about some best practices about midsize and
> large Django projects. How to organize the code, what directory
> structure to choose etc. Are there any additional layers between model
> and views widely used? Where should I put my code that is not directly
> related to model and is used in more than one view? Can you recommend
> me some articles about this topic?
>
> 4) What about dependency injection? From what I saw so far it seems
> like Django is full of singletons, static attributes and methods and
> hidden dependencies, which are considered as bad practice. For example
> how can I use two connections to two different databases to load and
> save model entities? Are there any "inversion of control" concepts?
>
> Thank you very much! And you can expect more questions to come in this
> thread :)
>
> Ondřej Mirtes from Prague, Czech Republic

-- 
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