Re: Support for Federated MySql table?

2007-11-30 Thread James Bennett

On 11/30/07, Gloria W <[EMAIL PROTECTED]> wrote:
> The problem I have is that the manage.py inspectdb dumps a table which
> matches my sql table in construct, but no info about being federated.
> So an objects.filter() on some of these fields is failing, although I
> can see the fields when I iterate over the records.

The 'inspectdb' command is meant to be a starting point for
integrating with an existing database; it does not, cannot and will
not be aware of every conceivable thing your database is capable of,
so you'll often need to review the generated models and add any
information it didn't pick up (MySQL in particular is notoriously hard
to introspect because of the way is various storage engines handle
foreign keys).

Manually adding the appropriate fields to the model file should be all
you need to do in this case.

-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

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



Huge Free collection of Christmas Greetings : Start collecting now

2007-11-30 Thread P K Kothari
Christmas Powerpoint Greetings
15
Christmas Powerpoint Greetings
14
Christmas Flash Greetings
13
Christmas Powerpoint Greetings
12
Christmas Powerpoint Greetings
11
Christmas Powerpoint Greetings
10
Christmas Powerpoint Greetings
09
Christmas Powerpoint Greetings
08
Christmas Powerpoint Greetings
07
Christmas Powerpoint Greetings
06
Christmas Powerpoint Greetings
05
Christmas Powerpoint Greetings
04
Christmas Powerpoint Greetings
03
Christmas Powerpoint Greetings
02
Christmas Powerpoint Greetings
01
Christmas Flash Greetings
69
Christmas Flash Greetings
68
Christmas Flash Greetings
67
Christmas Flash Greetings
66
Christmas Flash Greetings
65
Christmas Flash Greetings
64
Christmas Flash Greetings
63
Christmas Flash Greetings
62
Christmas Flash Greetings
61
Christmas Flash Greetings
60
Christmas Flash Greetings
59
Christmas Flash Greetings
58
Christmas Flash Greetings
56
Christmas Flash Greetings
55
Christmas Flash Greetings
54
Christmas Flash Greetings
53
Christmas Flash Greetings
52
Christmas Flash Greetings
51
Christmas Flash Greetings
50
Christmas Flash Greetings
49
Christmas Flash Greetings
48
Christmas Flash Greetings
47
Christmas Flash Greetings
46
Christmas Flash Greetings
45
Christmas Flash Greetings
44
Christmas Flash Greetings
43
Christmas Flash Greetings
42
Christmas Flash Greetings
41
Christmas Flash Greetings
40
Christmas Flash Greetings

Support for Federated MySql table?

2007-11-30 Thread Gloria W

Hi, I'm using Django 0.95 on Python2.4, and it seems that it doesn't
fully support federated tables in Mysql.

The problem I have is that the manage.py inspectdb dumps a table which
matches my sql table in construct, but no info about being federated.
So an objects.filter() on some of these fields is failing, although I
can see the fields when I iterate over the records.

