ANN: django-overextends

2012-06-09 Thread Stephen McDonald
Hi all,

As we know, circular template inheritance in Django templates isn't
possible, and usually doesn't make sense. There are some cases though,
where it can be extremely useful. Particularly when overriding sufficiently
complex templates in third-party apps.

I've just released a small installable app called django-overextends that
allows you to use circular template inheritance if required:

https://github.com/stephenmcd/django-overextends

I recently wrote about the rationale and approach for it here:

http://blog.jupo.org/2012/05/17/circular-template-inheritance-for-django/

Cheers,
Steve


-- 
Stephen McDonald
http://jupo.org

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Custom Managers vs Custom QuerySets

2012-06-09 Thread mikegolf
Hi,
what are pros / cons of extending Managers versus QuerySets? I'd like
to know which way is preferred and *why*.

Thank you in advance!
mg

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django Database Improperly Configured when function called outside of Django

2012-06-09 Thread Group Mail
Hi,

I asked the following django-related question on StackOverflow the
other day and didn't get much of a response, so I figured I'd ask you
all here.

http://stackoverflow.com/questions/10881249/django-database-improperly-configured-when-function-called-outside-of-django

Is my database configuration (in the linked post) incorrect? It seems
fine to me...?

Thanks!

Brian

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



1.2 ModelForm.is_valid() backward incompatible change

2012-06-09 Thread ydjango
>From 1.2 release notes (backward incompatible change):
"Much of the validation work for ModelForms has been moved down to the
model level. As a result, the first time you call
ModelForm.is_valid(), access ModelForm.errors or otherwise trigger
form validation, your model will be cleaned in-place. This conversion
used to happen when the model was saved. If you need an unmodified
instance of your model, you should pass a copy to the ModelForm
constructor.

I am migrating from 1.1 to 1.3. Some of my code rely on model not
being cleaned in place. As  some fields become read only and should
not be changed. This 1.2 functionality makes those field empty. Also I
save the model and not the form in these cases.

So as per documentation, to get around it, I need to pass a copy of
model to form. What is the best way to get a copy of model:
1) use deepcopy?
2)  get the object twice from db? (slow as more db access)

Any downsides to using deepcopy? Anything I need to be careful about?

Anyone else also had this issue and any suggestions.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: What the difference of django 1.4 runserver with mod_wsgi?

2012-06-09 Thread Raitucarp
Thanks guys. It is clear now

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: What the difference of django 1.4 runserver with mod_wsgi?

2012-06-09 Thread Masklinn
On 2012-06-09, at 17:18 , Raitucarp wrote:
> So, I was confused with manage.py runserver. Is it the same as
> mod_wsgi?

No, they have no relations

> Can I use daemon for wsgi with runserver, or I should
> install mod_wsgi?

You have to install mod_wsgi (or use some other HTTP server than Apache,
there are a number of options). Django's runserver is based on
wsgiref.simpler_server[0] which provides a very simple server for
testing and development, it is *not* suitable for production.

[0] http://docs.python.org/library/wsgiref.html#module-wsgiref.simple_server

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Is there anything like 'static' templates

2012-06-09 Thread Hendrik Speidel

Hi,

have a look at django-staticgenerator.
The original URL is no longer valid, but there is a fork here (but also 
quite old):

https://github.com/timetric/django-staticgenerator*

*i hope that helps
*
*hendrik
*
*On 06/09/2012 04:06 PM, Gelonida N wrote:

Hi,


This is mostly out of curiousity.

Let's imagine a site containing mostly static HTML files.
However due to laziness / ease of changing the overall sites layout
and the option of using django compressor for the included .css .js files
I wondered how I could use templates and still serve the resulting files
directly by the web server (have them located in 'static' / 'media')


So is there any tool helping with such a work flow?

- Edit modify Change the 'static' templates
- running a build script (or a modified 'collect-static' script)
   creating the resulting html files from their 'static' templates
   and placing them in the static folder.
   and then potentially create the related 'django-compressed' files in
   /static (or /media)






--
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: What the difference of django 1.4 runserver with mod_wsgi?

2012-06-09 Thread Hendrik Speidel

Hi,

manage.py runserver is an embedded webserver for development and 
debugging purposes only.

Do not use it in production!
Use mod_wsgi, uwsgi, gunicorn or sth. for production.

See: https://docs.djangoproject.com/en/dev/howto/deployment/

hendrik


On 06/09/2012 05:18 PM, Raitucarp wrote:

So, I was confused with manage.py runserver. Is it the same as
mod_wsgi? Can I use daemon for wsgi with runserver, or I should
install mod_wsgi?



--
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



What the difference of django 1.4 runserver with mod_wsgi?

2012-06-09 Thread Raitucarp
So, I was confused with manage.py runserver. Is it the same as
mod_wsgi? Can I use daemon for wsgi with runserver, or I should
install mod_wsgi?

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Is there anything like 'static' templates

2012-06-09 Thread Gelonida N

Hi,


This is mostly out of curiousity.

Let's imagine a site containing mostly static HTML files.
However due to laziness / ease of changing the overall sites layout
and the option of using django compressor for the included .css .js files
I wondered how I could use templates and still serve the resulting files
directly by the web server (have them located in 'static' / 'media')


So is there any tool helping with such a work flow?

- Edit modify Change the 'static' templates
- running a build script (or a modified 'collect-static' script)
   creating the resulting html files from their 'static' templates
   and placing them in the static folder.
   and then potentially create the related 'django-compressed' files in
   /static (or /media)








--
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Fwd: Scammer / Job fraud rehash - Do NOT perform any business with Eike Post

2012-06-09 Thread Dr. Eike B. Post
Please delete the heading for this post:
https://groups.google.com/forum/?fromgroups#!searchin/django-users/Eike$20/django-users/HYPxcrTRn5E/s-4nsLKLg2AJ


The message has been deleted but the headings still shows up!
The creator of the post does not repond to my emails.
Google tells me that they need a legal notice in order to remove.
The German prosecutor agrees it is illegal but they are unable to
prosecuted Google in the US.
So please as group admin, remove the thread!

If you have any questions, about the correctness of the thread, feel free
to contact me!


-- 
Eike



-- 
Eike

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Graphs for my Django Application

2012-06-09 Thread Tanveer Ali Sha
Thank You one and all..:)

On Fri, Jun 8, 2012 at 11:14 PM, bobhaugen  wrote:

> http://d3js.org/ can handle both meanings of graphs: charts like bar
> charts, or visualizations of network structures.
>
>
> 
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/DS-4lTg-9gwJ.
>
> To post to this group, send email to django-users@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-users@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.