Re: How to hire a freelance Django developer

2011-03-29 Thread Kenneth Gonsalves
On Wed, 2011-03-30 at 12:06 +0530, Lakshman Prasad wrote: > > Is there a good *free* resource to browse freelance Django > developers > > github.com is out there: https://github.com/search?q=django > > and more on bitbucket -- regards KG http://lawgon.livejournal.com Coimbatore LUG rox http://

Re: How to hire a freelance Django developer

2011-03-29 Thread Lakshman Prasad
> Is there a good *free* resource to browse freelance Django developers github.com is out there: https://github.com/search?q=django On Wed, Mar 30, 2011 at 5:34 AM, Micah Carrick wrote: > Hey folks, > > Let me start by saying: Please don't email me your resume--this is not a > job listing. > > T

Re: develop to product

2011-03-29 Thread yongzhen zhang
Hi Sam, Yes, you are right, i want to run Django project on my LAMP server, before i did the Django project, i also made some PHP work under /var/ www. But now the PHP work doesnt work any more. Here is the apache error: [Tue Mar 29 23:56:53 2011] [error] Exception KeyError: KeyError(-1218464000,)

Re: Git repository with all tutorial code.

2011-03-29 Thread Mike Ramirez
On Tuesday, March 29, 2011 10:34:28 pm you wrote: > Though having the code in a public repo might encourage some to copy and > pasta, or not right code at all and just look at how it all goes together > s/right/write/ Mike -- Don't read everything you believe. -- You received this message be

Re: How to hire a freelance Django developer

2011-03-29 Thread Venkatraman S
On Wed, Mar 30, 2011 at 5:34 AM, Micah Carrick wrote: > That being said, I do need to hire python/django developers and system > admins from time to time to help me out with projects or take something off > my plate. Is there a good *free* resource to browse freelance Django > developers and/or po

Re: Git repository with all tutorial code.

2011-03-29 Thread Mike Ramirez
On Tuesday, March 29, 2011 03:08:32 pm Lachlan Musicman wrote: > On Wed, Mar 30, 2011 at 07:05, Andreas Neustifter > > wrote: > > Using this as starting point for new users of the tutorial? Is there > > any downside to having this in a repository? > > Well, it's not *evil* if that's what you are

Re: How to hire a freelance Django developer

2011-03-29 Thread Mike Ramirez
On Tuesday, March 29, 2011 05:04:49 pm Micah Carrick wrote: > Hey folks, > > Let me start by saying: Please don't email me your resume--this is not a > job listing. > > That being said, I do need to hire python/django developers and system > admins from time to time to help me out with projects o

Re: develop to product

2011-03-29 Thread Sam Walters
Hi Yongzhen, Looks like you're trying to run two mis-configured web servers. if you're on linux stop the nginx process eg: /etc/init.d/nginx stop The stuff you've submitted is for apache: Send us the contents of the apache log file showing the error. Perhaps *if the error is long* use http://pas

Re: how to create message box in Django?

2011-03-29 Thread Sam Walters
Yes, this is really a client-side related issue. To try and answer your question what would be involved on the django side of things: Basically you want django to deal with any submission from one of these fields as either a from or modelform so you can run clean() and validate the input. Beyond

Re: How to run a file.py in the django environement

2011-03-29 Thread Russell Keith-Magee
On Tue, Mar 29, 2011 at 3:18 AM, Sells, Fred wrote: > It was explained very clearly to me, I believe by shawn, but I've lost the > original reference.  If the file you want to run is in your django app > directory you just need ... or, you can follow the example in the docs: http://docs.django

Re: Invalid values in a form cause validation to fail

2011-03-29 Thread Karen Tracey
On Tue, Mar 29, 2011 at 4:40 PM, ALJ wrote: > I have a form within a view which allows users to filter results > within a database. The request is a GET because I want the users to be > able to bookmark the results. > > My querystring looks something like: > > > http://127.0.0.1:8001/myapp/?organ

How to hire a freelance Django developer

