Re: reservation & booking system

2009-09-29 Thread Andrew McGregor
> I'm looking for some modules to realize a reservation and booking > system, preferably with a nice calendar interface. I did some research > today, but didn't found what I was looking for... maybe because I'm new > to Django, maybe because I'm blind, or maybe because there is nothing of > any us

Re: QuerySet hang

2009-09-29 Thread Waqas
Thanks for ur reply Micheal. It is hanging exactly on following line: rs = InqueuePing.objects.filter(processed = 0).order_by('-timestamp') If I remove order_by function then it works fine. I think this is not django issue. I debug the code using pdb and found that the code is hanging from MySQ

Re: reservation & booking system

2009-09-29 Thread Juan Hernandez
That is such a wide area of development On 9/29/09, Eesti Mate wrote: > > Hello List, > > I'm looking for some modules to realize a reservation and booking > system, preferably with a nice calendar interface. I did some research > today, but didn't found what I was looking for... maybe because I

Re: Running Django on Tornado's HTTP server

2009-09-29 Thread Kenneth Gonsalves
On Tuesday 29 Sep 2009 2:44:26 pm Ramdas S wrote: > > > cool - this worked out of the box - but no css and js - can I serve > > > media from tornado, and if so, a pointer as to how? > > > > solved - managed to run several django sites of an nginx instance using > > virtual hosts and individual tor

Re: Running Django on Tornado's HTTP server

2009-09-29 Thread Kenneth Gonsalves
On Tuesday 29 Sep 2009 8:07:55 pm Javier Guerra wrote: > On Tue, Sep 29, 2009 at 4:24 AM, Kenneth Gonsalves > > wrote: > > will document after trying it in production - a zillion times faster > > faster than. ? flup? faster than apache/mod_wsgi -- regards kg http://lawgon.livejournal.c

Re: What JavaScript framework do you use and why?

2009-09-29 Thread Mike Dewhirst
I have heard nice things about Mochikit. I had a look at it a long time ago and fully intended to get involved but haven't had the opportunity yet ... http://www.mochikit.com/about.html esatterwh...@wi.rr.com wrote: > I use mootools a lot. When I was deciding which on to use, I first > looke

Re: create a method that only one user can access in the same time

2009-09-29 Thread Nan
Any particular reason you can't just use User.objects.count() ? On Sep 29, 7:16 pm, gustavo Cardoso wrote: > Hello Folks, > > I need to implement a Counter. > One variable to store the number of users in my site. > This variable can't be access in the same time for more than one user. > How I do

reservation & booking system

2009-09-29 Thread Eesti Mate
Hello List, I'm looking for some modules to realize a reservation and booking system, preferably with a nice calendar interface. I did some research today, but didn't found what I was looking for... maybe because I'm new to Django, maybe because I'm blind, or maybe because there is nothing of any

create a method that only one user can access in the same time

2009-09-29 Thread gustavo Cardoso
Hello Folks, I need to implement a Counter. One variable to store the number of users in my site. This variable can't be access in the same time for more than one user. How I do this in django. How I create a method that only one user can access in the same time? Is there some API to lock and rele

many to many add by ids

2009-09-29 Thread rich.al...@gmail.com
I have the following I'm trying to optimize. Input (from the web) is sids = "1,2,3,5" (a list of ids is posted, say they are article ids) Now, to add them to a many to many, I'd like to just try: authors.articles.add(ids). except: I know the ids need to be ints, but tried a number of things

Re: FF3 src error in django admin calendar

2009-09-29 Thread Ron W
I've been getting thrown 500 errors from someone using the admin from what looks like Mac Firefox 3.5 with the Huffington Post's Firefox extension (why on earth..), but its looking for /img/admin/ icon_calendar.gif/ which isn't from TinyMCE its the Django admin date picker icon. Its really odd I c

Re: accessing dict values in a template

