Re: Ajax Form Submission Trouble

2007-08-18 Thread Thejaswi Puthraya

> I'm using mochikit

Try,

onclick="$('button_id').disabled=true;"

It is 'disabled' and not 'disable'.
Check out button properties at 
http://www.w3schools.com/htmldom/dom_obj_button.asp
According the W3Schools...disabled works since IE5.0...so I see no
reason why it shouldn't work in IE7.0

Cheers
Thejaswi Puthraya


--~--~-~--~~~---~--~~
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 install django on Apache/Linux

2007-08-18 Thread James Bennett

On 8/19/07, shabda <[EMAIL PROTECTED]> wrote:
> I am *very* confused here, I have only installed mod_python, and
> nothing specific to django. SO how would the line
>  PythonHandler django.core.handlers.modpython work?

If you have Django installed on the server and on the Python path, it will work.

> And what do I specify in
> SetEnv DJANGO_SETTINGS_MODULE mysite.settings
> If my site is under /var/www/html/python, with the settings file as /
> var/www/html/python/foo/settings.py should I write,
> SetEnv DJANGO_SETTINGS_MODULE foo.settings
> (or) SetEnv DJANGO_SETTINGS_MODULE python.foo.settings

If 'python' is the directory that's on the Python path, you want 'foo.settings'.

Keep in mind, though, that it's generally a *bad* idea to place your
Python code in the document root of the server (assuming that's what
you've done since you say it's in /var/www/html); if anything ever
goes wrong with mod_python and it serves those as plain-text files
instead of routing to the Django handler, your code could be exposed
for all the world to see.

And remember that the Python code can live anywhere on the server, as long as:

1. The directory it's in is on the Python import path, and
2. Apache has the appropriate permissions to read that directory (it
won't need to be able to write, just read).

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



How to install django on Apache/Linux

2007-08-18 Thread shabda

I have apache installed on linux with mod_php, mysql. I am trying to
get django working here, and am following the intsallation steps at
http://www.djangobook.com/en/beta/chapter21/ .
Step 1. Install mod_python
did yum install mod_python. Checked that mod_python is installed.
Step 2.
Add this to your httpd.conf

SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonDebug On

I am *very* confused here, I have only installed mod_python, and
nothing specific to django. SO how would the line
 PythonHandler django.core.handlers.modpython work?
And what do I specify in
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
If my site is under /var/www/html/python, with the settings file as /
var/www/html/python/foo/settings.py should I write,
SetEnv DJANGO_SETTINGS_MODULE foo.settings
(or) SetEnv DJANGO_SETTINGS_MODULE python.foo.settings


--~--~-~--~~~---~--~~
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: Cache middleware causing unit tests to fail

2007-08-18 Thread Sasha Weberov



On Aug 19, 12:43 am, "Placid Publishing, LLC"
<[EMAIL PROTECTED]> wrote:
> Sadly there is not much to trace back, the dev server runs fine with
> memcache, but mod_python/apache doesn't. Mod_python/apache work with the
> file system cache as does the dev server, with memcache as the cache
> storage mod_python/apache will just use up almost all cpu and ram, and
> the load never goes down (unlike a restart without cache or with file
> system cache). The site isn't busy, and sockstat shows httpd processes
> connecting to memcache then disconnecting frequently. I've checked thru
> the code and it looks good, cmemcache shouldn't be giving me any
> problems. Middlewear order also looks fine.
>
> MIDDLEWARE_CLASSES = (
> 'django.middleware.common.CommonMiddleware',
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
> 'django.middleware.doc.XViewMiddleware',
> 'django.middleware.cache.CacheMiddleware',
> 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
> )
>
>
>
> Eratothene wrote:
> > I think you better not disable cache middleware in tests. If tests
> > fail, so will be in production. I had similar problem, I thought it
> > was something wrong with tests, but really it was problem in the code.
> > My site was running well on django built-in server, but not on apache
> > mod_python.
>
> > The problem was in incorrect order of middlewares. Cache middleware
> > must be after session middleware. Personally I think it is bug django
> > that causes such behavior. Please post your traceback of the failed
> > tests.
>
> > 'django.contrib.sessions.middleware.SessionMiddleware',
> > 'django.middleware.cache.CacheMiddleware',
>
> > Norman Harman wrote:
>
> >> Hi,
>
> >> request.template is None instead of what it should be because the response 
> >> is from the
> >> cache middleware.
>
> >> Which is fine.   My question is there a good way to disable the cache 
> >> middleware during
> >> tests?
>
> >> "good" being atleast the following. is automatic, isn't based of value of 
> >> DEBUG, doesn't
> >> require changing django distro.
>
> >> Is there a special settings file or other file imported during tests only?
>
> >> thanks,
> >> njharman- Hide quoted text -
>
> - Show quoted text -


DOH, my bad, I thought this was directed towards me from another post.
SORRY :-|


--~--~-~--~~~---~--~~
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: Cache middleware causing unit tests to fail

2007-08-18 Thread Placid Publishing, LLC

Sadly there is not much to trace back, the dev server runs fine with 
memcache, but mod_python/apache doesn't. Mod_python/apache work with the 
file system cache as does the dev server, with memcache as the cache 
storage mod_python/apache will just use up almost all cpu and ram, and 
the load never goes down (unlike a restart without cache or with file 
system cache). The site isn't busy, and sockstat shows httpd processes 
connecting to memcache then disconnecting frequently. I've checked thru 
the code and it looks good, cmemcache shouldn't be giving me any 
problems. Middlewear order also looks fine.

MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.doc.XViewMiddleware',
'django.middleware.cache.CacheMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
)



Eratothene wrote:
> I think you better not disable cache middleware in tests. If tests
> fail, so will be in production. I had similar problem, I thought it
> was something wrong with tests, but really it was problem in the code.
> My site was running well on django built-in server, but not on apache
> mod_python.
>
> The problem was in incorrect order of middlewares. Cache middleware
> must be after session middleware. Personally I think it is bug django
> that causes such behavior. Please post your traceback of the failed
> tests.
>
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.middleware.cache.CacheMiddleware',
>
>
> Norman Harman wrote:
>   
>> Hi,
>>
>> request.template is None instead of what it should be because the response 
>> is from the
>> cache middleware.
>>
>> Which is fine.   My question is there a good way to disable the cache 
>> middleware during
>> tests?
>>
>> "good" being atleast the following. is automatic, isn't based of value of 
>> DEBUG, doesn't
>> require changing django distro.
>>
>> Is there a special settings file or other file imported during tests only?
>>
>> thanks,
>> njharman
>> 
>
>
> >
>   


--~--~-~--~~~---~--~~
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: Cache middleware causing unit tests to fail

2007-08-18 Thread Eratothene

I think you better not disable cache middleware in tests. If tests
fail, so will be in production. I had similar problem, I thought it
was something wrong with tests, but really it was problem in the code.
My site was running well on django built-in server, but not on apache
mod_python.

The problem was in incorrect order of middlewares. Cache middleware
must be after session middleware. Personally I think it is bug django
that causes such behavior. Please post your traceback of the failed
tests.

'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.cache.CacheMiddleware',


Norman Harman wrote:
> Hi,
>
> request.template is None instead of what it should be because the response is 
> from the
> cache middleware.
>
> Which is fine.   My question is there a good way to disable the cache 
> middleware during
> tests?
>
> "good" being atleast the following. is automatic, isn't based of value of 
> DEBUG, doesn't
> require changing django distro.
>
> Is there a special settings file or other file imported during tests only?
>
> thanks,
> njharman


--~--~-~--~~~---~--~~
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: Django with cmemcache extension issues

2007-08-18 Thread Sasha Weberov



On Aug 18, 10:01 pm, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote:
> On 8/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> ...
>
> > however, upon enabled the middlwear with memcached using
> > cmemcached... I've tried
> > cacheing with the file system as the source and its fine.
>
> With respect, you may have better luck asking people directly involved
> with cmemcache.

I will do so - I figured there are many people who use cmemcache/
memcache with Django.


--~--~-~--~~~---~--~~
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: Ajax Form Submission Trouble