Any help or pointers to good docs on Django's handling of federated
tables and foreign keys (for another problem I'm having) would be
greatly appreciated.

Thank you,
Gloria
--~--~-~--~~~---~--~~
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: low-level cache & pagination

2007-11-30 Thread Chris G

Alright, I think I answered my own question. It seems the current
RequestContext is a little messed up and not only requests cache to be
remade, but also crashes runserver upon more than 1 request.

On Nov 30, 7:26 pm, Chris G <[EMAIL PROTECTED]> wrote:
> I have a large query that is ran and takes about 50 seconds to
> completely and is pretty resource intensive. So what I have done is
> cached it into a key via cache.set('my_query_results', results, 300)
>
> The problem is that I also use pagination which results from this
> query. So when navigating to ?page=2~ it should in theory just re-use
> the cache and output page 2's data. But it doesn't. What it does is re-
> run and re-cache the entire query again. I'm guessing that this is due
> to the 'request' (MyView(request) is changing (?page=2).
>
> Is it possible to override this? Or am I just doing something this
> whole thing wrong?
>
> Thanks
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



low-level cache & pagination

2007-11-30 Thread Chris G

I have a large query that is ran and takes about 50 seconds to
completely and is pretty resource intensive. So what I have done is
cached it into a key via cache.set('my_query_results', results, 300)

The problem is that I also use pagination which results from this
query. So when navigating to ?page=2~ it should in theory just re-use
the cache and output page 2's data. But it doesn't. What it does is re-
run and re-cache the entire query again. I'm guessing that this is due
to the 'request' (MyView(request) is changing (?page=2).

Is it possible to override this? Or am I just doing something this
whole thing wrong?

Thanks
--~--~-~--~~~---~--~~
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: Using a signal to update a counter cache??

2007-11-30 Thread Simon Willison

On Nov 30, 4:48 pm, "Tane Piper" <[EMAIL PROTECTED]>
wrote:
> As you can see in the Branch model, there is a field called num_leafs
> - I've been reading the signals documentation and had a look on the
> web, but I'm still having difficulty getting my head around it.  What
> I want to do is when a leaf is saved, on the post_save signal I want
> to increment the parent branch's num_leafs field so it contains total
> number of content leafs for that branch (as a counter cache).

This exact example was covered in the Advanced Django Tutorial at
OSCON this year (in the unit testing section) - you may find the
slides from the tutorial useful:

http://toys.jacobian.org/presentations/2007/oscon/tutorial/

Cheers,

Simon
--~--~-~--~~~---~--~~
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: sql.py cannot find tables that it generated sql to create

2007-11-30 Thread Matt

Was this ever fixed? I'm still experiencing similar behavior in r6783.
Thanks!

--Matt

On Nov 15, 4:55 pm, richbodo <[EMAIL PROTECTED]> wrote:
> ...
>
> Thanks.  I switched to Postgres for now and everything works fine.
> I'll switch back in a few days and file a bug report if necessary.
--~--~-~--~~~---~--~~
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: Using a signal to update a counter cache??

2007-11-30 Thread Darryl Ross
Tane Piper wrote:
> As you can see in the Branch model, there is a field called num_leafs
> - I've been reading the signals documentation and had a look on the
> web, but I'm still having difficulty getting my head around it.  What
> I want to do is when a leaf is saved, on the post_save signal I want
> to increment the parent branch's num_leafs field so it contains total
> number of content leafs for that branch (as a counter cache).  I also
> need to go reduced it by one each time a leaf is removed.  

You can use the backward lookup feature of ForeignKey fields in the
Django ORM. This is documented at
http://www.djangoproject.com/documentation/db-api/#related-objects

Update your Branch save() method to do the following:

def save(self):
self.num_leafs = self.leaf_set.count()
self.slug = slugify(self.title)
super(Branch, self).save()


Regards
Darryl



signature.asc
Description: OpenPGP digital signature


Fwd: Break with Django SVN r6718

2007-11-30 Thread Josh Stone
Hi all,

I'm having problems using Review Board with recent Django revisions, and I'm
hoping that this list can help.  Please see below for the previous
discussion, but the gist is that with Django r6718 (and later), I'm getting
exceptions when urls.py tries to access site settings.  I did some
debugging, and it seems that urls.py is only getting the default settings,
so all of the custom settings are missing from the object.

1. If I run "./manage.py runserver 0.0.0.0:8080", I get exceptions.
2. If I run "env DJANGO_SETTINGS_MODULE=reviewboard.settings ./manage.py
runserver 0.0.0.0:8080", I get exceptions.
3. If I run "./manage.py runserver --settings=reviewboard.settings
0.0.0.0:8080", it works fine!

Everything works fine though with Django r6717, so something in that change
must have broken this.  It's not a big change, but I'm at a loss as to what
the problem is.  The Review Board developers are not able to reproduce this,
but they're using Python 2.5 and mine is Python 2.4.

Any ideas?

Thanks,

Josh


-- Forwarded message --
From: Christian Hammond <[EMAIL PROTECTED]>
Date: Nov 30, 2007 3:05 PM
Subject: Re: Break with Django SVN r6718
To: [EMAIL PROTECTED]


That's very strange... I don't have any ideas. It's working perfectly fine
here. There must be some subtlety that we're missing.

I am using Python 2.5, though. Maybe there's some bug they introduced with
2.4.

Christian


On Nov 30, 2007 2:57 PM, Josh Stone <[EMAIL PROTECTED]> wrote:

> Yes, this is with devserver.sh.  I just tried a completely clean copy, to
> make sure it's not my settings, and I still get the exception.
> settings_local.py is exactly the same as the template except I changed it to
> sqlite3 instead of mysql.
>
> Here's the latest I tried: Review Board r1038, djblets r11659, Django
> r6782, Python 2.4.3
>
> Any ideas?
>
> Josh
>
>
> On Nov 29, 2007 10:03 PM, Christian Hammond <[EMAIL PROTECTED]> wrote:
>
> >  This is with devserver.sh? I just synced to 6718 and I'm having no
> > problems there either. Also tried the latest revision and it's working too.
> >
> > Christian
> >
> >
> >
> > On Nov 29, 2007 6:22 PM, Josh Stone < [EMAIL PROTECTED]> wrote:
> >
> > > When I run Review Board (r1032) with Django r6718 or later, I see this
> > > exception in the browser:
> > >
> > > Error while importing URLconf 'reviewboard.urls ': 'Settings' object
> > > has no attribute 'BUILTIN_AUTH'
> > >
> > > What's weird is that the debug output dumps the settings down below,
> > > and BUILTIN_AUTH looks fine.  So I stepped into reviewboard.urls with
> > > the debugger, and found that the 'settings' object was missing everything
> > > from settings.py and settings_local.py, even though they all show up
> > > in the exception dump!
> > >
> > > Django r6717 works fine, but r6718 breaks (gotta love git-bisect).
> > > However, if I pass "--settings= reviewboard.settings" to manage.py,
> > > everything works fine.
> > >
> > > Has anyone else seen this?  I would guess that it's a Django bug, not
> > > RB's, but hopefully someone more familiar with Django innards can take a
> > > look...
> > >
> > > Thanks,
> > >
> > > Josh
> > >
> > >
> > >
> >
> >
> > --
> > Christian Hammond - [EMAIL PROTECTED]
> > VMware, Inc.
> >
> >
>
>
>


-- 
Christian Hammond - [EMAIL PROTECTED]
VMware, Inc.

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



Newforms - error_messages

2007-11-30 Thread Rob Goedman

Hi,

Using newforms-admin, I'm using

request.user.message_set.create(message = _("User updated"))

quite a bit.

Is there an equivalent method to set the error note while processing  
save_change and save_add?

Thanks,
Rob

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



question about custom orderings

2007-11-30 Thread Sean Perry

say I have the following classes:

class Foo(models.Model):
 name = models.CharField(max_length=30)
 number = models.PositiveSmallIntegerField()

 def __unicode__(self):
 return u"%s(%d)" % (self.name, self.number)

 class Meta:
 ordering = ['name',]

class FooCollection(models.Model):
 name = models.CharField(max_length=30)
 foos = models.ManyToManyField(Foo)

 def __unicode__(self):
 return name

When code looks at Foo objects, the expected ordering is by name. But 
when a FooCollection returns its Foo objects I would like them to be 
ordered by their number, not their name.

My first instinct was a custom Manager but I do not know how to specify 
the manager for ManyToMany relations.

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



New Video: Nihtziy/Portland Must See !

2007-11-30 Thread Nihtziy

http://www.youtube.com/watch?v=3iSS1j0qK10
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



3 Fresh Proxies

2007-11-30 Thread Chinaguy

Forward this email to your friends and spread free surf

http://www.proxygroup.6x.to/
http://www.Peroxy.6x.to
http://www.proxxy.6x.to




Join this yahoo group and have daily fresh and free proxies in you
mailbox

http://tech.groups.yahoo.com/group/hiddenzone/join
the link above is blocked? Then Send an email to this address to Join
Join group(via Email): [EMAIL PROTECTED]
com send an empty email
(jacob---nix)







_

Proxy related links:

http://server90.uproxy.6x.to http://server91.uproxy.6x.to
http://server92.uproxy.6x.to http://server93.uproxy.6x.to
http://server94.uproxy.6x.to http://server95.uproxy.6x.to
http://server96.uproxy.6x.to http://server97.uproxy.6x.to
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



3 Fresh Proxies

2007-11-30 Thread Chinaguy

Forward this email to your friends and spread free surf

http://www.proxygroup.6x.to/
http://www.Peroxy.6x.to
http://www.proxxy.6x.to




Join this yahoo group and have daily fresh and free proxies in you
mailbox

http://tech.groups.yahoo.com/group/hiddenzone/join
the link above is blocked? Then Send an email to this address to Join
Join group(via Email): [EMAIL PROTECTED]
com send an empty email
(jacob---nix)







_

Proxy related links:

http://server90.uproxy.6x.to http://server91.uproxy.6x.to
http://server92.uproxy.6x.to http://server93.uproxy.6x.to
http://server94.uproxy.6x.to http://server95.uproxy.6x.to
http://server96.uproxy.6x.to http://server97.uproxy.6x.to
--~--~-~--~~~---~--~~
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: ImageField file naming

2007-11-30 Thread Marty Alchin
I don't have a definitive answer at this point, no. Everybody who
wants some form of flexible file naming has a different need, and it's
tough to come up with something that pleases everyone, while still
being a fairly concise API. I've been giving it some thought, and I'll
make sure to bring it up during the sprint, but I don't know what will
come of it.

I'm hoping to get the rest of my FileField changes in this weekend,
and while I'd like to solve this problem along with it, it's not a
showstopper in terms of getting the rest of it in.

So the short story is, I'll do what I can, but as always, if you have
some code that does what you'd like, it'll go a long way toward
figuring out how best to handle it.

-Gul

On 11/30/07, Chris Hoeppner <[EMAIL PROTECTED]> wrote:
>
> I guess you don't have a hint for me to get this working? It seems like
> everyone's having that rename issue where _get_pk returns none. I'm just
> blind-guessing, but perhaps the way to go might be "moving" the file on
> post_save onto another name, since pre_save doesn't provide a pk value?
>
> I don't know the Django internals good enough to solve this myself,
> though I need to get this done ASAP. In a previous project I "solved"
> this with some really ugly workarounds, that my client has to take care
> of constantly, and I wouldn't like to do the same this time.
>
> Of course, the best solution would be including this functionality in
> the django core, since everything else is bound to get obsolete sooner
> or later, and most people wouldn't bother updating this to keep it up
> with the trunk.
>
> I've gone trough the links below, and got some of it working, but the pk
> thing doesn't work on any of them.
>
> Any help, please?
>
> ~ Chris
>
> El mar, 20-11-2007 a las 15:41 -0500, Marty Alchin escribi�:
> > On Nov 20, 2007 3:33 PM, Chris Hoeppner <[EMAIL PROTECTED]> wrote:
> > > It would be nice to be able to include this in the upload_to parameter.
> > > Something like
> > > 'upload/%(model_name)s/%(instance_id)s.%(mimetype_extension)s' perhaps?
> > > Maybe, if the parameter ends with a slash, the handler could know "ok.
> > > this is a directory. let's keep the original filename".
> >
> > As usual, I'll respond to this as I've been doing a good bit of work
> > in this area lately. There's no "official" way to do this yet, but
> > there are ways to get the job done. Take a look at the links below for
> > more information on some techniques.
> >
> > I'm doing a good bit of work on making Django handle renaming a bit
> > better, and I'm hoping it will land during the next sprint on December
> > 1. There's no guarantee of that, of course, but that's my personal
> > goal. That will be documented thoroughly when it lands, and I'll make
> > an announcement here on django-users whenever that is, sprint or not.
> >
> > -Gul
> >
> > http://scottbarnham.com/blog/2007/07/31/uploading-images-to-a-dynamic-path-with-django/
> > http://code.djangoproject.com/wiki/CustomUploadAndFilters
> > http://gulopine.gamemusic.org/2007/11/customizing-filenames-without-patching.html
> >
> > >
>
>
> >
>

--~--~-~--~~~---~--~~
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: Expiring cache entries through model save()

2007-11-30 Thread Brian Morton

Thanks for the advice Malcolm.  I am going to give this more thought
and see if I can come up with a generic high performance hash
function.

On Nov 30, 3:26 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Fri, 2007-11-30 at 12:08 -0800, Brian Morton wrote:
> > I have an interesting idea that I am not quite sure how to pursue.
> > I'm wondering if any of you have figured this out already.
>
> > What I would like to do is set the cache expiration for a particular
> > object in the cache to be very high, and then delete the item from the
> > cache when an instance of its model is saved.  This would be
> > particularly useful for a site where the data only changes through the
> > admin interface, and not very frequently.  This way, the object can
> > stay cached as long as it has not changed.
>
> > I was thinking of trying something with the post_save signal and the
> > cache middleware.  Has anyone tried this already?  Or is this a bad
> > idea?
>
> The usually difficult part of this type of proposal is querysets. You
> need to find every cached queryset that contains the model in question
> and delete it as well. This essentially requires scanning every queryset
> (or coming up with a really good hash function to enable cutting down
> the search set). There was a Summer of Code project that tried to do
> this, but it didn't seem to go anywhere.
>
> Malcolm
--~--~-~--~~~---~--~~
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: dynamic newforms validation etc

2007-11-30 Thread RajeshD


> This data needs to be saved in Options. A record for each product
> selected with the name and price in it. This is because the product
> name can change in the future and the price can change. So this should
> be stored in Options.
>
> My problem is that I don't know yet how to do this.
>
> Can somebody explain me how I should do this with newsforms...

You will need a dynamically generated form as you don't know ahead of
time how many Products you might have.

Here's something to get you started (hastily put together and
completely untested):

import django.newforms as forms
import django.newforms import widgets
from products import models

class MyForm(forms.Form):
  def __init__(self, *args, **kwargs):
super(MyForm, self).__init__(*args, **kwargs)
i = 0
for p in models.Product.objects.select_related().all():
  self.fields['product_%s' % i] = forms.CharField(
widget=widgets.HiddenInput(),
initial=p.pk)
  self.fields['checkbox_%s' % i] =
forms.CheckboxField(initial=False)
  self.fields['name_%s' % i] = forms.CharField(initial=p.name)
  self.fields['price_%s' % i] =
forms.DecimalField(initial=p.price)
  options = p.option_set.all()[:1] # assumes at most one Option
per product
  if options:
self.fields['checkbox_%s' % i].initial = True
self.fields['name_%s' % i].initial = options[0].name
self.fields['price_%s' % i].initial = options[0].price
  i += 1

Note that the above assumes your model class names to be Product and
Option (singular). It's good practice to not use plural names. Also
the above assumes at most one Option per product.

-Rajesh D.


--~--~-~--~~~---~--~~
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: Expiring cache entries through model save()

2007-11-30 Thread Malcolm Tredinnick


On Fri, 2007-11-30 at 12:08 -0800, Brian Morton wrote:
> I have an interesting idea that I am not quite sure how to pursue.
> I'm wondering if any of you have figured this out already.
> 
> What I would like to do is set the cache expiration for a particular
> object in the cache to be very high, and then delete the item from the
> cache when an instance of its model is saved.  This would be
> particularly useful for a site where the data only changes through the
> admin interface, and not very frequently.  This way, the object can
> stay cached as long as it has not changed.
> 
> I was thinking of trying something with the post_save signal and the
> cache middleware.  Has anyone tried this already?  Or is this a bad
> idea?

The usually difficult part of this type of proposal is querysets. You
need to find every cached queryset that contains the model in question
and delete it as well. This essentially requires scanning every queryset
(or coming up with a really good hash function to enable cutting down
the search set). There was a Summer of Code project that tried to do
this, but it didn't seem to go anywhere.

Malcolm



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



Expiring cache entries through model save()

2007-11-30 Thread Brian Morton

I have an interesting idea that I am not quite sure how to pursue.
I'm wondering if any of you have figured this out already.

What I would like to do is set the cache expiration for a particular
object in the cache to be very high, and then delete the item from the
cache when an instance of its model is saved.  This would be
particularly useful for a site where the data only changes through the
admin interface, and not very frequently.  This way, the object can
stay cached as long as it has not changed.

I was thinking of trying something with the post_save signal and the
cache middleware.  Has anyone tried this already?  Or is this a bad
idea?
--~--~-~--~~~---~--~~
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: ORA-00911: Invalid charatcer

2007-11-30 Thread Karen Tracey
On 11/30/07, Da Martian <[EMAIL PROTECTED]> wrote:
>
> Aha, so there is a fix? Its just not in 0.96.1? That was indeed going to
> be my very next question, as all the tickets say oracle is supported now and
> should be working.
>
> So if I pull the trunk this issue is resolved?
>
> Thanks in advance!


Yes, if you pull the trunk you'll get working Oracle support.

Karen

--~--~-~--~~~---~--~~
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: ORA-00911: Invalid charatcer

2007-11-30 Thread Da Martian
Aha, so there is a fix? Its just not in 0.96.1? That was indeed going to be
my very next question, as all the tickets say oracle is supported now and
should be working.

So if I pull the trunk this issue is resolved?

Thanks in advance!

S

On Nov 30, 2007 5:06 PM, Karen Tracey <[EMAIL PROTECTED]> wrote:

> On 11/30/07, ChaosKCW <[EMAIL PROTECTED]> wrote:
>
> >
> > Hi
> >
> > I am curious as to why this post/ticket was closed with not follow up:
> > http://code.djangoproject.com/ticket/3953
> >
> > http://groups.google.com/group/django-updates/browse_thread/thread/acb2d1895d5fcf83/2c33d28fe3acc186?hl=en=st=ORA-00911%3A+invalid#2c33d28fe3acc186
> >
> > I have just downloaded the latest release 0.96.1 and the issue most
> > definitively exists. Has anyone solved it? I tried to post a comment
> > on the ticket but was rejected as spam even when providing an email
> > address.
> >
> > Thanks and regards,
>
>
> Probably I should have closed it wontfix vs. invalid.  You're right, the
> problem exists in 0.96.1, but there is no chance of it getting fixed in
> any 0.96.x release, since the .x releases only contain essential security
> fixes, nothing else.  If you want Oracle support you'll have to use an SVN
> checkout until there is an official release made that includes Oracle
> support.
>
> Sorry for any confusion,
> Karen
>
>
>
> >
>

--~--~-~--~~~---~--~~
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: i18n - gettext issue with simple quote

2007-11-30 Thread Nicolas Steinmetz

[EMAIL PROTECTED] a écrit :
> Hello,
> 
> In my po file, I need some french words with simple quote like :
> 
> #: models.py:497
> msgid "User's skills"
> msgstr "Compétences d\'un utilisateur"
> 
> But when I use compile-message.py , I got fatar errors and as a reason
> "Invalid control sequence".
> 
> I removed the "\" but same issue.

I retried with removing all \ and it just works. Do not know what I 
missed...

Sorry for the noise.


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



html_output, where is BoundField?

2007-11-30 Thread Ken

I'm adding an  html output method to my newforms sub-class.  It's
identical to the forms _html_output() except for some very small mods
(I need to put 2 fields in one table row).  BoundField and ErrorList
are not visible in my method.  I've tried forms.BoundField since the
BoundField class is defined in forms.py but it still doesnt work.
What am I doing wrong?

Thanks! Ken
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



dynamic newforms validation etc

2007-11-30 Thread super

Ok I worked myself a bit in trouble.
Don't know yet how to do this with newforms:

Let me explain and dumb down my problem to make things easy:
two models:
model 1: Products
I got "products" that have each a name and a price

Model 2: Options
Option has a foreingkey pointing to products but also a name and a
price. Name and price is there because after a save they should be
independend of Products...

The behavior should be like this:
A user gets a list of Checkboxes. Made up from the products.
besides each checkbox a input field with the price is displayed.
The user can override the price and enter an other price.

This data needs to be saved in Options. A record for each product
selected with the name and price in it. This is because the product
name can change in the future and the price can change. So this should
be stored in Options.

My problem is that I don't know yet how to do this.

Can somebody explain me how I should do this with newsforms...


--~--~-~--~~~---~--~~
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: ORA-00911: Invalid charatcer

2007-11-30 Thread Karen Tracey
On 11/30/07, ChaosKCW <[EMAIL PROTECTED]> wrote:
>
>
> Hi
>
> I am curious as to why this post/ticket was closed with not follow up:
> http://code.djangoproject.com/ticket/3953
>
> http://groups.google.com/group/django-updates/browse_thread/thread/acb2d1895d5fcf83/2c33d28fe3acc186?hl=en=st=ORA-00911%3A+invalid#2c33d28fe3acc186
>
> I have just downloaded the latest release 0.96.1 and the issue most
> definitively exists. Has anyone solved it? I tried to post a comment
> on the ticket but was rejected as spam even when providing an email
> address.
>
> Thanks and regards,


Probably I should have closed it wontfix vs. invalid.  You're right, the
problem exists in 0.96.1, but there is no chance of it getting fixed in any
0.96.x release, since the .x releases only contain essential security fixes,
nothing else.  If you want Oracle support you'll have to use an SVN checkout
until there is an official release made that includes Oracle support.

Sorry for any confusion,
Karen

--~--~-~--~~~---~--~~
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: ORA-00911: Invalid charatcer

2007-11-30 Thread Malcolm Tredinnick


On Fri, 2007-11-30 at 08:27 -0800, ChaosKCW wrote:
> Hi
> 
> I am curious as to why this post/ticket was closed with not follow up:
> http://code.djangoproject.com/ticket/3953
> http://groups.google.com/group/django-updates/browse_thread/thread/acb2d1895d5fcf83/2c33d28fe3acc186?hl=en=st=ORA-00911%3A+invalid#2c33d28fe3acc186
> 
> I have just downloaded the latest release 0.96.1 and the issue most
> definitively exists. Has anyone solved it? I tried to post a comment
> on the ticket but was rejected as spam even when providing an email
> address.

Oracle support does not exist in 0.96. The boulder-sprint oracle branch
was merged post-0.96. 0.96.1 was 0.96 + the sole security fix, not
anything else.

Malcolm


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



Using a signal to update a counter cache??

2007-11-30 Thread Tane Piper

Hi there,

At the moment, I am building my site content system.  The idea is that
categories are branches, and contents are leafs as defined by these
two models below:

from django.db import models
from django.contrib.auth.models import User
from django.contrib.auth.decorators import permission_required
from django.template.defaultfilters import slugify
from django.utils.translation import gettext_lazy as _

import datetime


PUBLISHED_CHOICES = (
(0, 'Draft'),
(1, 'Pending Review'),
(2, 'Published'),
(3, 'Archived'),
)

class Branch(models.Model):
parent_id=models.IntegerField(max_length=11)
title=models.CharField(max_length=100)
active=models.BooleanField()
generate_feed=models.BooleanField()
num_leafs=models.IntegerField(default=0)
def save(self):
self.slug = slugify(self.title)
super(Branch, self).save()
def __unicode__(self):
return self.title
class Admin:
pass

# Create your models here.
class Leaf(models.Model):
title=models.CharField(_('Title'), max_length=200)
body=models.TextField(_('Body'))
user=models.ForeignKey(User)
pub_date=models.DateTimeField('date published')
num_comments=models.IntegerField(default=0)
num_views=models.IntegerField(default=0)
published=models.IntegerField(max_length=1, choices=PUBLISHED_CHOICES)
front_page=models.BooleanField()
sticky=models.BooleanField()
allow_comments=models.BooleanField()
content_type=models.ForeignKey(Branch)
def save(self):
self.slug = slugify(self.title)
super(Leaf, self).save()
def __unicode(self):
return self.title
class Admin:
pass

As you can see in the Branch model, there is a field called num_leafs
- I've been reading the signals documentation and had a look on the
web, but I'm still having difficulty getting my head around it.  What
I want to do is when a leaf is saved, on the post_save signal I want
to increment the parent branch's num_leafs field so it contains total
number of content leafs for that branch (as a counter cache).  I also
need to go reduced it by one each time a leaf is removed.  If I could
get some help with this first one (which I was able to implement
easily in PHP but just cannot translate to Django) I think I'll be
fine.


-- 
Tane Piper
Blog - http://digitalspaghetti.me.uk
AJAX Pastebin - http://pastemonkey.org

This email is: [ ] blogable [ x ] ask first [ ] private

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



ORA-00911: Invalid charatcer

2007-11-30 Thread ChaosKCW

Hi

I am curious as to why this post/ticket was closed with not follow up:
http://code.djangoproject.com/ticket/3953
http://groups.google.com/group/django-updates/browse_thread/thread/acb2d1895d5fcf83/2c33d28fe3acc186?hl=en=st=ORA-00911%3A+invalid#2c33d28fe3acc186

I have just downloaded the latest release 0.96.1 and the issue most
definitively exists. Has anyone solved it? I tried to post a comment
on the ticket but was rejected as spam even when providing an email
address.

Thanks and regards,


--~--~-~--~~~---~--~~
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: Problems saving values from SelectDateWidget

2007-11-30 Thread RajeshD


On Nov 29, 4:51 am, Stupid Dustbin <[EMAIL PROTECTED]>
wrote:
> Hi, encountered a problem recently with SelectDateWidget. I'm not very
> sure what I did wrong.

Your usage of that widget is correct.

Note that a recent Django revision (the excellent "autoescape"
feature) had introduced a bug that caused this widget to fail. It's
been fixed in SVN rev. 6723:

http://code.djangoproject.com/changeset/6723




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



Defining custom filters for admin object lists (0.96.1)

2007-11-30 Thread Jarek Zgoda

Is there any possibility to define custom filter for admin object lists?
I'd like to limit the items in a list to some subset of available
foreign keys that match some criteria.

-- 
Jarek Zgoda
Skype: jzgoda | GTalk: [EMAIL PROTECTED] | voice: +48228430101

"We read Knuth so you don't have to." (Tim Peters)

--~--~-~--~~~---~--~~
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: How to make such query with django ORM?

2007-11-30 Thread RajeshD

>
> I need to get all blogs that belong to certain user and are empty (do
> not have any articles). I can't figure out how to make it with without
> extra() method.

As others have recommended, just use the extra() method. It's not so
bad :)

If you really really want to avoid that, you could add a count integer
field to your Blog model and maintain its value from overridden
methods Article.save() and Article.delete(). So Blog.count would get
refreshed every time you add/update/delete articles and your desired
query becomes a straight lookup on Blog.

--~--~-~--~~~---~--~~
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: Use of newforms prefixes in html templates

2007-11-30 Thread RajeshD

>
> I have a list of forms that I want to pass to my template but I am not
> sure how to include the prefix.

When you are creating each instance of your form, just specify the
appropriate prefix for it:

form = MyForm(prefix='my-prefix')

When you render this form instance, Django will include the prefix in
the name of each field of that form.

--~--~-~--~~~---~--~~
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: Access urls in template tags?

2007-11-30 Thread RajeshD

> Is there a simple way to do this within the template tag or would I
> need to create a context processor and would this be available within
> the templatetag or only within the template itself?

You can do this inside a template tag. Assuming that you already have
the request available in your views' context[1], your template tag has
access to that context so you will be able to get the request within
your template tag's render method:

request = context['request']

[1]http://www.djangoproject.com/documentation/templates_python/
#subclassing-context-requestcontext

--~--~-~--~~~---~--~~
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: Many to many column naming in 1.0?

2007-11-30 Thread J. Clifford Dyer

On Fri, Nov 30, 2007 at 08:16:17AM -0600, Malcolm Tredinnick wrote regarding 
Re: Many to many column naming in 1.0?:
> 
> On Fri, 2007-11-30 at 07:07 -0500, J. Clifford Dyer wrote:
> > Hey all,
> > 
> > Does anyone know if there are plans to include this patch (or similar
> > functionality) in Django 1.0?
> > 
> > http://code.djangoproject.com/ticket/785
> > 
> > It's a relatively simple change, breaking no backwards compatibility,
> > and it goes a long way to making it easier to integrate legacy DBs into
> > django projects.  
> 
> It's probably not unreasonable. The concept has always been sound; it's
> only the implementation that has needed a little work. Looking at the
> recent comments there, it's getting closer.
> 
> Malcolm
> 
> 


Looking at that patch and the surrounding code is my first sally into the guts 
of django, so I may not know what I'm talking about. 


In addition to defining attributes db_self_column and db_related_column to 
explicitly name the columns in a ManyToManyField table, would there need to be 
a third attribute for explicitly naming the primary key column?  

More generally, what needs to be done on the existing patch?  I may try to do 
something with it during the sprint, if there's any way I could be helpful.

Cheers,
Cliff

--~--~-~--~~~---~--~~
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: Many to many column naming in 1.0?

2007-11-30 Thread Malcolm Tredinnick


On Fri, 2007-11-30 at 07:07 -0500, J. Clifford Dyer wrote:
> Hey all,
> 
> Does anyone know if there are plans to include this patch (or similar
> functionality) in Django 1.0?
> 
> http://code.djangoproject.com/ticket/785
> 
> It's a relatively simple change, breaking no backwards compatibility,
> and it goes a long way to making it easier to integrate legacy DBs into
> django projects.  

It's probably not unreasonable. The concept has always been sound; it's
only the implementation that has needed a little work. Looking at the
recent comments there, it's getting closer.

Malcolm



--~--~-~--~~~---~--~~
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: Template Tag and Javascript Best Practices

2007-11-30 Thread David Reynolds


On 30 Nov 2007, at 12:51 pm, Manakel wrote:
>
> Currently, i would like to render some part of my template using a
> javascript utilities "myrender.js"
>
> I was thinking of doing the thing clean by creating a dedicated
> template tag: "jsrender".
>
> Now the question is:
>
> Should i
> a) let the designer perform an include for "myrender.js" in each
> template where he wants to use the "jsrender" tag
> b) incorporate the include "myrender.js" in my template tag
> (this way designer just use the template tag,like any other template
> tag).
>
> If b) is an ok solution, do you know where to find a sample of doing
> so?