2011-03-29 Thread Micah Carrick
Hey folks, Let me start by saying: Please don't email me your resume--this is not a job listing. That being said, I do need to hire python/django developers and system admins from time to time to help me out with projects or take something off my plate. Is there a good *free* resource to browse f

Session "rollback" after transaction rollback

2011-03-29 Thread Tomasz Zieliński
How do you handle situation in which exception is raised from view, TransactionMiddleware rolls back the open transaction, but subsequently SessionMiddleware updates session in database with broken data (i.e. something that points to what was rolled back by TransactionMiddleware) ? This is an ed

Re: Git repository with all tutorial code.

2011-03-29 Thread Lachlan Musicman
On Wed, Mar 30, 2011 at 07:05, Andreas Neustifter wrote: > > Using this as starting point for new users of the tutorial? Is there > any downside to having this in a repository? Well, it's not *evil* if that's what you are asking. Personally, I found hand typing all the code from the tutorial to b

Re: develop to product

2011-03-29 Thread creecode
Hello Yongzhen, The first thing you might want to find out is why, apparently, nginx is giving you an error when you say that you are using apache/wsgi. If I had to guess I'd say you might have an nginx server acting as a proxy in your stack somewhere. I'm not an expert though as I've just been

Re: develop to product

2011-03-29 Thread yongzhen zhang
It shows: 404 Not Found nginx/0.7.65 On 3月30日, 上午4时19分, yongzhen zhang <4...@live.cn> wrote: > NameVirtualHost *:80 > > in /etc/apache2/sites-available i made one file istore: > > ServerAdmin webmaster@loc

Re: creating text area for subpage inside models.py

2011-03-29 Thread j
Hey, Cal I just wanna let you know that I got an empty reply from you Thanks On Tue, Mar 29, 2011 at 4:07 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > Hi, Cal Leeming, > > Thanks for the tips > > Ok, here is what I did step by step, > > First I've mod

Invalid values in a form cause validation to fail

2011-03-29 Thread ALJ
I have a form within a view which allows users to filter results within a database. The request is a GET because I want the users to be able to bookmark the results. My querystring looks something like: http://127.0.0.1:8001/myapp/?organisation_name=&corporation=4&authorisation_status= My view c

Re: Accessing values in formset loops

2011-03-29 Thread Mike Ramirez
On Tuesday, March 29, 2011 12:50:09 pm Nick wrote: > I guess the bigger question is, can I access the values of the fields > without spitting out a form field? > form.field.value? After the form is bound, when you access the field, it's turned into a bound field[1] . This wrapper adds a few ext

Best way to implement a settings.py ROBOT_NO_FOLLOW