2007-08-18 Thread [EMAIL PROTECTED]

Thejaswi Puthraya wrote:
> > I seem to have some terribly stupid users that repeadtly press the
> > submit button on an ajax comments form. How can clear the form after
> > the user submits the message like youtube does (they are ajax'd
> > aswell). I've tried onclick="this.disable=true" and all, but it
> > doesn't work in IE7. Any suggestions or tips would be greatly
> > appreciated.
>
> Which Javascript library are you using??? Most javascript libraries
> handle the Ajax stuff as browser independent as possible (not always
> true though).
>
> Cheers
> Thejaswi Puthraya

I'm using mochikit


--~--~-~--~~~---~--~~
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: Ajax Form Submission Trouble

2007-08-18 Thread [EMAIL PROTECTED]



On Aug 14, 3:11 am, dor <[EMAIL PROTECTED]> wrote:
> Try this: onclick="this.disabled=true;"
> Notice the "disabled" instead of "disable"!

didn't work :( In IE7.


--~--~-~--~~~---~--~~
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: What's possible in the admin?

2007-08-18 Thread oggie rob

The short story is all of these should be doable in the admin, and
most will also be quite simple.

The long story is below. Note, however, that some of my suggestions
are based on the old admin rather than newforms-admin, but from what I
have seen of newforms-admin, it should be fairly similar in concept.
My original (and current production) site was built by modifying the
admin and I faced and overcame issues like the ones you suggested
without too much trouble. If you can trust the users, it is
scaffolding that you can often easily build upon.

> 1) Add a duplicate this record button to start a new 'Add [model]'
> page but pre filled in with data from an existing record.

Yes. To provide the "Add From This" link, one option can be to modify
the submit_line.html template, another is to add a link to a change
list from the admin index page and use a change list to select the
source. For pre-filling data, this was rather painful with the 0.91
admin pages - I called a subclassed django "change" method when I was
working on this, and overrode the admin url - but you might be able to
avoid some problems with newforms-admin, if you are lucky.

> 2) Add some light reporting views.  I imagine these would be just like
> a public view but limited and linked to from the admin somehow -- so
> I'd need admin authentication and a link in the admin?

Yes. Very simple, just create your own admin index page & insert it
before your admin inclusion, add the reporting views, and make sure
your views are decorated with staff_member_required.

> 3) If I can do #2, that opens up a lot of things for the other items on my 
> list.

Great!

> 4) When adding a new record to a model, hook in an AJAX call to check
> if the item already exists in the table and indicate if it does.
> (There's a single column that is the key for this.)

If you really need to (the admin page will check for violations of
some constraints (like unique, primary_key, etc)). You would use the
"js" option to add the ajax hook.

> 5) And advanced search for their main model.  This is posible via #2
> but it would be interesting if this could be abstracted a bit and be
> re-used.  I'm kind of thinking of a way to specify which fields should
> be included in the advanced search and automatically generate a form
> and process the form submit to search those fields?  Not looking at
> full-text search at all, but simple things like `title` contains
> 'django', `bestseller` is true, `binding` is 'Hard Cover', things like
> that.

Yes using both search_fields and list_filter, No as a single form-like
search interface. You can use search fields on any number of text &
char fields, and boolean, foreign key and date fields for the list
filter. It is pretty slick as is, so you should check it out and see
if it will solve the user's needs before you write anything
additional.
Your example above would use:
 search_fields = ['title']
 list_filter = ['bestseller', 'binding']
The user would select "Bestseller: Yes" and "Binding: Hard Cover" on
the right side of the screen, and type the title name in the search
field.
One caveat: the above example assumes 'binding' is a Foreign Key. If
it is a choice field, it won't work.

> 6) From the admin create a 3-step wizard to build, generate, and send
> a newsletter.  Probably another item that depends on #2.

Yes, again very simple. You just need to link to it in the admin index
page. My suggestion with "wizard" forms is that you tie the "next"
page url directly into the urls.py page (i.e. don't have hrefs
scattered throughout your views), and keep everything under one common
url (e.g. /makenl/build/, /makenl/gen/, /makenl/send/)

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



Re: type object 'HtmlFormatter' has no attribute 'encoding'

2007-08-18 Thread Malcolm Tredinnick