2009-09-29 Thread gontran
that's right! thank you! I don't know how I missed that information in the doc... On 29 sep, 23:51, Javier Guerra wrote: > sorry, the right syntax is > >  {% for key, element in toto.items %} >     Name: {{ element.name }} - Desc: {{ element.desc }} >  {% endfor %} > > (as documented > inhttp:/

Re: Menu managements, current URL

2009-09-29 Thread Peter Sagerson
Is request.path[1] what you want? You might also consider basing your menu context on the current view rather than the current URL. I typically define a view decorator that can attach any context information I need to the current request: def page_context(section): def decorator(func):

Re: accessing dict values in a template

2009-09-29 Thread Javier Guerra
sorry, the right syntax is {% for key, element in toto.items %}    Name: {{ element.name }} - Desc: {{ element.desc }} {% endfor %} (as documented in http://docs.djangoproject.com/en/dev/ref/templates/builtins/#for ) -- Javier --~--~-~--~~~---~--~~ You recei

Re: Subclassing a model to change field attributes?

2009-09-29 Thread Nan
You're right, it could be done in form validation. I'm not sure why I feel compelled to validate everything at the model (or DB) level. On Sep 29, 3:28 pm, Daniel Roseman wrote: > On Sep 29, 6:53 pm, ringemup wrote: > > > I have two models that are essentially identical except that for one > >

Menu managements, current URL

2009-09-29 Thread Maksymus007
I'm looking for simple way of managing menu - so my question is - how i can get currently used URL? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us

Re: accessing dict values in a template

2009-09-29 Thread gontran
It doesn't change anything On 29 sep, 21:39, Javier Guerra wrote: > On Tue, Sep 29, 2009 at 2:35 PM, gontran wrote: > > In my template, I want to access to the name and to the desc of each > > key of toto: > > {% for element in toto %} > >    Name: {{ element.name }} - Desc: {{ element.desc }}

Re: Exiting view to continue urls.py

2009-09-29 Thread sunn
Wonderful. Thanks! On Sep 29, 8:26 pm, Daniel Roseman wrote: > On Sep 29, 2:04 pm, sunn wrote: > > > > > Dear Django users, > > > I am trying to create a simple redirect app (useful when rewriting a > > page that was previously not written in Django or when switching > > domains). > > > The app

Re: regex query delivering incorrect results

2009-09-29 Thread janedenone
Hi Karen, On 28 Sep., 22:49, Karen Tracey wrote: > On Mon, Sep 28, 2009 at 4:00 PM, janedenone wrote: > > > Hi, > > > this > > > pages = Page.objects.exclude(content__iregex=r'^[\n\r \t]*<') > > > should deliver the same rows as this > > > SELECT ... FROM pages WHERE (content NOT REGEXP '^[\n\r

Re: accessing dict values in a template

2009-09-29 Thread Javier Guerra
On Tue, Sep 29, 2009 at 2:35 PM, gontran wrote: > In my template, I want to access to the name and to the desc of each > key of toto: > {% for element in toto %} >    Name: {{ element.name }} - Desc: {{ element.desc }} > {% endfor %} try: {% for key, element in toto %} Name: {{ element.name

accessing dict values in a template

2009-09-29 Thread gontran
Hello, here is my problem: I have a dictionary which keys are unknown and which values are dictionaries. (I don't know the keys because they are dynamically created by a loop) For example: toto = {} toto['123'] = {} toto['123']['name'] = 'name of 123' toto['123']['desc'] = 'desc of 123' toto['45

Re: Subclassing a model to change field attributes?

2009-09-29 Thread Daniel Roseman
On Sep 29, 6:53 pm, ringemup wrote: > I have two models that are essentially identical except that for one > of them a couple of the fields can be blank/null that are required in > the other.  It seems silly to maintain two full implementations in > parallel, so I'd like to just make one model a

October's Django-NYC Meeting

2009-09-29 Thread Sean
Hey folks, Join us on October 13th for an exciting django-nyc. This month's talks will be by Hani, on how he developed the API for http://indexedbygoogle.com/ , and I'll be giving a recap of what came out of DjangoCon 2009. The meeting will be held at the HUGE offices at 45 Main Street, Suite 22

Subclassing a model to change field attributes?

2009-09-29 Thread ringemup
I have two models that are essentially identical except that for one of them a couple of the fields can be blank/null that are required in the other. It seems silly to maintain two full implementations in parallel, so I'd like to just make one model a subclass of the other. I've looked through th

Re: Exiting view to continue urls.py

2009-09-29 Thread Daniel Roseman
On Sep 29, 2:04 pm, sunn wrote: > Dear Django users, > > I am trying to create a simple redirect app (useful when rewriting a > page that was previously not written in Django or when switching > domains). > > The app would just collect all URLs not found so I put it at the end > of urls.py > > (r

Re: multi-db vs. data warehouse

2009-09-29 Thread Tony Schmidt
Thanks for everyone's feedback. I think it's time to just give it a whirl and see what happens. @Joshua: "With my personal experience I would go with an ETL and copy the desired data directly into your ordering system." I think that's the approach I'm going to take. @David: Thanks for the li

Re: Can I allow html tags in admin interface input?

2009-09-29 Thread bentford
Thanks. I didn't think to check in the template documentation. Duh. Appreciate it!! -Ben --~--~-~--~~~---~--~~ 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@goog

Re: Indian Language in Tinymce OperationalError

2009-09-29 Thread Rizwan
Thanks dear it works !! I had to recreate all database tables and restart my django server. Thanks agian Karen.. you rock :) Regards, On Sep 29, 5:22 pm, Karen Tracey wrote: > On Tue, Sep 29, 2009 at 12:05 PM, Rizwan wrote: > > > Thanks for reply, I was suspecting this and I did change my dat

Re: Can I allow html tags in admin interface input?

2009-09-29 Thread EricR86
Yes, absolutely. Use the builtin template filter: http://docs.djangoproject.com/en/dev/ref/templates/builtins/#safe All output by default from Django is auto escaped to avoid possibly malicious html/javascript injection. An example would be by starting a comment with a , and not closing the tag.

Re: Indian Language in Tinymce OperationalError

2009-09-29 Thread Karen Tracey
On Tue, Sep 29, 2009 at 12:05 PM, Rizwan wrote: > > Thanks for reply, I was suspecting this and I did change my database > charset to UTF-8. but still it giving me same error. > > What did you do exactly? ALTER DATABASE db_name CHARACTER SET UTF8? If so, that won't change existing tables, they'

Re: Something happened, can't log in

2009-09-29 Thread Oli Warner
Bangs his head against the wall. Yes. Yes, I did. I thought I'd rolled back past that but looks like I hadn't. How annoying.. I can even see what it's doing and why it's not working (doesn't exactly explain why using memcache as a backend works, but hey, I'm happy if it builds :) Thanks for notic

Which compressor / packer for CSS and JS?

2009-09-29 Thread Rodrigo Cea
What is your experience or advice on using a compressor or asset packager in Django? For JS, CSS and (maybe) image sprites? I have a site going into production tomorrow. It is recieving an "E" grade in YSlow's "make fewer requests", as it has a lot of CSS and JS files (about 10 of each). It also

Dynamically Add, Delete, Edit Row in a Table

2009-09-29 Thread Good Z
Dear All, I need to write an application(HTML/JS/Django) where i can insert, edit and delete a row in html table. As soon as we add a new row the previous row is saved in database and is not editable unless we edit it. I want to do it in two steps 1) Add/Delete Row dynamically. Ever add saves

Ordering by sum of fields?

2009-09-29 Thread EricR86
Hello, I've been looking into trying to order a relation based on some arithmetic on each model's fields. This would ideally be at a database level, and not a brute force python way. A simple example which I can't seem to get to work is a sum of two fields. For example, I want to sum a total amo

Can I allow html tags in admin interface input?

2009-09-29 Thread bentford
Hello, Is it possible to allow HTML to be entered in the admin interface? I do not want it to be encoded with < > etc.. I've looked in the documentation and searched on google, no answer found. Thanks, Ben --~--~-~--~~~---~--~~ You received this message because

Re: Indian Language in Tinymce OperationalError

2009-09-29 Thread Rizwan
Thanks for reply, I was suspecting this and I did change my database charset to UTF-8. but still it giving me same error. Reagarding to database or server default charset, is there any setting i need to specify in setting file or any where else? Regards, On Sep 29, 2:51 pm, Karen Tracey wrote:

syndication feed framework - how to reverse the urls?

2009-09-29 Thread anentropic
I've been setting up feeds using the syndication feed framework. I have a line like this in my urls.py: (r'^feeds/(?P.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}), How do I avoid hard-coding the feed urls into my template? I want to {% url django.contrib.syndicati

Re: Something happened, can't log in

2009-09-29 Thread Karen Tracey
On Tue, Sep 29, 2009 at 11:30 AM, Oli Warner wrote: > As this clearly had something to do with the session, I just changed the > SESSION_ENGINE to file. Different error, but for the same reason, I think: > > Traceback (most recent call last): > > [snip]session_file = open(self._key_to_file(),

Re: Something happened, can't log in

2009-09-29 Thread Oli Warner
Hr. Just changed the SESSION_ENGINE to .cache (using memcache) and it works. No idea what's different about the way it handles session ids that differs from the others... I should add that I'm on Ubuntu Karmic (in development) so it's possible that I've got a newer version of something or oth

Re: Something happened, can't log in

2009-09-29 Thread Oli Warner
As this clearly had something to do with the session, I just changed the SESSION_ENGINE to file. Different error, but for the same reason, I think: Traceback (most recent call last): File "/usr/lib/pymodules/python2.6/django/core/servers/basehttp.py", line 279, in run self.result = applica

Re: strange behaviour of custom view based on date_based.object_detail - random 404

2009-09-29 Thread Bartek
Bartek SQ9MEV pisze: [...] > Enviroment: > python-2.6.1 > python-apache-2.2.11 > psycopg2-2.0.11 > apache-mod_wsgi-2.5 > glibc-2.10.1 [...] Update: apache-2.2.11 mpm prefork -- B --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo

Re: Help on query

2009-09-29 Thread luismmontielg
yeah, something like that is what I want, but to me, that is not the best way of doing it ... Maybe there's a simpler way? thanks in advance On Sep 29, 8:46 am, sunn wrote: > This should hopefully work as well > user_reports = user.report_set.exclude(users__id__lt = user.id, > users_id_gt = use

Re: Running Django on Tornado's HTTP server

2009-09-29 Thread Javier Guerra
On Tue, Sep 29, 2009 at 4:24 AM, Kenneth Gonsalves wrote: > will document after trying it in production - a zillion times faster faster than. ? flup? -- Javier --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

Re: Queries returning long instead of int from MySQL

2009-09-29 Thread Karen Tracey
On Tue, Sep 29, 2009 at 8:00 AM, eradman wrote: > > I have been tasked with migrating a Django app from PostgreSQL (using > psycopg2 2.0.7) to MySQL (using mysql-python 1.2.2-05), and have > encountered a problem with custom models definitions that look like > this: > > class CustomIntegerField (

strange behaviour of custom view based on date_based.object_detail - random 404

2009-09-29 Thread Bartek SQ9MEV
I've got some strange problems in my hosting enviroment using mod_wsgi like that: WSGIDaemonProcess mygroup user=myuser group=users processes=3 threads=10 display-name=mygroup Enviroment: python-2.6.1 python-apache-2.2.11 psycopg2-2.0.11 apache-mod_wsgi-2.5 glibc-2.10.1 The problem is that ran

Re: Indian Language in Tinymce OperationalError

2009-09-29 Thread Karen Tracey
On Tue, Sep 29, 2009 at 7:45 AM, Rizwan Mansuri wrote: > Hello everyone, > > I am newbie in django. I have installed plugin in tinymce to type indian > language in textarea. While I was trying to save flat page with indian > language string its giving me error > *OperationalError at /admin/flatpag

Re: Optional trailing slash in App URLs

2009-09-29 Thread sunn
('^/?$', views.index), # in app blog urls.py On Sep 29, 1:59 am, Nuno Machado wrote: > Hello all, > > I really enjoy the default Django behaviour of handling URL trailing > slashes. If one have: > > (r'^contact', views.contact), > > It doesn't matter if someone visits mywebsite.com/contact OR >

Re: Help on query

2009-09-29 Thread sunn
This should hopefully work as well user_reports = user.report_set.exclude(users__id__lt = user.id, users_id_gt = user.id) On Sep 29, 4:32 pm, sunn wrote: > If you don't want to write SQL I think the easiest way is to combine > two querysets > > # You can combine queries with & and |.>>> s1 = >

Re: Help on query

2009-09-29 Thread sunn
If you don't want to write SQL I think the easiest way is to combine two querysets # You can combine queries with & and |. >>> s1 = Article.objects.filter(id__exact=1) >>> s2 = Article.objects.filter(id__exact=2) >>> s1 | s2 [, ] >>> s1 & s2 [] From http://www.djangoproject.com/documentation/mod

Re: Combined sort order in admin area?

2009-09-29 Thread Thomas Steinmaurer
> Hello, > > is there a way to have a combined sort order in a list in the admin > area? > > For example ascending order by one field and descending order by another > field? > > > Not at present. There is a ticket with a recent patch that proposes to > add this ability: >

Re: Combined sort order in admin area?

2009-09-29 Thread Karen Tracey
On Tue, Sep 29, 2009 at 2:18 AM, Thomas Steinmaurer wrote: > > Hello, > > is there a way to have a combined sort order in a list in the admin area? > > For example ascending order by one field and descending order by another > field? > > Not at present. There is a ticket with a recent patch that

Re: What JavaScript framework do you use and why?

2009-09-29 Thread Greg Fuller
In addition to mochaui,there's jxlib for mootools: http://jxlib.org/. On Sep 29, 3:12 am, Sid wrote: > You might wanna check out -http://mochaui.com/demo/if you're > planning to use MooTools. > Although i haven't used it yet, but it looks awesome and i haven't > found a  UI framework for jQuery

Exiting view to continue urls.py

2009-09-29 Thread sunn
Dear Django users, I am trying to create a simple redirect app (useful when rewriting a page that was previously not written in Django or when switching domains). The app would just collect all URLs not found so I put it at the end of urls.py (r'(?P.*)', 'project.app.views.redirect') Problem i

Re: Help on query

2009-09-29 Thread luismmontielg
that brings me all reports that have that user, but also the reports that have user and user2.. i want only the reports that have 1 user and id is equal to user.id On Sep 29, 4:35 am, Joshua Russo wrote: > oh ok, so just use the filter(user_id = user.id) > > On Tue, Sep 29, 2009 at 12:21 AM, lui

Queries returning long instead of int from MySQL

2009-09-29 Thread eradman
I have been tasked with migrating a Django app from PostgreSQL (using psycopg2 2.0.7) to MySQL (using mysql-python 1.2.2-05), and have encountered a problem with custom models definitions that look like this: class CustomIntegerField (models.IntegerField): def __init__ (self, verbose_name = N

Re: licensing question

2009-09-29 Thread Jonas Obrist
Russell Keith-Magee wrote: > > First off - IANAL, so the following lawyering is non-professional > opinion, and doesn't constitute legal advice, etc etc. > > My reading of this is that yes, what you are proposing would be a > violation of the license. You're forking Django to produce a new > produ

Re: What JavaScript framework do you use and why?

2009-09-29 Thread esatterwh...@wi.rr.com
I use mootools a lot. When I was deciding which on to use, I first looked at How big is the library ( how long is it going to take me to learn ), how complex, does it do what I want/need. Does it fit the way I think, does it make sense with python/django. Mootools, to me was a pretty good fit. Th

Indian Language in Tinymce OperationalError

2009-09-29 Thread Rizwan Mansuri
Hello everyone, I am newbie in django. I have installed plugin in tinymce to type indian language in textarea. While I was trying to save flat page with indian language string its giving me error *OperationalError at /admin/flatpages/flatpage/1/* " Any suggestion and help would be appericiates.

Re: licensing question

2009-09-29 Thread Russell Keith-Magee
On Tue, Sep 29, 2009 at 5:34 PM, Jonas Obrist wrote: > > Hi django-users > > I have a question about the license Django is released under (BSD). Or > to be more precise about: > >    3. Neither the name of Django nor the names of its contributors may > be used >       to endorse or promote produc

Something happened, can't log in

2009-09-29 Thread Oli Warner
I've been building a site for a couple of months, on and off. Today when I log in, everything blows up. The core part appears to come from calling request.user. That trickles through the database (I assume to get the actual user object) and detonates with a *InterfaceError: Error binding parameter

csv export through command line

2009-09-29 Thread please smile
Hi All, I need to export .CSV(example.csv) file data into my data base table . How can I do this through command line. My application blog/ __init__.py models.py management/ __init__.py commands/ __init__.py csvexport.py views.py How can

Re: Help on query

2009-09-29 Thread Joshua Russo
oh ok, so just use the filter(user_id = user.id) On Tue, Sep 29, 2009 at 12:21 AM, luismmontielg wrote: > > Actually there it is, > > users = models.ManyToManyField(User, symmetrical=True) > > but I want to filter only the reports that contain only this user, or > exclude the ones that do not hav

licensing question

2009-09-29 Thread Jonas Obrist
Hi django-users I have a question about the license Django is released under (BSD). Or to be more precise about: 3. Neither the name of Django nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior writte

Re: Running Django on Tornado's HTTP server

2009-09-29 Thread Kenneth Gonsalves
On Tuesday 29 Sep 2009 2:44:26 pm Ramdas S wrote: > can I serve media > > > > from tornado, and if so, a pointer as to how? > > > > solved - managed to run several django sites of an nginx instance using > > virtual hosts and individual tornado servers for each virtual host. > > Coolness > > Kenne

Re: Templatetags and admin issues

2009-09-29 Thread Mario
CalDan, I had the same exact problem yesterday. I googled it and found some useful links, but no definitive answer. Anyway, since the error was in the dev environment, I decided to wipe-out django and re-install it from the trunk. It actually solved my problem. Before deleting django make sure

Re: Running Django on Tornado's HTTP server

2009-09-29 Thread Ramdas S
On Tue, Sep 29, 2009 at 2:32 PM, Kenneth Gonsalves wrote: > > On Saturday 19 Sep 2009 5:13:39 pm Kenneth Gonsalves wrote: > > On Monday 14 Sep 2009 1:56:32 am Bret Taylor wrote: > > > he module: > > > > > > import django.core.handlers.wsgi > > > import os > > > import tornado.httpserve

Re: Running Django on Tornado's HTTP server

2009-09-29 Thread Kenneth Gonsalves
On Saturday 19 Sep 2009 5:13:39 pm Kenneth Gonsalves wrote: > On Monday 14 Sep 2009 1:56:32 am Bret Taylor wrote: > > he module: > > > > import django.core.handlers.wsgi > > import os > > import tornado.httpserver > > import tornado.ioloop > > import tornado.wsgi > > > > de

Re: formfield_overrides for Auth.User?

2009-09-29 Thread NoviceSortOf
Perhaps check this link. http://www.djangosnippets.org/snippets/74/ --~--~-~--~~~---~--~~ 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 unsubscr

Re: formfield_overrides for Auth.User?

2009-09-29 Thread NoviceSortOf
I think somebody had a module that worked as wrapper for this, but I can't find it. As well I'd like to use email addresses for username, since we have a legacy system with over 6000 entries, we need a way they can continue using their email addresses somehow. On Sep 20, 6:24 pm, Brandon Taylor

Re: What JavaScript framework do you use and why?

2009-09-29 Thread Sid
You might wanna check out - http://mochaui.com/demo/ if you're planning to use MooTools. Although i haven't used it yet, but it looks awesome and i haven't found a UI framework for jQuery that cohesive. On Sep 28, 6:37 pm, Joshua Russo wrote: > MooTools does look interesting. What would you mi

Re: Recursion without breaking MVC!

2009-09-29 Thread Matthias Kestenholz
Hey, On Tue, Sep 29, 2009 at 12:50 AM, Nuno Machado wrote: > > Hi djangoers, > > I've a simple category Model: > > class Category(models.Model): >    name = models.CharField(max_length=63) >    children = models.ManyToManyField('self', symmetrical=False, > related_name='parent') > > I need to cr