2011-03-29 Thread palhmbs
Hi, I have placed ROBOTS_NO_FOLLOW = True in mysite/settings.py I have added data['robots_no_follow'] = msyite.settings.ROBOTS_NO_FOLLOW into decorators.py under... def as_view(request, template, data, slug): which passes this successfully onto base.html so I can check it with {% if rob

Git repository with all tutorial code.

2011-03-29 Thread Andreas Neustifter
Hi all! I have just worked the tutorial from http://docs.djangoproject.com/en/1.3/intro/tutorial01/ and recorded all the steps in an Git repository and made this available for everyone to reproduce at https://github.com/astifter/django-Tutorial. Using this as starting point for new users of the t

Re: A very simple dajax code to show alert window not working

2011-03-29 Thread Jorge Bastida
Hi, There isn't any other methods, Dajax.process is only a callback that "understand" what Dajax return as response. You can check the code here [1]. Regards. [1] https://github.com/jorgebastida/django-dajax/blob/master/src/jquery.dajax.core.js 2011/3/29 Abhijeet Rastogi > Thanks Jorge. Worke

Re: develop to product

2011-03-29 Thread yongzhen zhang
NameVirtualHost *:80 in /etc/apache2/sites-available i made one file istore: ServerAdmin webmaster@localhost ServerName www.imaboy.cn ServerAlias shop.imaboy.cn Alias /static /home/yongzhen/workspace/www/iStore/static DocumentRoot /home/yongzhen/workspace

Re: A very simple dajax code to show alert window not working

2011-03-29 Thread Abhijeet Rastogi
Thanks Jorge. Worked perfectly. I included jquery.dajax.core.js and jquery.js in the document and now everything works perfectly. btw, I couldnt find documentation for Dajax.process method. Like there there might me other methods too. Where can I find the documentation for them. On Wed, Mar 30, 2

Re: How to store the database in the project root

2011-03-29 Thread rohan
I got it working. I just used os.path.join(PROJECT_ROOT,'db/chemdb') in place of database name. It created the database within a folder called db inside the project. On Mar 29, 1:50 pm, Shawn Milochik wrote: > This works for me: > > DIRNAME = os.path.dirname(__file__) -- You received this mes

Re: Accessing values in formset loops

2011-03-29 Thread Nick
I guess the bigger question is, can I access the values of the fields without spitting out a form field? On Mar 29, 2:45 pm, Nick wrote: > I am looping through a formset and attempting to add an additional > field to the form that is a multi select checkbox that has a value of > the ID of the cur

Generic List View raises Attribute Error: "'function' object has no attribute '_clone'

2011-03-29 Thread dpapathanasiou
I've written a simple search function that uses a db model based on the one described in The Django Book tutorial (http:// www.djangobook.com/en/2.0/), using a generic list, and a Paginator. Here is my view function: def search (request): """Search by title or author name""" if 'q' in re

Accessing values in formset loops

2011-03-29 Thread Nick
I am looping through a formset and attempting to add an additional field to the form that is a multi select checkbox that has a value of the ID of the current iteration of the formset loop. So: model1: name = CharField ID = IntegerField FK = ForeignKey('model2') model2: name my for

Re: A very simple dajax code to show alert window not working

2011-03-29 Thread Jorge Bastida
Hi, You should include your desired Dajax implementation. You can choose between Prototype, jquery, dojo etc... The django-dajax installation steps are here [1]. As you can see in one of the final steps "Include dajax in your ", you should add a new script line to include that JS, also you should

Fwd: creating text area for subpage inside models.py

2011-03-29 Thread Cal Leeming [Simplicity Media Ltd]
Hi, Cal Leeming, Thanks for the tips Ok, here is what I did step by step, First I've modified the models.py file adding this like: // code starts *class City ( models.Model ): ... class Translation ( multilingual.Translation ): ... tourism_text = models.TextField ( 'Touri

wsgi config question

2011-03-29 Thread Sells, Fred
I'm just converting from mod_python to mod_wsgi and making progress. I would like to be able to deploy multiple independent webapps without having to edit the apache configs each time. I'm thinking of something like /var/www/wsgi-scripts App1.wsgi App2.wsgi

A very simple dajax code to show alert window not working

2011-03-29 Thread Abhijeet Rastogi
Hi, I am beginner in django and dajax. In the process of learning to use dajax I am trying to simply display an alert saying "Foo". My code: https://bitbucket.org/shadyabhi/learnajax/src The above code contains 2 input boxes. The first one works but second one says "Dajax is not defined". I am n

Re: How to store the database in the project root

2011-03-29 Thread Shawn Milochik
This works for me: DIRNAME = os.path.dirname(__file__) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@g

Re: Payment Gateways

2011-03-29 Thread Micah Carrick
I have used Authorize.Net for years and don't have a single complaint. For Python/Django interfacing to Authorize.Net, Quantam, or PsiGate I use quix.pay, which I also wrote: http://pypi.python.org/pypi/quix.pay/ In testing quix.pay, I found that the Quantam gateway in authorize.net emulation mode

How to store the database in the project root

2011-03-29 Thread rohan
Hi, I am creating an app and want to store the database and the images within the project. The main motive behind this is I want to create a database with django's admin interface and want to use it on other computers later. In order to do this I will need to use relative paths. I tried using os.p

Re: Slow query. Any way to speed things up?

2011-03-29 Thread Fabian Büchler
Hello Matthias, 2011/3/29 Matthias Kestenholz > On Tue, Mar 29, 2011 at 2:27 PM, Fabian Büchler > wrote: > > I've analyzed the query using pgAdmin and it seems the most time is being > > spent with a the GroupAggregate. > > This is because of so many columns being listed in the GROUP BY clause.

creating text area for subpage inside models.py

2011-03-29 Thread jake k.
Hi, All I was wondering if you can help me with this one. I've modified part of my models.py file so I can have a new text area inside my django admin page. I need to add this text area so I can add content to a new subpage I have added the new text area, but after saving and refreshing the page

Re: creating text area for subpage inside models.py

2011-03-29 Thread Cal Leeming [Simplicity Media Ltd]
Hi Jake, Please ensure you always paste example source code, where possible and within reason. It is extremely difficult for people to help if they don't have this. If you respond back with this, I'm sure one of us will be able to give you a hand. Cheers Cal On Tue, Mar 29, 2011 at 5:49 PM, j

Social Auth

2011-03-29 Thread bish029
how to get id or key required for social oath from facebook and use it to test my development while i am still developing the site but not yet launched it -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to d

Re: embedding tag in another tag

2011-03-29 Thread mike171562
Perhaps you should try like this: url_1 = '{%page_url%}{% page_attribute "slug"%}/{{id}}/vote/' On Mar 23, 8:41 pm, Tony wrote: > there is a form called F, and I am trying to set its "action" > attribute dynamically with javascript.  I can do this successfully. > However, when I try to use one

Re: unicode question

2011-03-29 Thread George Lund
I can't explain the additional space, but URL-encoding a Unicode string isn't generally possible, it needs to be encoded first. UTF-8 is almost always the correct encoding to use, so in your case: qk = quote(query_text.encode('utf8')) Anything you can do to avoid having to include text like th

unicode question

2011-03-29 Thread Mike Thon
Hi - I'm not sure if this is a Django problem, but I'm working on a Django project so I thought I'd start here. In my project users will submit text by way of a text field which will eventually be encoded with urllib.quote() and used in a url. When I submit text, certain characters appear on m

problem with creating foreign keys

2011-03-29 Thread rohan
Hello, I am new to Django and am trying to design a chemistry database in Django and am stuck with creating the relations between the tables. Below are my models. When I try to validate I get an error stating that the reverse query name for field 'species2ID' clashes with m2m fileID 'Compunds.rea

Message framework problem

2011-03-29 Thread wluka
I add this to my view. if form.is_valid(): new_user = form.save(profile_callback=profile_callback) messages.add_message(request, messages.SUCCESS, 'Complete bla bla') return HttpResponseRedirect(reverse('main')) And {% if messages %} {{message}}

Re: Just started Django - please help clarify web site configuration strategy

2011-03-29 Thread javatina
That's the discussion I was looking for. Many thanks to you and Bruno Desthuilliers - helps get bigger picture. On Mar 28, 6:37 pm, Jumpfroggy wrote: > > Basically, the question is - when a web > > application starts there is a number of things that needs to be > > available any time any request.

Re: Just started Django - please help clarify web site configuration strategy

2011-03-29 Thread javatina
On Mar 29, 5:06 am, bruno desthuilliers wrote: > > 2. custom template tags - I do not see how they can help here > > You were talking about menus built from the db. Using a custom tag to > build these menus gives you the flexibility to only call on the > relevant code when needed - instead of cal

Re: Looking for IDE + FTP

2011-03-29 Thread Mike Ramirez
On Tuesday, March 29, 2011 08:34:51 am Cal Leeming [Simplicity Media Ltd] wrote: > Hmm, Aptana Studio looks pretty hot.. Might try it out! ty! > Beware of titanium, it requires a net connection and you to be connected to their systems to use it's functionality. Had to logon to the local app to

Re: Looking for IDE + FTP

2011-03-29 Thread Cal Leeming [Simplicity Media Ltd]
Hmm, Aptana Studio looks pretty hot.. Might try it out! ty! On Tue, Mar 29, 2011 at 4:32 PM, emonk wrote: > http://wiki.python.org/moin/IntegratedDevelopmentEnvironments > > > 2011/3/28 Karen McNeil > >> Just wanted to give you all an update: I started using Aptana Studio >> with the PyDev plu

Re: Looking for IDE + FTP

2011-03-29 Thread emonk
http://wiki.python.org/moin/IntegratedDevelopmentEnvironments 2011/3/28 Karen McNeil > Just wanted to give you all an update: I started using Aptana Studio > with the PyDev plug-in and I'm really liking it; I think it was just > what I needed. > > Thanks for all the suggestions! > > ~Karen > >

Re: Admin broken with large data table

2011-03-29 Thread Malcolm Box
On Mar 29, 2:48 pm, Jacob Kaplan-Moss wrote: > On Tue, Mar 29, 2011 at 5:56 AM, Malcolm Box wrote: > > On one of my models, the admin choice_list page is taking minutes to > > load, which makes it somewhat broken. > > > The table has about 2M rows and about 2.6GB in size, on InnoDB/MySQL. > > As

Re: list in template

2011-03-29 Thread bruno desthuilliers
On 29 mar, 17:17, satvik chauhan wrote: > I am using contrib.comments app and have a custom field xuser in the comment > model. > I want to create a list  of xusers(with no duplicates ) > > {% for comment in comment_list %} > > [Some tag to add comment.xuser in the list if not already in it ] > >

list in template

2011-03-29 Thread satvik chauhan
I am using contrib.comments app and have a custom field xuser in the comment model. I want to create a list of xusers(with no duplicates ) {% for comment in comment_list %} [Some tag to add comment.xuser in the list if not already in it ] {% endfor %} Then I want to iterate over that list as

Re: how to create message box in Django?

2011-03-29 Thread Shawn Milochik
Yeah, this isn't a Django question. But this is what we use: http://jqueryui.com/demos/dialog/ -- 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, s

Re: ManyToMany Intermediate Table on a Separate Database?

2011-03-29 Thread Tomasz Zieliński
(Sorry Daniel, I replied to your private email by accident - the new Google Groups UI misled me.) Actually in MySQL you can easily work around that limitation - you can use database VIEWs as mirrors of tables placed in other databases. -- Tomasz Zielinski pyconsultant.eu -- You received this

Re: develop to product

2011-03-29 Thread Mike Ramirez
On Tuesday, March 29, 2011 07:48:16 am yongzhen zhang wrote: > [Tue Mar 29 17:06:07 2011] [error] [client 62.237.153.123] File "/home/ > yongzhen/workspace/www/iStore/apache/django.wsgi", line 5, in > [Tue Mar 29 17:06:07 2011] [error] [client 62.237.153.123] > wsgi_dir=os.path.abspath(os.path.di

Re: develop to product

2011-03-29 Thread yongzhen zhang
[Tue Mar 29 17:06:07 2011] [error] [client 62.237.153.123] mod_wsgi (pid=795): Target WSGI script '/home/yongzhen/workspace/www/iStore/ apache/django.wsgi' cannot be loaded as Python module. [Tue Mar 29 17:06:07 2011] [error] [client 62.237.153.123] mod_wsgi (pid=795): Exception occurred processing

Re: how to create message box in Django?

2011-03-29 Thread CrabbyPete
A message box is not a django thing. Its html. Look into creating a modal window in html. I do it a lot using javascript and ajax, but there are a lot simpler ways. On Mar 29, 5:10 am, djangodjango django wrote: > Hi all, > > Could someone please tell me how to create a Message Box using Django?

Re: Admin broken with large data table

2011-03-29 Thread Jacob Kaplan-Moss
On Tue, Mar 29, 2011 at 5:56 AM, Malcolm Box wrote: > On one of my models, the admin choice_list page is taking minutes to > load, which makes it somewhat broken. > > The table has about 2M rows and about 2.6GB in size, on InnoDB/MySQL. > As far as I can tell, what's breaking things is the paginat

Re: develop to product

2011-03-29 Thread yongzhen zhang
[Tue Mar 29 16:40:59 2011] [warn] NameVirtualHost *:80 has no VirtualHosts [Tue Mar 29 16:40:59 2011] [warn] NameVirtualHost *:80 has no VirtualHosts (13)Permission denied: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs On 3月29日,

Re: OT: Django broke my Dropbox

2011-03-29 Thread Andre Terra
"Whoa, this is *so* much better than grep it's not even funny." -- Jacob Kaplan-Moss , creator of Django. +5!! Thanks for the link Cheers, André Terra (airstrike) On Mon, Mar 28, 2011 at 6:42 PM, Shawn Milochik wrote: > On Mon, Mar 28, 20

Re: django and sphinx - lib needed

2011-03-29 Thread Cal Leeming [Simplicity Media Ltd]
One thing I should point out, this lib is focused on performance, rather than code tidyness. As it is a prototype, the code structure and layout is *extremely* messy. But, I'm able to pull back 50 thousand results, convert the results to Django models, and have the result cached, in under 0.2 secon

Re: django and sphinx - lib needed

2011-03-29 Thread Cal Leeming [Simplicity Media Ltd]
Oh, you also need this: sphinxapi.py http://pastebin.com/FrjBDiME On Tue, Mar 29, 2011 at 1:57 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > Okay, here you go. Remember, these are literally just cut and pasted out of > one of our webapps, so you'll need

Re: django and sphinx - lib needed

2011-03-29 Thread Cal Leeming [Simplicity Media Ltd]
Okay, here you go. Remember, these are literally just cut and pasted out of one of our webapps, so you'll need to most likely read the source code of each file, to truly understand what is going on. But, one thing I can guarantee, is that this code works, lol. Eventually, we'll be releasing a prope

Re: django and sphinx - lib needed

2011-03-29 Thread Cal Leeming [Simplicity Media Ltd]
Hey, I actually ended up writing my own wrapper for Django and Sphinx, because the one written by dcramer was retarded. I haven't yet done a public release for this, nor any documentation. However, I'll post you the library, and some example usage, but don't expect this to be an "easy" one-click

Re: develop to product

2011-03-29 Thread nadaeivar
Which error you have? Envoyé par mon BlackBerry® smartphone de Tigo -Original Message- From: yongzhen zhang <4...@live.cn> Sender: django-users@googlegroups.com Date: Tue, 29 Mar 2011 05:41:40 To: Django users Reply-To: django-users@googlegroups.com Subject: develop to product HI, I want

develop to product

2011-03-29 Thread yongzhen zhang
HI, I want to move development version to product version and i use Apache with wsgi. In apache2/sites-available folder, i made one istore instead the default one. The content is: NameVirtualHost *:80 ServerAdmin webmaster@localhost ServerName www.imaboy.cn ServerAlias sh

Re: Slow query. Any way to speed things up?

2011-03-29 Thread Matthias Kestenholz
On Tue, Mar 29, 2011 at 2:27 PM, Fabian Büchler wrote: > I've analyzed the query using pgAdmin and it seems the most time is being > spent with a the GroupAggregate. > This is because of so many columns being listed in the GROUP BY clause. > Creating two-column indexes over event_id and date or so

Re: Slow query. Any way to speed things up?

2011-03-29 Thread Fabian Büchler
I've analyzed the query using pgAdmin and it seems the most time is being spent with a the GroupAggregate. This is because of so many columns being listed in the GROUP BY clause. Creating two-column indexes over event_id and date or some other combinations I've tried did not gain any perforamance.

Re: Help on setting TIME_ZONE to 'UTC'

2011-03-29 Thread Malcolm Box
Look in the docs here: http://docs.djangoproject.com/en/1.3/ref/settings/#time-zone As it says, this doesn't work on Window and will result in the system timezone being used. On Mar 29, 8:58 am, aa bb wrote: > Hi all! I'm a Django newbie. I set TIME_ZONE to 'UTC' in my project > settings.py. Th

Admin broken with large data table

2011-03-29 Thread Malcolm Box
Hi, On one of my models, the admin choice_list page is taking minutes to load, which makes it somewhat broken. The table has about 2M rows and about 2.6GB in size, on InnoDB/MySQL. As far as I can tell, what's breaking things is the paginator code that is doing a SELECT COUNT(*) which is known to

Re: Slow query. Any way to speed things up?

2011-03-29 Thread bruno desthuilliers
On 29 mar, 12:26, Fabian Büchler wrote: (snip part about the generated query) > As Javier suggested, an index on the "events_eventdate" over table over > "event_id" and "date" could help, but I don't know how to create one using > Django's model techniques This is something you can do directly

Re: Slow query. Any way to speed things up?

2011-03-29 Thread Fabian Büchler
Hello Anssi, also thanks for your answer! I also believe that the generated query is more than suboptimal. Here it is. I've not deleted any columns, since there is something strange about the GROUP BY clause: all columns are listed there twice: SELECT "events_event"."id", >"events_event"

Re: Slow query. Any way to speed things up?

2011-03-29 Thread Fabian Büchler
Hello Javier, thanks for your answer! The reason for one Event having multiple EventDates is simple: an event like a theatre can have multiple shows/screenings. Is there a way to add an index on event+date other than unique-together? ( http://docs.djangoproject.com/en/dev/ref/models/options/#uniq

django and sphinx - lib needed

2011-03-29 Thread galgal
What library can I use with Django to use Sphinx? I found https://github.com/dcramer/django-sphinx but it's not supported yet:/ -- 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.

Re: Two way many-to-many relationships

2011-03-29 Thread Mike Ramirez
On Monday, March 28, 2011 02:32:52 pm Dilan wrote: > Thanks Mike ! you're welcome > That was a really helpful page that I missed in Doc. In this > particular case 1 solves 2. > Nice > > In python you can't forward declare outside of the module the object is > > in. I also want to clarify that

Re: How to create message box window using Django

2011-03-29 Thread Mike Ramirez
On Tuesday, March 29, 2011 02:13:40 am django beginner wrote: > Hi all, > > Could someone please tell me how to create a Message Box using Django? > > Thanks in advance. This falls under the domain of javascript/css/html, django itself has no dialog boxes of any kind, it only has simple form w

Re: Just started Django - please help clarify web site configuration strategy

2011-03-29 Thread bruno desthuilliers
On 28 mar, 20:58, javatina wrote: > Thanks for responding. It's been very important - helps "gauge" > thinking, how far I am off :) > > 1. I haven't yet looked at middlewares - will do. > > 2. custom template tags - I do not see how they can help here You were talking about menus built from the d

How to create message box window using Django

2011-03-29 Thread django beginner
Hi all, Could someone please tell me how to create a Message Box using Django? Thanks in advance. -- 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 grou

how to create message box in Django?

2011-03-29 Thread djangodjango django
Hi all, Could someone please tell me how to create a Message Box using Django? Thanks in advance. -- 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 grou

Re: Complex query

2011-03-29 Thread gontran
Now that I changed my model, the query is a little bit different. So, my models: UserProfile(models.Model): user = models.OneToOneField(User) company = models.ForeignKey(Company) Company(models.Model): ...some fields... Product(models.Model): ...some fields... ProductLicence(mod

Re: Just started Django - please help clarify web site configuration strategy

2011-03-29 Thread bruno desthuilliers
On 29 mar, 00:37, Jumpfroggy wrote: (snip) > There is no callback mechanism.  You can add code to any file > (models.py is a good place), and you can do some tricky python-fu to > make sure it only runs once per process, but that's a bit of a hack. Indeed - and more often than not a good way to

Fwd: Help with creating a list in the template

2011-03-29 Thread satvik chauhan
-- Forwarded message -- From: satvik chauhan Date: Tue, Mar 29, 2011 at 2:01 PM Subject: Help with creating a list in the template To: django-develop...@googlegroups.com Hey , I am using the contrib.comments app and have created a custom my_comment_app with one additional field

Help on setting TIME_ZONE to 'UTC'

2011-03-29 Thread aa bb
Hi all! I'm a Django newbie. I set TIME_ZONE to 'UTC' in my project settings.py. Then I have defined a data model like: class D(models.Model): #some fields joined_at = models.DateTimeField(null = True, auto_now_add = True) #some other fields I expect when a new D instance is created, its jo

Re: Complex query

2011-03-29 Thread Kenneth Gonsalves
On Tue, 2011-03-29 at 01:17 -0700, bruno desthuilliers wrote: > On 29 mar, 09:33, Kenneth Gonsalves wrote: > > Product is not linked to them - they are linked to Product. > > Sorry but I dont see the point here - you can follow a relationship > both way. pointless nitpick - apologies -- regard

Re: Complex query

2011-03-29 Thread gontran
Hi Bruno, yes you're right. I should change my model in the way you mentioned it. I saw that a couple of minutes ago. And to answer to my initial question, I might have found the answer. The query would be: news = News.objects.filter(related_products__productlicence__in = user.get_profile().comp

Re: Complex query

2011-03-29 Thread bruno desthuilliers
On 29 mar, 09:11, gontran wrote: > Hi everybody, > > considering the folowing models: > > UserProfile(models.Model): >     user = models.OneToOneField(User) >     company = models.ForeignKey(Company) > > Company(models.Model): >     product_licences = models.manyToManyField(ProductLicence) Sor

Re: Complex query

2011-03-29 Thread bruno desthuilliers
On 29 mar, 09:33, Kenneth Gonsalves wrote: > Product is not linked to them - they are linked to Product. Sorry but I dont see the point here - you can follow a relationship both way. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to t

Re: Complex query

2011-03-29 Thread gontran
Ok. I 'll try again Thank you very much for your consideration. Regards, Gontran On 29 mar, 09:33, Kenneth Gonsalves wrote: > Product is not linked to them - they are linked to Product. I do not > think you can do it in one query because there are ManyToMany fields > which have to be retrieved

Re: Complex query

2011-03-29 Thread Kenneth Gonsalves
Product is not linked to them - they are linked to Product. I do not think you can do it in one query because there are ManyToMany fields which have to be retrieved and then you have to iterate over them. Certainly more than one query. On Tue, 2011-03-29 at 00:24 -0700, gontran wrote: > Yes: Produ

Re: Complex query

2011-03-29 Thread gontran
Yes: ProductLicence and News On 29 mar, 09:19, Kenneth Gonsalves wrote: > On Tue, 2011-03-29 at 00:11 -0700, gontran wrote: > > UserProfile(models.Model): > >     user = models.OneToOneField(User) > >     company = models.ForeignKey(Company) > > > Company(models.Model): > >     product_licences =

Re: Complex query

2011-03-29 Thread Kenneth Gonsalves
On Tue, 2011-03-29 at 00:11 -0700, gontran wrote: > UserProfile(models.Model): > user = models.OneToOneField(User) > company = models.ForeignKey(Company) > > Company(models.Model): > product_licences = models.manyToManyField(ProductLicence) > > Product(models.Model): > ...some fie

Complex query

2011-03-29 Thread gontran
Hi everybody, considering the folowing models: UserProfile(models.Model): user = models.OneToOneField(User) company = models.ForeignKey(Company) Company(models.Model): product_licences = models.manyToManyField(ProductLicence) Product(models.Model): ...some fields... ProductLice

Would object creation involving FK still work when the 2 tables involved are in different databases?

2011-03-29 Thread Andy
Hi, Say I have a model: class Note(models.Model) : text = models.TextField() owner = models.ForeignKey(User) If Note and User are located on different databases, would the following still work? note = Note(text='hello world', owner=request.user) I understand that join will not work acr