On Sat, 2007-08-18 at 18:06 -0700, Evan H. Carmi wrote:
> Hi,
> 
> I am trying to get pygments and markdown highlighting working on my blog.
> 
> When I try and save a post that has ` in it I get an attribute error.
> 
> My models are (more beautifully here http://dpaste.com/17230/) ignore
> the _highlight_python_code part. that was from a previous attempt:

For future reference, posting a traceback and a simplified example that
demonstrates the problem is going to be more helpful. It's fairly
time-consuming to have to wade through dozens of lines of code with no
clue about where the error is occurring (or what the error really is).

General technique when you have a problem like this is to start removing
lines of code that don't make the error go away (or change at all). When
you have the simplest example possible, it's usually going to be about 5
or 10 lines long and either you will suddenly see what is wrong or you
can post it and somebody here will recognise the problem.

Don't let that discourage you from asking questions when you need help,
though. Simply remember that this is a high-volume list, so the people
most likely to get rapid responses are those who make it easiest for us
to help them. Law of the jungle (and volunteer services), for better or
worse.

Regards,
Malcolm

-- 
He who laughs last thinks slowest. 
http://www.pointy-stick.com/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: Make Operating System Faster !!

2007-08-18 Thread Malcolm Tredinnick

On Sat, 2007-08-18 at 21:43 -0300, Alvaro Mouriño wrote:
> On 8/18/07, John Travolta <[EMAIL PROTECTED]> wrote:
> > Tune up your system and make it faster
> This list gets lots of spam, doesn't it? Is there a way to prevent it
> from hitting the mailboxes of the list subscribers?

In reality, the list doesn't get a lot of spam. It's a very
high-profile, high-traffic list and taking that into consideration, a
few messages a day is nothing. As has been mentioned before (many, many
times -- perhaps you could have searched the archives first?), there is
nothing we can do. Google's spam filtering picks up a lot, but nothing
is perfect. We remove the messages from the archives and ban the users,
but it's only a holding operation.

Thanking you for your understanding,
Malcolm

-- 
Despite the cost of living, have you noticed how popular it remains? 
http://www.pointy-stick.com/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: UnicodeDecodeError in template rendering

2007-08-18 Thread Malcolm Tredinnick

On Sat, 2007-08-18 at 22:46 +, cesco wrote:
> Hi,
> 
> I'm using sqlite3 as db for my django project.
> In order to load the data in the db I first generated a unicode string
> (which contains danish characters "ø, æ, å") and dumped such a string
> to a file (in json format) as follows:
> f_hdl = file(json_offers_path, 'w')
> f_hdl.write(offer_entry.encode('utf-8'))
> f_hdl.close()
> 
> I then loaded the data in the database using the command:
> python manage.py loaddata path/to/json/file
> 
> I could run the local server for development without any problem. In
> the homepage I have to display some information that may contain
> danish characters. If the page I have to display doesn't contain
> danish characters I don't get any error.
> If it does contain them I get the following error:
> 
> Exception Type: UnicodeEncodeError
> Exception Value: 'ascii' codec can't encode character u'\xe6' in
> position 27: ordinal not in range(128)
> Exception Location: C:\Python25\lib\site-packages\django\utils
> \encoding.py in force_unicode, line 39
> Unicode error hint: The string that could not be encoded/decoded was:
> roanlæg
> 
> Do you have any suggestion on how to solve the problem?

The full traceback would be more useful than just the last line, since
that will explain where you are coming from to get to this point. What
is most important to know is (a) what is the data that it is trying to
render (both type and content). Try to find where you load that data and
print out it's type and repr() -- don't print str(), since that
disguises problems by calling conversion function, (b) what piece of
code is loading this data or trying to display it.

You seem to be suggesting that you don't see the problem with the
development server but in some other set up you do see it. What are the
details of this other setup? What else has changed between when you
didn't see the error and when it started to appear? For example, have
you changed the database backend?

Malcolm

-- 
Many are called, few volunteer. 
http://www.pointy-stick.com/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: What's possible in the admin?

2007-08-18 Thread Malcolm Tredinnick

On Sat, 2007-08-18 at 08:38 -0700, Rob Hudson wrote:
> I have a list of things I'd like to do in the admin for a new client
> but I'm not sure if all of these are possible.  I'm hoping those more
> familiar with admin tweaking could provide a Yes/No for these?  I've
> heard something about how the new admin branch allows for multiple
> admins, so possibly one admin is the standard data management admin,
> and one admin is various links to jump off into the other bits listed
> below?

Most of these should be possible already, more or less, but it would be
pretty fiddly. Newforms-admin makes a lot of it easier, because it's
slightly more modular and has more hooks in place that have been exposed
to make customisation easy.

A lot of what you're wanting to do with extra features (newsletter,
reports, etc) are really just a matter of adding an extra control on
some page somewhere and then branching off to your own views. So the
only admin customisation is adding the extra control. You'll need to do
the permissions check in your view and write some templates yourself.

[...]
> 5) And advanced search for their main model.  This is posible via #2
> but it would be interesting if this could be abstracted a bit and be
> re-used.  I'm kind of thinking of a way to specify which fields should
> be included in the advanced search and automatically generate a form
> and process the form submit to search those fields?  Not looking at
> full-text search at all, but simple things like `title` contains
> 'django', `bestseller` is true, `binding` is 'Hard Cover', things like
> that.

Not sure how easy this would be to implement. As a separate page,
probably not too bad. As something that looks really integrated, maybe
harder.

Without doing the work up front, my gut feeling is you're not striving
to do anything impossible with your six points.

Regards,
Malcolm

-- 
Why be difficult when, with a little bit of effort, you could be
impossible. 
http://www.pointy-stick.com/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: OperationalError

2007-08-18 Thread Doug B

> I tried that, but I get the same error, the traceback displays that
> line as the "buggy" one: for item in self.orderitem_set.all():

def count_items(self):
items = 0
for item in self.fielddef_set.all():
items += item.id
return items

I added that to one of my models just to test, and it works fine for
me (adding ids since I have no quantity field).  I'm still on .96 and
using postrgres though.  Sorry I don't have an answer, hopefully
someone else will!

> Each cart won't have many items, so I guess counting them is not going
> to be a demanding process, right?

I'd be more worried about pulling all the item(s) info over just to
get a sum than the counting, but if you need to display item info
anyway it probably doesn't matter at all.   Especiallly if you used
select_related() on the getting the order in the first place.


--~--~-~--~~~---~--~~
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: Django with cmemcache extension issues

2007-08-18 Thread Jeremy Dunck

On 8/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
...
> however, upon enabled the middlwear with memcached using
> cmemcached... I've tried
> cacheing with the file system as the source and its fine.

With respect, you may have better luck asking people directly involved
with cmemcache.

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



Django with cmemcache extension issues

2007-08-18 Thread [EMAIL PROTECTED]

I have the middlwear enabled to cache using memcached as the cache
location. Memecached is running and it seems to work fine with the dev
server; however, upon enabled the middlwear with memcached using
cmemcached and restarting the web server, or even starting and
stopping it - the server will drain all resources and not recover from
it. 100% cpu usage and alot of memory usage (sometimes almost all of
it). Usually with cacheing disabled the memory and cpu spike only last
a minute or so then it stabilizes. What can this be? I've tried
cacheing with the file system as the source and its fine. Logs are
empty, sockstat (netstat in FreeBSD) shows httpd opened a few
connections to memcached, but then they all fail. Lots of processes
are created then killed (which is normal at startup), but it never
recovers.

Any feedback, comments, and/or suggestions would be greatly
appreciated.

Thanks,
Peter


System Specs:
FreeBSD 6.1
Django 0.97 (latest svn 08/18/07)
Mod_Python 3.3.1
Apache 2.2.4
Libmemcache-1.4.0.rc2
Memcached-1.2.2
py25-memcached-1.36


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

2007-08-18 Thread Alvaro Mouriño

On 8/18/07, Doug B <[EMAIL PROTECTED]> wrote:
>
> > [PYTHON]
> > class Order(models.Model):
> > def count_items(self):
> > items = 0
> > for item in self.orderitem_set.filter(order=self):
> > items += item.quantity
> > return items
> > count = property(count_items)
> > [/PYTHON]
>
>
> For the instance.othermodel_set objects, the 'order=self' is already
> implied, you shouldn't supply it as a filter argument. I have a
> feeling the error is from specifying the same column twice.  Try
> self.orderitem_set.all().
>
I tried that, but I get the same error, the traceback displays that
line as the "buggy" one: for item in self.orderitem_set.all():

> You might also consider dropping to sql for stuff like this if you've
> got performance issues. Probably overkill here, but since I had to
> spend some time figuring it out on a similar problem today, maybe it
> will help you.
> from django.db import connection
> c=connection.cursor()
> q="select SUM(quantity) as item_count from %s where order=%s" %
> (self.orderitem_set.model._meta.db_table,self._get_pk_val())
> c.execute(q)
> count =  c.fetchone()[0] # grab the first and only row
>
Thanks for the tip. I did something like that but then found a snippet
[0] doing what I wanted in a more django-like way. I still don't know
if use my own sql sentences for this cases or stick to the django api.
I guess it's a decision based on performance, the problem is that I
don't know which is more performant.

Each cart won't have many items, so I guess counting them is not going
to be a demanding process, right?

AlvAro

"You can't change the world, but you can change your mind."
Software Libre: El conocimiento no puede tener dueño.

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

2007-08-18 Thread Doug B

> q="select SUM(quantity) as item_count from %s where order=%s" %
> (self.orderitem_set.model._meta.db_table,self._get_pk_val())

Sorry, that first one is wrong.
q="select SUM(quantity) as item_count from %s where order_id=%s" %
(self.orderitem_set.model._meta.db_table,self._get_pk_val())

I wish I knew how to get 'order_id' from the meta info like you can
get get the db table, but using foreignkeyfieldname_id give you the
default column name.


--~--~-~--~~~---~--~~
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: type object 'HtmlFormatter' has no attribute 'encoding'

2007-08-18 Thread Kai Kuehne

You could also use the codehilite extension for markdown:
http://achinghead.com/markdown/codehilite/

--~--~-~--~~~---~--~~
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: type object 'HtmlFormatter' has no attribute 'encoding'

2007-08-18 Thread Kai Kuehne

Hi,

On 8/19/07, Evan H. Carmi <[EMAIL PROTECTED]> wrote:
> #from dpaste.com/16735

> `print "hello world"`
>
> I am using a PostgreSQL database.

Looks like my code, but you missed something. :)
Add the parenthesis on line 94 and it'll work:
formatter = HtmlFormatter()

> Thanks,
> Evan

Kai

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

2007-08-18 Thread Doug B

> [PYTHON]
> class Order(models.Model):
> def count_items(self):
> items = 0
> for item in self.orderitem_set.filter(order=self):
> items += item.quantity
> return items
> count = property(count_items)
> [/PYTHON]


For the instance.othermodel_set objects, the 'order=self' is already
implied, you shouldn't supply it as a filter argument. I have a
feeling the error is from specifying the same column twice.  Try
self.orderitem_set.all().

You might also consider dropping to sql for stuff like this if you've
got performance issues. Probably overkill here, but since I had to
spend some time figuring it out on a similar problem today, maybe it
will help you.
from django.db import connection
c=connection.cursor()
q="select SUM(quantity) as item_count from %s where order=%s" %
(self.orderitem_set.model._meta.db_table,self._get_pk_val())
c.execute(q)
count =  c.fetchone()[0] # grab the first and only row


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



type object 'HtmlFormatter' has no attribute 'encoding'

2007-08-18 Thread Evan H. Carmi

Hi,

I am trying to get pygments and markdown highlighting working on my blog.

When I try and save a post that has ` in it I get an attribute error.