We tend to make a block tag (called extrahead) in the head section of  
the base template and then just shove in the javascript lines in that  
block tag where they are needed.

-- 
David Reynolds
[EMAIL PROTECTED]



--~--~-~--~~~---~--~~
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: How use splitdatetime?

2007-11-30 Thread Karen Tracey
On 11/29/07, mamcxyz <[EMAIL PROTECTED]> wrote:
>
> The problem was that I pass a Initial date as string, so the code try
> to call "value.date' and obviously fail.


Ah.  You didn't include an initial setting in what you posted -- posting
exactly the code you are having trouble with will help in getting useful
replies!

However, I must turn off autoescape for the widget to render right. Is
> this the normal thing or a bug?


There is an issue in the tracker reporting this:

http://code.djangoproject.com/ticket/6036

Karen

--~--~-~--~~~---~--~~
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: ImageField file naming

2007-11-30 Thread Chris Hoeppner

I guess you don't have a hint for me to get this working? It seems like
everyone's having that rename issue where _get_pk returns none. I'm just
blind-guessing, but perhaps the way to go might be "moving" the file on
post_save onto another name, since pre_save doesn't provide a pk value?

I don't know the Django internals good enough to solve this myself,
though I need to get this done ASAP. In a previous project I "solved"
this with some really ugly workarounds, that my client has to take care
of constantly, and I wouldn't like to do the same this time.

