Re: how to configure database?

2010-11-22 Thread Sam Lai
How does it 'not seem to work'? Are these two apps within the same project? In that case, they should by default use the same database. On 23 November 2010 07:32, pa_ree wrote: > hello, i'm new to django framework. > > i want to know how can i configure a single

Re: Problems firing up django site

2010-11-22 Thread Sam Lai
You'll have to provide more information - what site, what have you tried? But before you do that - start with the Django tutorial. It is very detailed, and should help you get started. http://docs.djangoproject.com/en/1.2/intro/tutorial01/ On 23 November 2010 04:22, Bonucci

uuid as primary key on admin inlines results with MultiValueDictKeyError. Please advise

2010-11-22 Thread Iclaimthisname
Hi, I am coming to the conclusion that it is not possible, but I wanted to ask one last time before I give up. Is it possible to use a uuid primary key on a model used as an admin inline? I've tried every uuid field I could find and attempted to get my own to work as well, but no matter what I

Hosting multiple projects

2010-11-22 Thread Todd Wilson
I teach a course in which I have students developing unrelated Django projects on servers of their own choice. As we near the end of the semester, I would like to set up a single server where I can host all of these student projects together. I will obviously create a new user, as well as a new

how to configure database?

2010-11-22 Thread pa_ree
hello, i'm new to django framework. i want to know how can i configure a single database to two applications. the problem is essentially, that i first created a database and an application in two subparts, and configured the database to the first part of application. Now i want to link the

Problems firing up django site

2010-11-22 Thread Bonucci
Hii guys, im having some problems, i downloaded a website, and its in django, i installed django in my ubuntu, but now i cant fire him up, can somenody help me? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: Error Starting Django App using Apache+Mod_Wsgi

2010-11-22 Thread Graham Dumpleton
Have a read of: http://code.google.com/p/modwsgi/wiki/InstallationIssues It is likely that you have a conflicting mod_python module installed or that mod_wsgi is no finding the correct Python installation shared library at run time. Graham On Nov 22, 11:58 pm, Guddu

Re: no such class TextArea

2010-11-22 Thread Christophe Pettus
On Nov 22, 2010, at 4:50 PM, Daniel Carvalho wrote: > field2 = forms.CharField( >widget=forms.widgets.TextArea(attrs={'cols': 40,'rows': 5})) 'Textarea', no medial cap. -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the

Re: In-memory sorting of a QuerySet, yielding a QuerySet

2010-11-22 Thread JeeyoungKim
If you look at the internals of QuerySet, the evaluated values lie inside self._result_cache. You can just sort this element, but that sounds very hacky... On Nov 22, 4:27 pm, Christophe Pettus wrote: > Apologies if this is a FAQ... > > I'd like to take a QuerySet and order it

no such class TextArea