My models are (more beautifully here http://dpaste.com/17230/) ignore
the _highlight_python_code part. that was from a previous attempt:

from django.db import models
import datetime

# Create your models here.

class Tag(models.Model):
slug = models.SlugField(
prepopulate_from=("name",),
help_text='Automatically prepopulated from name',
)
name = models.CharField(maxlength=30)
description = models.TextField(
help_text='Short summary of this tag'
)
def __str__(self):
return self.name

def get_absolute_url(self):
return "/blog/tag/%s/" % self.slug

class Admin:
list_display = ('name', 'slug', )
search_fields = ('name', 'description',)

class Entry(models.Model):
title = models.CharField(maxlength=255, core=True,
unique_for_date="pub_date")
pub_date = models.DateTimeField(core=True)
slug = models.SlugField(maxlength=30, prepopulate_from= ['title'])
body = models.TextField(core=True, help_text='Use http://daringfireball.net/projects/markdown/syntax";>Markdown-syntax')
body_html = models.TextField(blank=True, null=True)
use_markdown = models.BooleanField(default=True)
tags = models.ManyToManyField(Tag,
filter_interface=models.HORIZONTAL)

class Admin:
fields = (
(None, {'fields': ('slug', 'title', 'tags',
'use_markdown', 'pub_date', 'body', 'body_html',)}),
)

def __str__(self):
return self.title

def get_absolute_url(self):
return "/blog/%s/%s/" %
(self.pub_date.strftime("%Y/%m/%d").lower(), self.slug)

#from
http://www.unessa.net/en/hoyci/2006/11/highlighting-code-using-pygments-and-beautiful-soup/

def _highlight_python_code(self):
from pygments import highlight
from pygments.lexers import PythonLexer
from pygments.formatters import HtmlFormatter
from BeautifulSoup import BeautifulSoup

soup = BeautifulSoup(self.body)
python_code = soup.findAll("code")

if self.use_markdown:
import markdown

index = 0
for code in python_code:
code.replaceWith('mark %i' % index)
index = index+1

markdowned = markdown.markdown(str(soup))
soup = BeautifulSoup(markdowned)
markdowned_code = soup.findAll("p", "python_mark")

index = 0
for code in markdowned_code:

code.repalceWith(highlight(python_code[index].renderContents(),
PythonLexer(), HtmlFormatter()))
index = index+1
else:
for code in python_code:
code.replaceWith(highlight(code.string,
PythonLexer(), HtmlFormatter()))

return str(soup)


#from dpaste.com/16735
def markup(self, value):
import re
from BeautifulSoup import BeautifulSoup
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import guess_lexer, get_lexer_by_name
from markdown import markdown

value = markdown(value)
tree = BeautifulSoup(value)
try:
for code in tree.findAll("code"):
print code.contents[0].__dict__
lexer = get_lexer_by_name('python',
stripall=True)
formatter = HtmlFormatter
new_content =
highlight(code.contents[0], lexer, formatter)
code.replaceWith(new_content)
value = str(tree)
except IndexError:
pass
return value



def save(self):
self.body_html = self.markup(self.body)
super(Entry,self).save()


I was trying to save a post with the following content:

`print "hello world"`

I am using a PostgreSQL database.

Thanks,
Evan

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

Re: Make Operating System Faster !!

2007-08-18 Thread Alvaro Mouriño

On 8/18/07, John Travolta <[EMAIL PROTECTED]> wrote:
> Tune up your system and make it faster
This list gets lots of spam, doesn't it? Is there a way to prevent it
from hitting the mailboxes of the list subscribers?

AlvAro

"You can't change the world, but you can change your mind."
Software Libre: El conocimiento no puede tener dueño.

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



Make Operating System Faster !!

2007-08-18 Thread John Travolta
Tune up your system and make it faster
http://windowsxpsp2pro.blogspot.com/

--~--~-~--~~~---~--~~
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: UnicodeDecodeError in template rendering

2007-08-18 Thread Kai Kuehne

Hi,

On 8/19/07, cesco <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I'm using sqlite3 as db for my django project.
> In order to load the data in the db I first generated a unicode string
> (which contains danish characters "ø, æ, å") and dumped such a string
> to a file (in json format) as follows:
> f_hdl = file(json_offers_path, 'w')
> f_hdl.write(offer_entry.encode('utf-8'))
> f_hdl.close()
>
> I then loaded the data in the database using the command:
> python manage.py loaddata path/to/json/file
>
> I could run the local server for development without any problem. In
> the homepage I have to display some information that may contain
> danish characters. If the page I have to display doesn't contain
> danish characters I don't get any error.
> If it does contain them I get the following error:
>
> Exception Type: UnicodeEncodeError
> Exception Value: 'ascii' codec can't encode character u'\xe6' in
> position 27: ordinal not in range(128)
> Exception Location: C:\Python25\lib\site-packages\django\utils
> \encoding.py in force_unicode, line 39
> Unicode error hint: The string that could not be encoded/decoded was:
> roanlæg
>
> Do you have any suggestion on how to solve the problem?

Do you use __str__ in your models.py?
If yes, change it to __unicode__ and it should work.

> Many thanks
> Francesco

Kai

--~--~-~--~~~---~--~~
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: What's the best approach to allow users to upload data to a Django Web site?

2007-08-18 Thread Divan Roulant

Thanks Jeremy for pointing me on this topic. My goal is to implement a
prototype locally and then, move into learning how to put it right on
the Web (https, LAMP and everything...). God, so much work (and
learning curve) ahead! :-)

Divan

On Aug 18, 6:12 pm, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote:
> On 8/18/07, Divan Roulant <[EMAIL PROTECTED]> wrote:
>
>
>
> > That's what I though initially but since I am fairly new to Django and
> > Web development, I wanted to check it out with more experienced
> > developers, just in case.
>
> OK, if you're new to webdev, one more bit of advice: In general do not
> trust data from the browser.
>
> HTTP is an open protocol and unless you're running HTTPS with a
> trusted client, the client can and will lie to you.
>
> It's your responsibility to validate data that's sent to you, and do
> not allow untrusted clients to manipulate data that is not fully
> theirs to screw up.
>
> More here:http://www.djangobook.com/en/beta/chapter20/


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



UnicodeDecodeError in template rendering

2007-08-18 Thread cesco

Hi,

I'm using sqlite3 as db for my django project.
In order to load the data in the db I first generated a unicode string
(which contains danish characters "ø, æ, å") and dumped such a string
to a file (in json format) as follows:
f_hdl = file(json_offers_path, 'w')
f_hdl.write(offer_entry.encode('utf-8'))
f_hdl.close()

I then loaded the data in the database using the command:
python manage.py loaddata path/to/json/file

I could run the local server for development without any problem. In
the homepage I have to display some information that may contain
danish characters. If the page I have to display doesn't contain
danish characters I don't get any error.
If it does contain them I get the following error:

Exception Type: UnicodeEncodeError
Exception Value: 'ascii' codec can't encode character u'\xe6' in
position 27: ordinal not in range(128)
Exception Location: C:\Python25\lib\site-packages\django\utils
\encoding.py in force_unicode, line 39
Unicode error hint: The string that could not be encoded/decoded was:
roanlæg

Do you have any suggestion on how to solve the problem?

Many thanks
Francesco


--~--~-~--~~~---~--~~
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: What's the best approach to allow users to upload data to a Django Web site?

2007-08-18 Thread Jeremy Dunck

On 8/18/07, Divan Roulant <[EMAIL PROTECTED]> wrote:
>
> That's what I though initially but since I am fairly new to Django and
> Web development, I wanted to check it out with more experienced
> developers, just in case.

OK, if you're new to webdev, one more bit of advice: In general do not
trust data from the browser.

HTTP is an open protocol and unless you're running HTTPS with a
trusted client, the client can and will lie to you.

It's your responsibility to validate data that's sent to you, and do
not allow untrusted clients to manipulate data that is not fully
theirs to screw up.

More here:
http://www.djangobook.com/en/beta/chapter20/

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



OperationalError

2007-08-18 Thread Alvaro Mouriño

Hi list,