Of course, the best solution would be including this functionality in
the django core, since everything else is bound to get obsolete sooner
or later, and most people wouldn't bother updating this to keep it up
with the trunk.

I've gone trough the links below, and got some of it working, but the pk
thing doesn't work on any of them.

Any help, please?

~ Chris

El mar, 20-11-2007 a las 15:41 -0500, Marty Alchin escribi�:
> On Nov 20, 2007 3:33 PM, Chris Hoeppner <[EMAIL PROTECTED]> wrote:
> > It would be nice to be able to include this in the upload_to parameter.
> > Something like
> > 'upload/%(model_name)s/%(instance_id)s.%(mimetype_extension)s' perhaps?
> > Maybe, if the parameter ends with a slash, the handler could know "ok.
> > this is a directory. let's keep the original filename".
> 
> As usual, I'll respond to this as I've been doing a good bit of work
> in this area lately. There's no "official" way to do this yet, but
> there are ways to get the job done. Take a look at the links below for
> more information on some techniques.
> 
> I'm doing a good bit of work on making Django handle renaming a bit
> better, and I'm hoping it will land during the next sprint on December
> 1. There's no guarantee of that, of course, but that's my personal
> goal. That will be documented thoroughly when it lands, and I'll make
> an announcement here on django-users whenever that is, sprint or not.
> 
> -Gul
> 
> http://scottbarnham.com/blog/2007/07/31/uploading-images-to-a-dynamic-path-with-django/
> http://code.djangoproject.com/wiki/CustomUploadAndFilters
> http://gulopine.gamemusic.org/2007/11/customizing-filenames-without-patching.html
> 
> > 


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