2010-11-22 Thread Daniel Carvalho
Hi, I want to define a form with a multi-line textfield. from django import forms class TesteForm(forms.Form): field1 = forms.CharField( max_length=100,widget=forms.widgets.TextInput()) ... field2 = forms.CharField( widget=forms.widgets.TextArea(attrs={'cols':

In-memory sorting of a QuerySet, yielding a QuerySet

2010-11-22 Thread Christophe Pettus
Apologies if this is a FAQ... I'd like to take a QuerySet and order it in memory, rather than using 'order_by'. However, I need it to stay a QuerySet, since I'll be feeding it to the .queryset attribute of a ModelChoiceField. Is there any way of accomplishing this? -- -- Christophe Pettus

Re: ajax and django

2010-11-22 Thread Reinout van Rees
On 11/22/2010 11:48 PM, owidjaya wrote: What is the best way to go about handling ajax request per application? I currently have a middleware that implements "process_request" function. the function acts as a relay to call "serve_ajax(request)" function that is implemented in the application

Re: ajax and django

2010-11-22 Thread owidjaya
correction it's "process_response" function not process_request. On Nov 22, 2:48 pm, owidjaya wrote: > What is the best way to go about handling ajax request per > application? > > I currently have a middleware that implements "process_request" > function. > the function acts

ajax and django

2010-11-22 Thread owidjaya
What is the best way to go about handling ajax request per application? I currently have a middleware that implements "process_request" function. the function acts as a relay to call "serve_ajax(request)" function that is implemented in the application class that wants to respond to ajax request.

Re: Issue uploading photos through the admin. PIL issue.

2010-11-22 Thread Chris
Opps, Just solved my own question. python-dev is required which I had installed. I found a package called pillow which seems to take care of the issue that I was having. On Nov 22, 2:07 pm, Chris wrote: > I am having an issue with uploading photos through the admin. I

Issue uploading photos through the admin. PIL issue.

2010-11-22 Thread Chris
I am having an issue with uploading photos through the admin. I get this error: "Upload a valid image. The file you uploaded was either not an image or a corrupted image." I am using ubuntu 10.04, python 26, virtualenv, and and pip. Is there a known issue with installng pil through pip +

User additional profile

2010-11-22 Thread robos85
As Django noob I successfully created user validation and managed to add user. But I also created additional table for user profile, registered it in settings. But when I save() user to create it, my additional table is still empty. How can I create that user row when adding user to users table? I

Re: Multiple inheritance model

2010-11-22 Thread Marc Aymerich
On Sun, Nov 21, 2010 at 7:51 PM, Joseph (Driftwood Cove Designs) < powderfl...@gmail.com> wrote: > this is django.db.models.base.Model.save_base() > > a comment in the code for ModelA indicates the call to save_base() is > required for Mptt. > > Joseph, I think the problem here is the ModelA

Re: Problem with Mysql Queries in django

2010-11-22 Thread Rogério Carrasqueira
Hi Jagdeep, Consider to use a query like this example: sales = Sale.objects.extra(select={'month':'month(date_created)','year':'year(date_created)'}).values('year','month').annotate(month=11,year=2010) It works on mysql. More information

Problem with Mysql Queries in django

2010-11-22 Thread Jagdeep Singh Malhi
Hi I have two Problems with Mysql Query First problem : for example :- >>>client = ClientJob.objects.filter(date__contains = '2010-11- ') >>> client Warning Message is :- Warning: Incorrect date value: '%2010-11-%' for column 'date' at row 1 its doesn't work I want use Mysql Query like :-

Re: How to join a search on user and user profile

2010-11-22 Thread Rogério Carrasqueira
Thanks Chris, But I would like to use on admin, using the search_fields Cheers Rogério Carrasqueira --- e-mail: rogerio.carrasque...@gmail.com skype: rgcarrasqueira MSN: rcarrasque...@hotmail.com ICQ: 50525616 Tel.: (11) 7805-0074 2010/11/22 Chris Lawlor > You

Re: restrict downloading files based on user-permission

2010-11-22 Thread patrickk
here´s a snippet which shows an implementation: http://djangosnippets.org/snippets/1710/ however, the only cross-browser solution I´ve come across is the one I ´ve posted above. regards, patrick On 22 Nov., 16:40, David De La Harpe Golden wrote: > Looked into

Re: Static files ...

2010-11-22 Thread jonno
Thanks again, Steve. You know, I think that must be my problem, since I have yet to have a static file served to me. I thought runserver did this by default in development, but I wonder if I'm mixing up development and production settings somewhere. DEBUG is set to true, and the documentation

Re: 'utf8' codec can't decode byte 0xe9 in position 303: invalid continuation byte

2010-11-22 Thread cocolombo
The following line at the top of the file solved it for my french characters. # -*- coding: latin-1 -*- cclmb === On Nov 21, 2:51 pm, Alex s wrote: > Hi, > > In homepage.html file, I am trying to write the letter "é". So I have the > following error: > > 'utf8' codec

Re: restrict downloading files based on user-permission

2010-11-22 Thread David De La Harpe Golden
Looked into this a bit (will undoubtedly bite us soon): On 22/11/10 13:54, Torsten Bronger wrote: > Is there a standard at all for how non-ASCII in the header field > "Content-Disposition" is supposed to be encoded? The rfc5987 [1] based filename*=UTF-8''bl%c3%a4h mechanism very recently exists,

Re: 'utf8' codec can't decode byte 0xe9 in position 303: invalid continuation byte

2010-11-22 Thread Tiago Almeida
Hi, change the encoding of the html file to 'utf-8'. If you're using eclipse(pydev), you can do this by going to Edit -> set encoding. (or something like that) I remember it is the last choice in one of the top menus and it reads "Set enconding". Best regards, Tiago Almeida On 21 Nov, 19:51,

Re: A Model to store links to other models

2010-11-22 Thread Micah Carrick
Hey guys, I could use some advice on the next steps for the administration. I am passing the link groups to the template via context so that the template can iterate over each group creating a unordered list of links for each group. Some links are blog posts, some are flat pages, etc. Works

Re: Cache problem after new image uploaded?

2010-11-22 Thread vcarney
time.time() is returning the current unix timestamp and thus a new url each time. On Nov 20, 9:13 am, mathphreak wrote: > Are you sure that time.time() is evaluating rather than just being > text?  If you're just appending "?rand=time.time()" to your page, then > you'll be

Re: How to join a search on user and user profile

2010-11-22 Thread Chris Lawlor
You should be able to do something like: UserProfile.objects.filter(gender='female', user__email='some...@mail.com') Note the double underscore notation, which let's you access attributes of the related model. This example assumes that UserProfile has a FK field to User which is named 'user'.

Re: Do Fixtures have a limit?

2010-11-22 Thread Reinout van Rees
On 11/22/2010 03:16 PM, Ryno in Stereo wrote: I'm trying to create around 32,000 rows in a table via a json fixture and although Django confirms via the commandline that it's worked (Installed 32423 object(s) from 1 fixture(s) ), I can only ever see 20,149 records in my MySQl database. I can't

Re: Debugging Unit Tests

2010-11-22 Thread Shawn Milochik
This works for me. Are you certain the code you think is being executed is where it's "freezing"? Try some logging statements. How are you running your tests -- are you just using the standard test runner? On Nov 22, 2010, at 9:04, Murray wrote: > pdb dosn't seem to work

Do Fixtures have a limit?

2010-11-22 Thread Ryno in Stereo
I'm trying to create around 32,000 rows in a table via a json fixture and although Django confirms via the commandline that it's worked (Installed 32423 object(s) from 1 fixture(s) ), I can only ever see 20,149 records in my MySQl database. I can't any mention of an upper limit for fixtures and

Debugging Unit Tests

2010-11-22 Thread Murray
pdb dosn't seem to work inside my unit tests, whenever I run set_trace the unit test running freezes with no output. I presume this is because the output from the tests is suppressed somehow when they are being run. Is there someway to disable this so that I can use pdb to debug my failing

Re: restrict downloading files based on user-permission

2010-11-22 Thread Torsten Bronger
Hallöchen! patrickk writes: > well ... yes, but if someond uploads "äöü.PDF" I want the user to > download "äöü.PDF" again ... and not > %C3%83%C2%A4%C3%83%C2%B6%C3%83%C2%BC.PDF. > > did you test your code with IE7/IE8? I just did and the name of > the downloaded file differs from the upload.

How to access model_admin (ModelAdmin) in changeform-template?

2010-11-22 Thread Dekker
Summary: In Django 1.2.3 within the changeform.html the variable context["adminform"].model_admin --> {{adminform.model_admin}} is not accesible Longer description: On an admin form (changeform.html) I would like to generate a toolbar, which should show (for the moment) the same actions as the

Re: Serve different page to IE7/8?

2010-11-22 Thread Max Countryman
Conditional stylesheets vs CSS hacks? Paul Irish says the answer is neither: http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ On Nov 21, 2010, at 7:54 PM, Victor Hooi wrote: > I know this is a bit of a hack, but what's the best way to serve up a > different

Error Starting Django App using Apache+Mod_Wsgi

2010-11-22 Thread Guddu
All, I have a problem in starting my Django App using Apache and Mod_Wsgi I am using Django 1.2.3 and Python 2.6.6 running on Apache 2.2.17 with Mod_Wsgi 3.3 When I try to access the app from Web Browser, I am getting these errors. [Mon Nov 22 09:45:25 2010] [notice] Apache/2.2.17 (Unix)

ManyToMany using through and limit_choices_to

2010-11-22 Thread Ferran
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 I've seen on the docs that is not possible to use limit_choices_to with a ManyToMany relationship using intermediate tables with through parameter. I need to have an "ordered" ManyToMany relationship, and i'm using an intermediate table to achieve

django extensions dumpscript, No module found

2010-11-22 Thread Murray
Hi all, not sure if this is the right place to be asking django- command-extension questions, but I can't seem to get the dumpscript/ runscript commands working correctly. Is there something wrong in the way I'm doing this: > ./manage.py dumpscript > scripts/test.py > touch scripts/__init__.py >

Re: django_content_type integrity error on sync and loaddata

2010-11-22 Thread Murray
Thanks, that's solved it. On Nov 19, 6:36 pm, Shawn Milochik wrote: > When you run dumpdata you can specify apps or models within an app to > export. That will allow you to avoid bringing Django's scaffolding > into your fixtures. > > Shawn -- You received this message

Re: Serve different page to IE7/8?

2010-11-22 Thread Robbington
Maybe not a Django-ish awnser, but prob the easiet way to do it would be to write conditional comments into your html and have a seperate style sheet for IE. Good tutorial on it. http://css-tricks.com/how-to-create-an-ie-only-stylesheet/ Rob -- You received this message because you are