I'm developing a (yet another) shopping cart and I'm having a problem
when counting the items in the cart.

In my model I have an "Order" class which is the cart and a
"OrderItem" class which are the items in the cart. In the Order class
I have this code:

[PYTHON]
class Order(models.Model):
def count_items(self):
items = 0
for item in self.orderitem_set.filter(order=self):
items += item.quantity
return items
count = property(count_items)
[/PYTHON]

When I run the application I get the error:
[ERROR]
OperationalError at /
(1241, 'Operand should contain 1 column(s)')
Request Method: GET
Request URL:http://localhost:8000/
Exception Type: OperationalError
Exception Value:(1241, 'Operand should contain 1 column(s)')
Exception Location:
/var/lib/python-support/python2.4/MySQLdb/connections.py in
defaulterrorhandler, line 35
Python Executable:  /usr/bin/python
Python Version: 2.4.4
[/ERROR]

Something strange is that the exception is thrown while rendering the template:
[ERROR]
Caught an exception while rendering: (1241, 'Operand should contain 1
column(s)')
73  
74  {{ cart.count }} item{{ cart.count|pluralize }}
75  
[/ERROR]

Any idea? Thanks in advance,

AlvAro

"You can't change the world, but you can change your mind."
Software Libre: El conocimiento no puede tener dueño.

--~--~-~--~~~---~--~~
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: What's the best approach to allow users to upload data to a Django Web site?

2007-08-18 Thread Divan Roulant

That's what I though initially but since I am fairly new to Django and
Web development, I wanted to check it out with more experienced
developers, just in case.

Thanks!

Divan

On Aug 18, 3:50 pm, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote:
> On 8/18/07, Divan Roulant <[EMAIL PROTECTED]> wrote:
>
> > However, I'm stuck with that question:
> > once a user is logged in to my site, should I link her to the Django
> > admin site (with restricted permissions) or should I implement myself,
> > for my site, the views and templates to allow that user to upload
> > data?
>
> The admin is a fairly rough UI, but quite good for something that's
> automatically supplied by the framework.
>
> However, the admin should only be used by people you fully trust with
> all of your data.
>
> If you want general, untrusted, users to be able to manipulate data,
> you'll want to create your own views and forms.


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



URGENT ACTION REQUIRED!

2007-08-18 Thread Howe

Designer fragrances for less

01. For Women - Davidoff Cool Water EDT 30ml RRP: £21.00
04. For Women - Escada Signature by Escada EDP 30ml RRP : £22.99
05. For Women - Gucci Rush EDT Spray 75ml RRP: £47.00
06. For Women - Elizabeth Arden Green Tea EDT 50ml RRP: £19.00
07. For Women - Acqua Di Gio by G. Armani EDT 35ml RRP: £28.99
08. For Women - Kenzo L'eau par Kenzo EDT 30ml RRP: £19.00
09. For Women - Naomi Campbell Neomagic EDT 30ml RRP: £15.00
10. For Women - Christian Dior J'adore EDP 50ml RRP: £41.50
11. For Women - Cacharel Noa EDT 100ml RRP: £39.00
12. For Women - Hypnose by Lancome EDT 75ml RRP: £30.00
13. For Women - Calvin Klein Euphoria EDP 100ml RRP: £59.00
14. For Women - Deep Red for Women Hugo Boss EDP 50ml RRP: £31.00
16. For Women - Gabriela Sabatini Muelhens EDT 30ml RRP: £20.00
17. For Women - Paris Hilton EDP 50ml RRP: £24.00
18. For Women - Chanel Coco Mademoiselle EDP 35ml RRP: £37.00
21. For Women - Channel No. 5 Perfume EDT 75ml RRP: £60.00
23. For Women - Amor Amor by Cacharel EDT 30ml RRP: £21.00
24. For Women - Jungle Elephant by Kenzo EDP 30ml RRP: £30.00
25. For Women - Hugo Woman by Hugo Boss EDT 40ml RRP: £28.00
26. For Women - Naomi Cambell Naomi EDT 50ml RRP: £17.74
27. For Women - Ch. Dior Hypnotic Poison EDT 50ml RRP: £40.00
29. For Women - Miracle Lancome EDP 100ml RRP: £61.00
31. For Women - Boss Intense EDP 50ml RRP: £31.00
32. For Women - Angel for Women T. Mugler EDP 100ml RRP: £102.00
33. For Women - Dolce & Gabbana Light Blue EDT 50ml RRP: £26.99
34. For Women - Chanel Chance Parfum EDP 100ml RRP: £70.00
35. For Women - Sensi by Giorgio Armani EDP 30ml RRP: £26.50
36. For Women - Ulraviolet paco Rabanne EDP 50ml RRP: £36.00
38. For Women - Very Irresistible by Givenchy  EDT 30ml RRP: £27.50
39. For Women - Celine Dion For Women EDT 50ml RRP: £21.00
41. For Women - City Glam by G. Armani EDP 30ml RRP: £33.00
43. For Men - Hugo Boss Energise for Men EDT 75ml RRP: £30.00
47. For Women - Elizabeth Arden 5th Avenue EDP 30ml RRP: £25.00
51. For Men - Echo for Men by Davidoff EDT 30ml RRP: £25.00
52. For Men - Boss for Men EDT 50ml RRP: £30.00
54. For Men - Hugo by Hugo Boss 50ml RRP: £30.00
56. For Men - Fahrenheit by Christian Dior EDT 50ml RRP: £31.00
57. For Men - Lacost Pour Homme EDT 100ml RRP: £38.00
60. For Men - City Glam by Giorgio Armani EDT 50ml RRP: £33.00
61. For Men - Armani he by G. Armani EDT 50ml RRP: £33.00
63. For Men - Adidas Black - Unable to locate fragrance
64. For Men - Code for Men by G. Armani EDT 50ml RRP: £35.00
65. For Men - Joop Homme EDT 75ml RRP: £35.00
68. For Men - Dolce & Gabbana EDT 50ml RRP: £35.00
71. For Women - Gucci Envy Me EDT 100ml RRP: £55.00
72. For Women - Lacoste Touch of Pink EDT 90ml RRP: £39.00
74. For Women - Mania for Women by G. Armani EDP 30ml RRP: £29.00
75. For Women - YSL Opium EDP 50ml RRP: £53.50
77. For Women - Dior Pure Poison EDP 50ml RRP: £46.00
80. For Women - Miss Dior Cherie EDP 30ml RRP: £32.00
81. For Women - DKNY Be Delicious EDP 50ml RRP: £35.00
84. Unisex - Calvin Klein CK One EDT 100ml RRP: £31.00
85. For Men - Kenzo Air Pour Homme Kenzo EDT 90ml RRP: £33.69
93. For Men - Chrome by Azzaro 100ml EDT RRP: £21.69
96. For Women - Givenchy Amarige EDT 30ml RRP: £29.00
97. For Women - Gucci Rush 2 EDT 50ml RRP: £37.00
98. For Women - Mexx Women Mexx EDP 30ml RRP: £37.00
100. For Men - Jil Sander for Men 75ml EDT RRP: £28.50
101. For Women - Armani Code G. Armani EDP 30ml RRP: £29.00
102. For Women - Cool Water Game Davidoff EDT 50ml RRP: £26.00
103. For Women - Red Delicious DKNY EDP 30ml RRP: £27.00
104. For Women - Sun Delight Jill sander EDT 30ml RRP: £19.99
105. For Women - Envy Me 2 Gucci EDT 50ml RRP: £40.00
106. For Men - Always for him. Aramis EDT 50ml RRP: £29.00
107 For Men - Cool Water Game. Davidoff EDT 50ml RRP: £26.00
108. For Women - Cat Deluxe. Naomi Campbell EDT  RRP: £19.00
109. For Women - Belong Celine Dion EDT 50ml RRP: £9.99
110. For Men - La Male J.P Gautier EDT 100ml RRP: £37.95
111. For Men - Z Zegna - Zegna EDT 50ml RRP: £22.48
112. For Men - Essenza di Zegna - Zegna EDT 100ml RRP: £34.50
113. For Men - Pure Man - Bruno Banani EDT RRP: £19.99
121. For Women - Britney Spears - Curious EDP 30ml RRP: £20.00
122. For Women - Lacoste Inspiration EDP 75ml RRP: £39.00
123. For Women - Hugo Boss Femme EDP 30ml RRP: £21.00
124. For Women - Guerlain Insolence EDT 30ml RRP: £26.00
125. For Women - Nina Ricci Nina EDT 80ml RRP: £37.50
126. For Women - G. Armani Emporio Remix EDT 30ml RRP: £24.00
127. For Women - J.Lo Glow After Dark EDT 30ml RRP: £21.00
128. For Women - Cacharel Noa Perle EDP 50ml RRP: £33.99
129. For Women - Escada - Into The Blue EDP 50ml RRP: £30.50
130. For Women - Aramis Always For Her EDT 30ml RRP: £19.00
131. For Women - Clinique Happy Perfume Spray 30ml RRP: £19.99
132. For Women - Versace Crystal Noir EDP 50ml RRP: £34.50
133. For Men - Moschino Friends Man EDT 75ml RRP: £29.00
134. For Men - G. Armani Acq

Re: Batch import using a lot of memory

2007-08-18 Thread Berry

I have read this warning a thousand times by now! And I still made
this mistake! I am running this batch script on my development machine
where DEBUG is set to True!

I set DEBUG to False and memory is just fine now! Program is running
smoothly.

Thanks very much. I will never make this mistake again! ;-)