Template Tag and Javascript Best Practices

2007-11-30 Thread Manakel

Hello,

Currently, i would like to render some part of my template using a
javascript utilities "myrender.js"

I was thinking of doing the thing clean by creating a dedicated
template tag: "jsrender".

Now the question is:

Should i
a) let the designer perform an include for "myrender.js" in each
template where he wants to use the "jsrender" tag
b) incorporate the include "myrender.js" in my template tag
(this way designer just use the template tag,like any other template
tag).

If b) is an ok solution, do you know where to find a sample of doing
so?

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



Many to many column naming in 1.0?

2007-11-30 Thread J. Clifford Dyer

Hey all,

Does anyone know if there are plans to include this patch (or similar
functionality) in Django 1.0?

http://code.djangoproject.com/ticket/785

It's a relatively simple change, breaking no backwards compatibility,
and it goes a long way to making it easier to integrate legacy DBs into
django projects.  

Cheers,
Cliff


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



SCGI (or other) graceful restart

2007-11-30 Thread Thomas Güttler

Hi,

up to now I use SCGI and flup. There are some issues:

 - flup does not provide an init script. No big problem: I wrote my own.
 - flup is not developed actively: The author does not use it anymore.
 - There is no graceful restart (Restarting SCGI server with kill produces 
internal server errors).