Berry

On Aug 18, 10:46 pm, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote:
> On 8/18/07, Berry <[EMAIL PROTECTED]> wrote:
>
> > Why is this program eating memory?
>
> If settings.DEBUG = True, django.db.connection.queries logs all
> queries sent to the DB.
>
> Either turn off debug, or truncate that list occasionally, maybe once
> for each outer loop.
>
> from django.db import connection
> connection.queries = []


--~--~-~--~~~---~--~~
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: Batch import using a lot of memory

2007-08-18 Thread Jeremy Dunck

On 8/18/07, Berry <[EMAIL PROTECTED]> wrote:
> Why is this program eating memory?

If settings.DEBUG = True, django.db.connection.queries logs all
queries sent to the DB.

Either turn off debug, or truncate that list occasionally, maybe once
for each outer loop.

from django.db import connection
connection.queries = []

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



Batch import using a lot of memory

2007-08-18 Thread Berry

I have this rather simple batch import program. Problem is that it
keeps eating memory. I am processing a 30+ Mb file. To be able to
handle it I spit it in files of 10.000 lines. With each new file it is
processing the import is getting slower and slower.

When it has processed about 50 files my computer with 1Gb starts
swapping memory and the program virtually grinds to a halt.

Why is this program eating memory?

Thanks very much for you help.

Berry

---
import os, os.path
import glob
import re
import csv
import datetime

os.environ['DJANGO_SETTINGS_MODULE'] = 'MyDjango.settings'
from MyDjango.apps.address.models import Address

CSVDIRECTORY = '/home/berry/temp/csvtemp/'

DELETEPROCESSEDFILES = True

# a list of column numbers, use column names in the rest of the
program
C_STREETNAME = 0
C_POSTCODE = 1
C_PLACE = 2

if CSVDIRECTORY.find('.csv') != -1:
path = CSVDIRECTORY
else:
path = os.path.join(CSVDIRECTORY, '*')

for f in glob.glob(path):
print 'Working on file: %s' % f
count = 0
print 'Number of items processed:'
file = open(f,"rb")
reader = csv.reader(file,  delimiter='\t', quoting=csv.QUOTE_NONE)
while True:
try:
row = reader.next()
if row[0].find('Straat') == -1 or row[0].find('street') 
== -1:
a = Address.objects.create(
streetname_housenumber = 
row[C_STREETNAME],
postcode = row[C_POSTCODE],
placename = row[C_PLACE],
countrycode = 'NL',
)
a = None
count += 1
s = '%s%s' % (count, '\b' * (len(str(count)) +1))
print s,
except StopIteration:
break
file.close()
if DELETEPROCESSEDFILES:
os.remove(f)


--~--~-~--~~~---~--~~
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: What's the best approach to allow users to upload data to a Django Web site?

2007-08-18 Thread Jeremy Dunck

On 8/18/07, Divan Roulant <[EMAIL PROTECTED]> wrote:
> However, I'm stuck with that question:
> once a user is logged in to my site, should I link her to the Django
> admin site (with restricted permissions) or should I implement myself,
> for my site, the views and templates to allow that user to upload
> data?

The admin is a fairly rough UI, but quite good for something that's
automatically supplied by the framework.

However, the admin should only be used by people you fully trust with
all of your data.

If you want general, untrusted, users to be able to manipulate data,
you'll want to create your own views and forms.

--~--~-~--~~~---~--~~
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: adodbapi with mssql 2000

2007-08-18 Thread Michal PL



On Aug 18, 3:26 am, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On 8/17/07, Michal PL <[EMAIL PROTECTED]> wrote:
>
>
>
> > I'm new here so let me say hello and sorry for my English to
> > everybody.
>
> > I got a problem with MS SQL 2000 and (probably) adodbapi library. When
> > django tries to get session information from django_session table it
> > asks for records with the where clause: expire_date > %s (in my case
> > %s is '2007-08-17 16:27:47.82').
>
> Hi Michal,
>
> Unfortunately, the MSSQL backends for Django are not in a very good
> state at the moment. There are a number of problems with this database
> backend.
>
> There is an effort underway by one contributor to improve this
> situation; his progress can be found here:
>
> http://code.djangoproject.com/ticket/5062
>
> Yours,
> Russ Magee %-)

Hi Russ
I'll try the library You suggested.

Thanks Russ

Michal


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



Repair Operating System - manual

2007-08-18 Thread Porsche Fan
Step-by-step manual for repairing Microsoft Operating System
http://windowsxpsp2pro.blogspot.com/

--~--~-~--~~~---~--~~
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: Best practice for non-root base URL setup?

2007-08-18 Thread Przemyslaw Wegrzyn

John Shaffer wrote:

>On 8/18/07, Przemyslaw Wegrzyn <[EMAIL PROTECTED]> wrote:
>  
>
>>However Django 0.96 doesn't support named URL patters yet, so I can't
>>use {% url %} tag.
>>
>>
>
>Even in 0.96, you can use a view as the argument to the url tag. Where
>we use "{% url satchmo_cart %}", in 0.96 we would have to use "{% url
>satchmo.shop.views.cart.display %}".
>  
>
Hmm, right, I incorrectly assumed that url tag is not in 0.96,
overlooked a part of docs. Thanks for that hint!

BR,
Przemyslaw


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



What's the best approach to allow users to upload data to a Django Web site?

2007-08-18 Thread Divan Roulant

Hello,

I've implemented my models and my site works fine. A user can create
an account and log in. Now it's time for me to allow a user to upload
data, once logged in. However, I'm stuck with that question:
once a user is logged in to my site, should I link her to the Django
admin site (with restricted permissions) or should I implement myself,
for my site, the views and templates to allow that user to upload
data?

I'm afraid to choose the first option in case it is not the proper way
to do it and afraid to choose the second just to discover later that
Django has already all I need... using the admin! Any advice?

Thanks!

Divan


--~--~-~--~~~---~--~~
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 Django to generate Flash/Flex content

2007-08-18 Thread SamFeltus

FWIW

There is a greatly improved version up...

It's a pre alpha version of a website to create/edit Flash movies...

http://samfeltus.com/django/SonomaSunshine_v0.13_raw_for_django.tar.gz

I'd be happy to spend some time on explaining/improving it if anyone
ever found it interesting.


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



Djapian API

2007-08-18 Thread Rafael \"SDM\" Sierra

Hi all, I wrote a module 3th-part to Django: http://code.google.com/p/djapian/

It's a simple interface between Django and Xapian (a search engine),
it's just a fork of search-api (I think it's too slow, and I know that
there is another priority)

-- 
Rafael "SDM" Sierra
http://stiod.com.br/

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



Repairing Tips for Windows XP

2007-08-18 Thread Porsche Fan
Repairing Tips for Windows XP, Improve your System speed !!!
http://windowsxpsp2pro.blogspot.com/

--~--~-~--~~~---~--~~
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: Best practice for non-root base URL setup?

2007-08-18 Thread John Shaffer

On 8/18/07, Przemyslaw Wegrzyn <[EMAIL PROTECTED]> wrote:
> However Django 0.96 doesn't support named URL patters yet, so I can't
> use {% url %} tag.

Even in 0.96, you can use a view as the argument to the url tag. Where
we use "{% url satchmo_cart %}", in 0.96 we would have to use "{% url
satchmo.shop.views.cart.display %}".

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



What's possible in the admin?

2007-08-18 Thread Rob Hudson

I have a list of things I'd like to do in the admin for a new client
but I'm not sure if all of these are possible.  I'm hoping those more
familiar with admin tweaking could provide a Yes/No for these?  I've
heard something about how the new admin branch allows for multiple
admins, so possibly one admin is the standard data management admin,
and one admin is various links to jump off into the other bits listed
below?

1) Add a duplicate this record button to start a new 'Add [model]'
page but pre filled in with data from an existing record.

2) Add some light reporting views.  I imagine these would be just like
a public view but limited and linked to from the admin somehow -- so
I'd need admin authentication and a link in the admin?

3) If I can do #2, that opens up a lot of things for the other items on my list.

4) When adding a new record to a model, hook in an AJAX call to check
if the item already exists in the table and indicate if it does.
(There's a single column that is the key for this.)

5) And advanced search for their main model.  This is posible via #2
but it would be interesting if this could be abstracted a bit and be
re-used.  I'm kind of thinking of a way to specify which fields should
be included in the advanced search and automatically generate a form
and process the form submit to search those fields?  Not looking at
full-text search at all, but simple things like `title` contains
'django', `bestseller` is true, `binding` is 'Hard Cover', things like
that.

6) From the admin create a 3-step wizard to build, generate, and send
a newsletter.  Probably another item that depends on #2.


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



unique_together and composite columns indexing

2007-08-18 Thread Peter Melvyn

Hi all,

if I'm not mistaken, if I have a model with unique constraint
'unique_together', Django does not support composite index of related
columns, i.e.

class AModel (models.Model):
col_a = models.CharField(maxlength=20, db_index=True)
col_b = models.CharField(maxlength=20, db_index=True)
class Meta:
unique_together = (('col_a','col_b'),)

generates SQL commands:

CREATE TABLE `xxx_amodel` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`col_a` varchar(20) NOT NULL,
`col_b` varchar(20) NOT NULL,
UNIQUE (`col_a`, `col_b`)
);
CREATE INDEX `xxx_amodel_col_a` ON `wss_amodel` (`col_a`);
CREATE INDEX `xxx_amodel_col_b` ON `wss_amodel` (`col_b`);


Should not be there another meta command, e.g.

indexed_together = (('col_a','col_b'),)

producing index

CREATE INDEX `xxx_amodel_col_a_col_b`
   ON `wss_amodel` (`col_a`,`col_b`);


Peter

--~--~-~--~~~---~--~~
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: unbit.it hosting

2007-08-18 Thread Marco A.
I was a refresh problem coused by the use of fastcgi

I was use the wrong setting.py.. I restarted the server and it work great !

Thanks

2007/8/18, Chris Hoeppner <[EMAIL PROTECTED]>:
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> > File
> > "/usr/lib/python2.4/site-packages/django/db/backends/mysql/base.py",
> > line 97, in cursor
> >kwargs['port'] = int(settings.DATABASE_PORT)
> >
> > ValueError: invalid literal for int(): marco_db1
>
> What's your value for DATABASE_PORT?
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFGxr1/SyMaQ2t7ZwcRAkl3AJ0TEEvPFh7KLz/r4s25fNlPnuKF7ACfcZVy
> tsO8BoSy/sKVSSuiln0rrKE=
> =vtYh
> -END PGP SIGNATURE-
>
> >
>
>

--~--~-~--~~~---~--~~
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 create model with dual primary key in Django?

2007-08-18 Thread Peter Melvyn

On 8/18/07, richard <[EMAIL PROTECTED]> wrote:

> I'm working on a database-backed Web site which requires a few tables
> to use dual primary keys (two columns acted together as primary key;
> each of them is not unique in itself). How to do that properly?

> (I'm aware of 'unique_together', however that is not really meant for
> primary key creation, is it?)

This week it has been discussed here, please see
http://mail.google.com/mail/?shva=1&auth=DQAAAHEPDKjV_WZWyHG_nzwkmFPLgM4zBGeSs_lhf3rWQU9cQMc0kxcg880oaJfAoy3EuZZr_IG5XkcL_Kp48bEWlhNKQCC-p13QrDmrxbIiqzWY7ZhefLIUnAsH86RunSYSmyd434x7-5YSg2_IIapaGRgCMml6xOe411WDaBBJ3862zg

###

You could use artificial primary key and form a composite key using
unique_together constraint. It could work properly, if Django would
create a composite ordinary index, but it unfortunatelly does not.

OTOH, if syncdb utility leaves existing tables untouched, you could
add such composite index manually on SQL level.

--~--~-~--~~~---~--~~
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: Django-tagging, is it possible to add a TagField to a UserProfile?

2007-08-18 Thread David Larlet