Graceful restart is the bigest problem for me. During a restart the
site should stop serving requests for some seconds, but the users
should not see errors messages.

I want an external server, so mod_python is not an option.
Access to server goes through Apache2.

How do you handle this?

I think about these solutions:

- I heard that mod_wsgi has a server mode. Need to look at it
- Use mod_proxy and run lighttpd. Never used it, but I think it
  has built in SCGI support.
- Use FastCGI. But somehow I want to avoid it, because SCGI is
  simple and easy to understand.
- patch flup to support graceful restart.

 Thomas


-- 
Thomas Güttler, http://www.tbz-pariv.de/ 
Bernsdorfer Str. 210-212, 09126 Chemnitz, Tel.: 0371/5347-917
TBZ-PARIV GmbH  Geschäftsführer: Dr. Reiner Wohlgemuth
Sitz der Gesellschaft: Chemnitz Registergericht: Chemnitz HRB 8543

--~--~-~--~~~---~--~~
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: NodeList.render() and SafeString

2007-11-30 Thread Michael Elsdörfer

> It's an oversight; I hadn't thought of that case. You're right, marking
> render() output as safe should be the right thing to do. If you'd care
> to open a ticket so this doesn't get lost, I'll fix it tomorrow or
> during the sprint on the weekend.

Thanks Malcolm:

http://code.djangoproject.com/ticket/6057

Michael

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



Latest collection of Amazing Inspiring Stories

2007-11-30 Thread P K Kothari
The Potatos 
The Empty 
Chair
Two Goats 
My Visit in 
Heaven
Perfect 
Person
The Blacksmith
One Story 
Three 
Bricklayers
The 
Smokesignal
The Chines 
Farmer
The Sandcastle
The Precious 
Gift
Lesson from a 
turtle
The Dollmaker
Don't Change The
World
The Rope 
The Beggar 
The Hunter 
The Secret 
The Marble 
Tile
The Last 
Supper
The Cross to 
Bear
The Stone 
The Cart Horse & The
Donkey
The Broken 
Painting
The Starfish & A
Man
A Story about 
Happiness
The Old Tree 
The Begger's 
rags
Butch O'Hare
Bend, but Don't
Break
Build a 
Bridge
All the Time in the
World
A Wonderful 
Story
A Mothers 
Love
A Glass of 
Milk
A Fascinating 
Story
A Brother's 
Hands
Abraham Lincoln's Letter to
Headmaster
SUN RISE 
The Monk's 
Vision
The Emperor 
The Teeth of The
Dog
The Wiseman & The
Youngman
The Walnut 
Tree
A Snake 
Charmer
The Mango 
Lover
Three 
Questions
Three Kernels of
Corn
The Teacup 
The Buzzard, Bat &
Bubblebee
The Salt 
The Monkey with The Wooden
Apple
The Most Important
Part
The House 
The Cow & The Pig
A Pond Full of 
Milk
The Hands 
The Result of