2007/8/18, David Larlet <[EMAIL PROTECTED]>:
> Hi,
>
> I try to add a TagField to a UserProfile and it doesn't seemed to work
> (it didn't find obj._get_pk_val() when I save the profile), did
> someone had already done that?
>
> Regards,
> David
>
Hum, forget about that, I just forget to add the tagging app to my app
list. Sorry for the noise...

David

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



Django-tagging, is it possible to add a TagField to a UserProfile?

2007-08-18 Thread David Larlet

Hi,

I try to add a TagField to a UserProfile and it doesn't seemed to work
(it didn't find obj._get_pk_val() when I save the profile), did
someone had already done that?

Regards,
David

--~--~-~--~~~---~--~~
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: Best practice for non-root base URL setup?

2007-08-18 Thread Przemyslaw Wegrzyn

Chris Moffitt wrote:

> We've developed a similar sort of capability for Satchmo.  You can
> browse the source here-
> http://www.satchmoproject.com/trac/browser/satchmo/trunk/satchmo
> 

Seems I've done more or less the same in my urls.py.

However Django 0.96 doesn't support named URL patters yet, so I can't
use {% url %} tag.
I don't want to use any pre-release code yet. Seems I have no other
choice that manually include the prefix in all my templates.

When is 0.97 release about to happen?

BR,
Przemyslaw


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



Software Problem Solving

2007-08-18 Thread John Travolta
Software problem solving
http://windowsxpsp2pro.blogspot.com/

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



How to create model with dual primary key in Django?

2007-08-18 Thread richard

I'm working on a database-backed Web site which requires a few tables
to use dual primary keys (two columns acted together as primary key;
each of them is not unique in itself). How to do that properly?

(I'm aware of 'unique_together', however that is not really meant for
primary key creation, is it?)

Thanks a bunch in advance,
rich


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



How to create model with dual primary key in Django?

2007-08-18 Thread richard

I'm working on a database-backed Web site which requires a few tables
to use dual primary keys (two columns acted together as primary key;
each of them is not unique in itself). How to do that properly?

(I'm aware of 'unique_together', however that is not really meant for
primary key creation, is it?)

Thanks a bunch in advance,
rich


--~--~-~--~~~---~--~~
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: Database cached?

2007-08-18 Thread SjoerdOptLand

Hello all,

Thanks a lot for your suggestions. As they say: "The solution is
always simple", it is this line of code:

from django.db import connection
connection.connection = None

this closes the connection and forces Django to make a new one. Only
throwing away the _result_cache of a queryset wasn't enough,
unfortunately.

Thanks again,
Sjoerd Op 't Land


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



In-line Comments

2007-08-18 Thread [EMAIL PROTECTED]

Hi,

we're currently translating this book: www.producingoss.com
and I'm trying to find an in-line comment system similar to the one
used by the djangobook of the fsf for their licences. I read somewhere
that the code for that was in an unreleaseable state, but somewhere
else that they would be releasing it.
So the question is, if anybody is aware of an in-line comment system
we could use or build upon, otherwise I guess I'll try and do
something myself.

Good book btw. and well worth reading and you are of course more than
welcome to participate in the translation.

ciao
Manuel


--~--~-~--~~~---~--~~
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: unbit.it hosting

2007-08-18 Thread Chris Hoeppner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

> File
> "/usr/lib/python2.4/site-packages/django/db/backends/mysql/base.py",
> line 97, in cursor
>kwargs['port'] = int(settings.DATABASE_PORT)
> 
> ValueError: invalid literal for int(): marco_db1

What's your value for DATABASE_PORT?
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGxr1/SyMaQ2t7ZwcRAkl3AJ0TEEvPFh7KLz/r4s25fNlPnuKF7ACfcZVy
tsO8BoSy/sKVSSuiln0rrKE=
=vtYh
-END PGP SIGNATURE-

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

begin:vcard
fn:Christian Hoeppner
n:Hoeppner;Christian
email;internet:[EMAIL PROTECTED]
note:I am a freelance coder specialized in web applications and their deployment at a small or medium scale.
x-mozilla-html:FALSE
version:2.1
end:vcard



Re: accessing id attribute of a ForeignKey without additional DB queries

2007-08-18 Thread kahless

On Aug 16, 1:42 am, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> This behaviour is valid, and will remain so. Django uses this feature
> internally in many places, especially in the serializers.

thanks, good to know :)

> Any suggestions on how to improve the documentation of this issue are welcome.

i would have expected it somewhere in the db-api documentation (http://
www.djangoproject.com/documentation/db-api/) similar to the "Extra
instance methods" for files ..
like 'Extra instance attributes': FOO_id for ForeignKey attributes..

cu,
  herbert


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



TinyMCE problem

2007-08-18 Thread Rufman

i tried installing tinymce with django, but i seem to have a problem
with  the js import. i tried to google of another tutorial...but alas
nothing  seemed to work. in your tutorial
 (http://code.djangoproject.com/wiki/AddWYSIWYGEditor) there are paths
that  i do not have, idk if i'm looking in the wrong direction...i am
sort of  new to django. This is the error i get:


 Template error

 In template c:\python25\lib\site-
 packages\django\contrib\admin\templates\admin\change_form.html, error
at  line 5  Caught an exception while rendering: expected string or
buffer
 1   {% extends "admin/base_site.html" %}
 2   {% load i18n admin_modify adminmedia %}
 3   {% block extrahead %}{{ block.super }}
 4   
 5   {% for js in javascript_imports %}{% include_admin_script js
%}{%
 endfor %}
 6   {% endblock %}
 7   {% block stylesheet %}{% admin_media_prefix %}css/forms.css{%
 endblock %}
 8   {% block coltype %}{% if ordered_objects %}colMS{% else
%}colM{%
 endif %}{% endblock %}
 9   {% block bodyclass %}{{ opts.app_label }}-{{
 opts.object_name.lower }} change-form{% endblock %}
 10  {% block userlinks %}{% trans
 'Documentation' %} / {%
trans  'Change password' %} / {% trans
'Log out'
 %}{% endblock %}
 11  {% block breadcrumbs %}{% if not is_popup %}
 12  
 13  {% trans "Home" %} ›
 14  {{ opts.verbose_name_plural|capfirst|escape }}
 ›
 15  {% if add %}{% trans "Add" %} {{ opts.verbose_name|escape }}
{%
 else %}{{ original|truncatewords:"18"|escape }}{% endif %}  Traceback
(innermost last)  Switch to copy-and-paste view

 * c:\Python25\lib\site-packages\django\template\__init__.py in
render_node
747.
748. def render_node(self, node, context):
749. return node.render(context)
750.
751. class DebugNodeList(NodeList):
752. def render_node(self, node, context):
753. try:
754. result = node.render(context) ...
755. except TemplateSyntaxError, e:
756. if not hasattr(e, 'source'):
757. e.source = node.source
758. raise
759. except Exception, e:
760. from sys import exc_info
   ▶ Local vars
   Variable  Value
   context
   [{'forloop': {'parentloop': {}, 'last': True, 'counter': 5,
 'revcounter0': 0, 'revcounter': 1, 'counter0': 4, 'first': False},
u'js':
 ('/tiny_mce/tiny_mce.js', '/media/js/admin/textareas.js')}, {'block':
 ,
, ,  ]
   wrapped
   TemplateSyntaxError('Caught an exception while rendering:
expected  string or buffer',)
 * c:\Python25\lib\site-packages\django\template\defaulttags.py
in  render
127. }
128. if unpack:
129. # If there are multiple loop variables, unpack the item
into  them.
130. context.update(dict(zip(self.loopvars, item)))
131. else:
132. context[self.loopvars[0]] = item
133. for node in self.nodelist_loop:
134. nodelist.append(node.render(context)) ...
135. if unpack:
136. # The loop variables were pushed on to the context so pop
them
137. # off again. This is necessary because the tag lets the
length
138. # of loopvars differ to the length of each set of items
and we
139. # don't want to leave any vars from the previous loop on
the
140. # context.
   ▶ Local vars
   Variable  Value
   context
   [{'forloop': {'parentloop': {}, 'last': True, 'counter': 5,
 'revcounter0': 0, 'revcounter': 1, 'counter0': 4, 'first': False},
u'js':
 ('/tiny_mce/tiny_mce.js', '/media/js/admin/textareas.js')}, {'block':
 ,
', u'', u'',
u'']
   parentloop
   {}
   self
   
   unpack
   False
   values
   ['js/core.js', 'js/admin/RelatedObjectLookups.js', 'js/
calendar.js',  'js/admin/DateTimeShortcuts.js', ('/tiny_mce/
tiny_mce.js',  '/media/js/admin/textareas.js')]
 * c:\Python25\lib\site-packages\django\template\__init__.py in
render
865.
866. class SimpleNode(Node):
867. def __init__(self, vars_to_resolve):
868. self.vars_to_resolve = vars_to_resolve
869.
870. def render(self, context):
871. resolved_vars = [resolve_variable(var, context) for var
in  self.vars_to_resolve]
872. return func(*resolved_vars) ...
873.
874. compile_func = curry(generic_tag_compiler, params,
defaults,  getattr(func, "_decorated_function", func).__name__,
SimpleNode)
875. compile_func.__doc__ = func.__doc__
876. self.tag(getattr(func, "_decorated_function",
func).__name__,
 compile_func)
877. return func
  878.
   ▶ Local vars
   Variable  Value
   context
   [{'forloop': {'parentloop': {}, 'last': True, 'counter': 5,
 'revcounter0': 0, 'revcounter': 1, 'counter0': 4, 'first': False},
u'js':
 ('/tiny_mce/tiny_mce.js', '/media/js/admin/textareas.js')}, {'block':
 ,

 32. """
 33. if not absolute_url_re.match(script_path): ...
 34. 

Re: syncdb error

2007-08-18 Thread James Bennett

On 8/18/07, Pawel Pilitowski <[EMAIL PROTECTED]> wrote:
> I just updated to the latest django version (5925) and ran syncdb and
> get the following error.
>
> Any suggestions?

If you're tracking SVN, it's an *extremely* good idea to also watch
the development timeline[1] and read the django-developers mailing
list[2]; the problem has already been noted[3] and -- in revision
5929[4] -- rolled back out to be worked on a bit more.

And when I say "it's an extremely good idea", I really mean "if you're
tracking SVN, you need to be doing these things" ;)

[1] http://code.djangoproject.com/timeline
[2] http://groups.google.com/group/django-developers
[3] 
http://groups.google.com/group/django-developers/browse_frm/thread/6209dac46b13d9cd
[4] http://code.djangoproject.com/changeset/5929

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