Re: IntegrityError: columns app_label, model are not unique

2009-03-08 Thread Russell Keith-Magee
On Sun, Mar 8, 2009 at 2:24 PM, He Jibo wrote: > Dear All, > > I ran into the following error of "IntegrityError: columns app_label, model > are not unique" when I tried to > Sync the data to the db with the command of "manage.py syncdb". I am using > python2.5, Django-1.0.2-final, and Window XP.

Re: loaddata spewing to standard output but not actually loading

2009-03-08 Thread Russell Keith-Magee
On Sat, Mar 7, 2009 at 6:30 AM, Serdar T. wrote: > > Hey everyone, > > While trying to load a json fixture, the contents are spitting out to > my bash shell but nothing is loading into the postgres database > backend. > > From inside my project directory, I'm executing the documented > command: >

Re: ImportError: No module named postgresql_psycopg2.base

2009-03-08 Thread durgaprasad
I have installed it directly from source. I tried re-installing it but didn't work. However, when I tried to install it with another python present in a different directory, it worked. Both python versions are the same (2.5.4). Earlier I had tried it on 2.6.1. But when it didn't work, I thought it

TransactionRollbackError?

2009-03-08 Thread Szymon
Hello, For 2-3 days my application throws randomly (not always) such exception: Traceback (most recent call last): File "/usr/lib64/python2.5/site-packages/django/core/handlers/ base.py", line 86, in get_response response = callback(request, *callback_args, **callback_kwargs) File "/home/

Trouble with accents when passing tranlsated string with newforms

2009-03-08 Thread Tipan
I'm trying to pass a translated string to a select box using a Forms Select widget and it always presents the output string with all the accent HTML entity codes. In my models file, I have a range of subjects: Models.py from django.utils import translation from django.utils.translation import ug

Convenient way to get dynamic names for formset fields?

2009-03-08 Thread Todd O'Bryan
I'm trying to create multiple choice questions with variable numbers of answers. I have a Question model and an Answer model with a ForeignKey back to Question. I'd like to display the question in a form as: Text : ___ A: ___ B: ___ C: ___ D: ___ E: ___ where each blank

Re: URL Calls

2009-03-08 Thread timlash
DR, That explanation helps. Upon another reading, I see that the tutorial says as much regarding reverse(). Yet that function is only demonstrated in the tutorial as a means of redirection, which is why I mistakenly equated it with render_to_response(). Thanks for setting me straight! Tim On

Dynamically default second form field from droplist value of another field in the same form

2009-03-08 Thread ldm999
I'd like to have a Django form with 2 fields: List Type droplist (eg Books, Movies) and List Name text field. Ie: List Type: [select...] List Name [] When my user selects a List Type I would like the List Name to automatically populate with the selected List Type. Similar to the

Re: loaddata spewing to standard output but not actually loading

2009-03-08 Thread Serdar T.
Hi Russell, Thanks for the response. I'll admit, since I posted, I waved my hand at the problem and imported all of my data through postgres. But I think my problem might be related to what you describe below: > > "Installing json fixture 'data2' from absolute path." > > This gives the first hint

Best way to trap IntegrityError in Django form?

2009-03-08 Thread ldm999
I have a form tied to a List model where User and Name are unique_together. What's the best way to trap the IntegrityError if someone tries to create a new List with a User/Name combo that already exists? I know I could allow Django forms to do it if I include User in the form, but obviously I n

Foreign Key query question

2009-03-08 Thread Christoph Wegscheider
Hi, I have the following model: class Message(models.Model): student = models.ForeignKey(Student, blank=True, null=True) message = models.CharField(max_length=200) I want to filter for: message_list = Message.objects.filter(student=1) OR message_list = Message.objects.filter(student=Non

testclass

2009-03-08 Thread nenduvel
hi, I'm having a working django application. I want to see the values of my variables when I'm executing my code. something like JUnits containertest for java. I'm tried to test a method in my views.py code. The method is called generate_html( ). when i write a test class like:

Re: Foreign Key query question

2009-03-08 Thread Daniel Roseman
On Mar 8, 3:50 pm, Christoph Wegscheider wrote: > Hi, > I have the following model: > class Message(models.Model): >     student = models.ForeignKey(Student,  blank=True,  null=True) >     message = models.CharField(max_length=200) > > I want to filter for: > message_list = Message.objects.filter

Re: Foreign Key query question

2009-03-08 Thread Christoph Wegscheider
On 8 Mrz., 18:54, Daniel Roseman wrote: > On Mar 8, 3:50 pm, Christoph Wegscheider > > > > wrote: > > Hi, > > I have the following model: > > class Message(models.Model): > >     student = models.ForeignKey(Student,  blank=True,  null=True) > >     message = models.CharField(max_length=200) > >

Where to put jquery/dojo js files

2009-03-08 Thread raj
To make use of any popular js framework, I've the following settings: MEDIA_ROOT = '/home/raj/django/my_project/media' MEDIA_URL = '/media/' ADMIN_MEDIA_PREFIX = '/media/' After copying dojo.js to '/home/raj/django/my_project/media/js', I edit my custom made change_form.html to include the follow

Re: IntegrityError: columns app_label, model are not unique

2009-03-08 Thread He Jibo
Thank you so much for your detailed explanation. I have tried your suggestion of "The relatively simple solution that _might_ work (depending on the details of your project) is to remove references to contrib.auth and contrib.contenttypes in your fixture. " It seems to work. However, I confronted a

Re: Where to put jquery/dojo js files

2009-03-08 Thread Carlos A. Carnero Delgado
Hi there, On Sun, Mar 8, 2009 at 2:32 PM, raj wrote: > This causes a js error, stating no dojo is defined. Similar error is > raised for jquery also. What went wrong with the above code? Have you looked at http://docs.djangoproject.com/en/dev/howto/static-files/?from=olddocs? Maybe it helps...

Re: Dynamically default second form field from droplist value of another field in the same form

2009-03-08 Thread Alex Gaynor
You need to write some javascript to do this, using ajax probably. The technique for solving this on the client is orthagonal to django. Alex On 3/8/09, ldm999 wrote: > > I'd like to have a Django form with 2 fields: List Type droplist (eg > Books, Movies) and List Name text field. Ie: > > Li

Re: Where to put jquery/dojo js files

2009-03-08 Thread rajeesh
Yes, It worked. A l'll worried over their caution not to use it in production. Never mind if we use Apache or something else. Thanks Carlos. > Have you looked > athttp://docs.djangoproject.com/en/dev/howto/static-files/?from=olddocs? > Maybe it helps... > > Regards, > Carlos. --~--~---

Should I use Django?

2009-03-08 Thread Wiiboy
Hi guys, I'm making a small site (small for now, at least), that isn't quite finished yet. I'm the only one who is writing server-side code. Presently, I'm writing straight Python code, through CGI, on a shared hosting provider. Is there any reason why I should use Django on my site, on the Goog

Re: Should I use Django?

2009-03-08 Thread Antoni Aloy
2009/3/8 Wiiboy : > > Hi guys, > I'm making a small site (small for now, at least), that isn't quite > finished yet.  I'm the only one who is writing server-side code. > Presently, I'm writing straight Python code, through CGI, on a shared > hosting provider.  Is there any reason why I should use

Re: Should I use Django?

2009-03-08 Thread Wiiboy
> Is there any reason you should'nt? Plain CGI code sounds quite old > even for me ;) I'd have to rewrite everything. :( --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, se

Submitting two tables at once

2009-03-08 Thread AlexK
Hello, I'm relatively new to django and i've been trying to figure out this difficulty for a while now. I have a set of models that interact like so: A has many B. B has many C. I need to be able to submit a new A and a new B in a single post. C is referenced by a foreign key. I need to includ

Re: get_object_or_404 and foreignkey

2009-03-08 Thread Jamie Pittock
Thanks again. I'm still new to all this. On Mar 7, 9:37 pm, Daniel Roseman wrote: > On Mar 7, 8:21 pm, Jamie Pittock wrote: > > > Thanks Daniel.  Yeah it's just a way of getting the county so I'll try > > your second option.  Could you possibly point me to the docs that > > explain the double

Re: Should I use Django?

2009-03-08 Thread Antoni Aloy
2009/3/8 Wiiboy : > >> Is there any reason you should'nt? Plain CGI code sounds quite old >> even for me ;) > > I'd have to rewrite everything. :( It depens on your code. Perhaps you can reuse the logic and just write the urls and views. Just check Django, I think it's worth as it could make the p

Re: testclass

2009-03-08 Thread AlexK
On Mar 9, 2:01 am, nenduvel wrote: > hi, > > I'm having a working django application. I want to see the values of > my variables when I'm executing my code. something like JUnits > containertest for java. > > I'm tried to test a method in my views.py code. The method is called > generate_html( ).

Re: translating app name ... again

2009-03-08 Thread Ramiro Morales
On Fri, Mar 6, 2009 at 11:21 PM, Malcolm Tredinnick wrote: > > On Fri, 2009-03-06 at 07:01 -0800, patrickk wrote: >> so, now here´s a little tutorial for translating app-names throughout >> the admin-interface: > > Nice summary. :-) > >> 3. change app-names in index.html /// on line 18 replace {%

Re: Best way to trap IntegrityError in Django form?

2009-03-08 Thread Adam Jenkins
You can override the clean method on the for and have it raise the appropriate error for you. I've done the same thing before and came across the issue that the form doesn't know the current user. I ended up adding a user parameter to the init and passing it when I instantiated the form. Then I mad

Re: Should I use Django?

2009-03-08 Thread Wiiboy
It's all relatively simple stuff, I guess... Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this gr

custom filter question

2009-03-08 Thread danbergan
Hello - I'm using Django templates in my custom application (outside of the Django web framework.) I'm trying to use a custom filter in my template, but I can't seem to find a way to get django to find my custom filter. Has anyone used a custom filter outside of the framework? In my template:

Re: custom filter question

2009-03-08 Thread Malcolm Tredinnick
On Sun, 2009-03-08 at 14:11 -0700, danbergan wrote: [...] > I'm guessing that the problem is that, since I'm not running withing > django, I don't have anything set in "INSTALLED_APPS". Indeed. Template tag directories are only looked for in locations listed in INSTALLED_APPS. > I've tried > s

Re: loaddata spewing to standard output but not actually loading

2009-03-08 Thread Russell Keith-Magee
On Mon, Mar 9, 2009 at 12:35 AM, Serdar T. wrote: > > So I'm curious - Does loaddata check all directories on the PYTHONPATH > for the named fixture? Or does it only check for fixtures inside the > project directory where the loaddata command was executed? http://docs.djangoproject.com/en/dev/re

Re: Trouble with accents when passing tranlsated string with newforms

2009-03-08 Thread Malcolm Tredinnick
On Sun, 2009-03-08 at 04:55 -0700, Tipan wrote: > I'm trying to pass a translated string to a select box using a Forms > Select widget and it always presents the output string with all the > accent HTML entity codes. > > In my models file, I have a range of subjects: > > Models.py > from django.

Re: custom filter question

2009-03-08 Thread danbergan
On Mar 8, 4:53 pm, Malcolm Tredinnick wrote: > On Sun, 2009-03-08 at 14:11 -0700, danbergan wrote: > > [...] > > > I'm guessing that the problem is that, since I'm not running withing > > django, I don't have anything set in "INSTALLED_APPS". > > Indeed. Template tag directories are only looked

Re: Foreign Key query question

2009-03-08 Thread Malcolm Tredinnick
Take it as given that I agree with the bulk of Daniel's reply. It's correct. I have one quibble, however... On Sun, 2009-03-08 at 10:54 -0700, Daniel Roseman wrote: [...] > What do you mean by 'student=1'? Do you mean 'the student whose pk is > 1'? If so, the correct filter syntax for this on i

Re: custom filter question

2009-03-08 Thread danbergan
On Mar 8, 5:13 pm, danbergan wrote: > On Mar 8, 4:53 pm, Malcolm Tredinnick > wrote: > > > > > On Sun, 2009-03-08 at 14:11 -0700, danbergan wrote: > > > [...] > > > > I'm guessing that the problem is that, since I'm not running withing > > > django, I don't have anything set in "INSTALLED_APPS".

Re: Submitting two tables at once

2009-03-08 Thread Malcolm Tredinnick
On Sun, 2009-03-08 at 14:24 -0700, AlexK wrote: > Hello, > > I'm relatively new to django and i've been trying to figure out this > difficulty for a while now. I have a set of models that interact like > so: > > A has many B. > B has many C. > > I need to be able to submit a new A and a new B i

Re: custom filter question

2009-03-08 Thread Malcolm Tredinnick
On Sun, 2009-03-08 at 16:22 -0700, danbergan wrote: > On Mar 8, 5:13 pm, danbergan wrote: > > On Mar 8, 4:53 pm, Malcolm Tredinnick > > wrote: > > > > > > > > > On Sun, 2009-03-08 at 14:11 -0700, danbergan wrote: > > > > > [...] > > > > > > I'm guessing that the problem is that, since I'm not ru

simple order taking model

2009-03-08 Thread Mario Zorz
Hi Django-users list I'm trying to make a simple application for modeling the order-taking process for a restaurant. This is not real but it's supposed to model reality. So I have, basically, a list of products that people (end users) can buy, and I have an Order table (model) which relates one

Re: Submitting two tables at once

2009-03-08 Thread AlexK
On Mar 9, 10:32 am, Malcolm Tredinnick wrote: > On Sun, 2009-03-08 at 14:24 -0700, AlexK wrote: > > Hello, > > > I'm relatively new to django and i've been trying to figure out this > > difficulty for a while now. I have a set of models that interact like > > so: > > > A has many B. > > B has ma

Re: Submitting two tables at once

2009-03-08 Thread Malcolm Tredinnick
On Sun, 2009-03-08 at 17:15 -0700, AlexK wrote: [...] > > To make it a bit easier to view the code, i'll use dpaste: > Models > http://dpaste.com/hold/10157/ > Views > http://dpaste.com/hold/10159/ > Template > http://dpaste.com/hold/10160/ That template looks very scary. It would be very uncomm

Re: Submitting two tables at once

2009-03-08 Thread AlexK
On Mar 9, 10:32 am, Malcolm Tredinnick wrote: >         def my_view(request, ): >            a_fields = ['data_a'] >            b_fields = ['data_b'] >            if request.method == "POST": >               my_form = MyForm(request.POST) >               if my_form.is_valid(): >            

Re: Convenient way to get dynamic names for formset fields?

2009-03-08 Thread Jim
Does http://www.pointy-stick.com/blog/2008/01/06/django-tip-complex-forms/ help you out any? Jim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-use

Re: Submitting two tables at once

2009-03-08 Thread Malcolm Tredinnick
On Sun, 2009-03-08 at 17:31 -0700, AlexK wrote: [...] > I've tried implementing your advice, but it gives an error. That nice. Would you like us to just guess what the error is? And maybe guess what the form contains at the same time, since it's no doubt involved in the error? > > Here is the vi

Re: custom filter question

2009-03-08 Thread danbergan
On Mar 8, 5:39 pm, Malcolm Tredinnick wrote: > On Sun, 2009-03-08 at 16:22 -0700, danbergan wrote: > > On Mar 8, 5:13 pm, danbergan wrote: > > > On Mar 8, 4:53 pm, Malcolm Tredinnick > > > wrote: > > > > > On Sun, 2009-03-08 at 14:11 -0700, danbergan wrote: > > > > > [...] > > > > > > I'm gues

Re: Submitting two tables at once

2009-03-08 Thread AlexK
On Mar 9, 11:30 am, Malcolm Tredinnick wrote: > On Sun, 2009-03-08 at 17:15 -0700, AlexK wrote: > > [...] > > > > > To make it a bit easier to view the code, i'll use dpaste: > > Models > >http://dpaste.com/hold/10157/ > > Views > >http://dpaste.com/hold/10159/ > > Template > >http://dpaste.com

Re: Submitting two tables at once

2009-03-08 Thread AlexK
On Mar 9, 11:36 am, Malcolm Tredinnick wrote: > On Sun, 2009-03-08 at 17:31 -0700, AlexK wrote: > > [...] > > > I've tried implementing your advice, but it gives an error. > > That nice. Would you like us to just guess what the error is? And maybe > guess what the form contains at the same time,

Re: custom filter question

2009-03-08 Thread Malcolm Tredinnick
On Sun, 2009-03-08 at 17:37 -0700, danbergan wrote: [...] > > I changed the directory to "ea_app", and changed my settings.configure > to: > settings.configure(DEBUG=True, TEMPLATE_DEBUG=True, TEMPLATE_DIRS=("d:/ > current/ea_app/tpl","c:/python/tpl"), INSTALLED_APPS=("ea",)) The application nam

Re: TemplateSyntaxError on unicode strings

2009-03-08 Thread juanefren
Right I would mean 1.1 alpha. Looking with more details I found that error only appears when I use my class __str__ method, for example in my Address Class I have class MyClass(models.Model): string1 = models.CharField(max_length = 100, null=True) string2 = models.CharField(max_length = 1

Re: TemplateSyntaxError on unicode strings

2009-03-08 Thread Malcolm Tredinnick
On Sun, 2009-03-08 at 18:01 -0700, juanefren wrote: > Right I would mean 1.1 alpha. Looking with more details I found that > error only appears when I use my class __str__ method, for example in > my Address Class I have > > class MyClass(models.Model): > string1 = models.CharField(max_length

Re: custom filter question

2009-03-08 Thread danbergan
> > > > I changed the directory to "ea_app", and changed my settings.configure > > to: > > settings.configure(DEBUG=True, TEMPLATE_DEBUG=True, TEMPLATE_DIRS=("d:/ > > current/ea_app/tpl","c:/python/tpl"), INSTALLED_APPS=("ea",)) > > The application name has now changed to ea_app, so you'll need to

Re: custom filter question

2009-03-08 Thread Alex Gaynor
On Sun, Mar 8, 2009 at 8:56 PM, danbergan wrote: > > > > > > > > I changed the directory to "ea_app", and changed my settings.configure > > > to: > > > settings.configure(DEBUG=True, TEMPLATE_DEBUG=True, TEMPLATE_DIRS=("d:/ > > > current/ea_app/tpl","c:/python/tpl"), INSTALLED_APPS=("ea",)) > > >

continuously gathering feeds

2009-03-08 Thread adelevie
I am building an app that uses the python-twitter module (a python library for twitter's api). I want to gather data from the public timeline which is updated about every minute. I have a function that given a feed will store it in the db. What is a good approach to making it so this function runs

Re: continuously gathering feeds

2009-03-08 Thread James Bennett
On Sun, Mar 8, 2009 at 9:08 PM, adelevie wrote: > I am building an app that uses the python-twitter module (a python > library for twitter's api). I want to gather data from the public > timeline which is updated about every minute. I have a function that > given a feed will store it in the db. W

Re: continuously gathering feeds

2009-03-08 Thread Alex Gaynor
On Sun, Mar 8, 2009 at 9:08 PM, adelevie wrote: > > I am building an app that uses the python-twitter module (a python > library for twitter's api). I want to gather data from the public > timeline which is updated about every minute. I have a function that > given a feed will store it in the db.

Re: custom filter question

2009-03-08 Thread danbergan
On Mar 8, 7:57 pm, Alex Gaynor wrote: > On Sun, Mar 8, 2009 at 8:56 PM, danbergan wrote: > > > > > I changed the directory to "ea_app", and changed my settings.configure > > > > to: > > > > settings.configure(DEBUG=True, TEMPLATE_DEBUG=True, TEMPLATE_DIRS=("d:/ > > > > current/ea_app/tpl","c:/p

[slightly OT] Web deployment certification

2009-03-08 Thread Kenneth Gonsalves
Hi, I work with a Government department with a mandate to spread FOSS/OSS in both formal and non-formal education sector. We are planning to introduce a web deployment certification. A person may be a specialist in say RDBMS or design, but if he is able to deploy his applications (especially o

Re: [slightly OT] Web deployment certification

2009-03-08 Thread Alex Gaynor
On Sun, Mar 8, 2009 at 11:51 PM, Kenneth Gonsalves wrote: > > Hi, > > I work with a Government department with a mandate to spread FOSS/OSS in > both > formal and non-formal education sector. We are planning to introduce a web > deployment certification. A person may be a specialist in say RDBMS o

Creating a multi-column index

2009-03-08 Thread Matt Doran
Hi there, I'm porting another system across to Django, and I need to create a multi-column unique index. I previously used SQLObject which has a syntax for doing this. I came across this old post that said it wasn't possible and it referred to creating custom backend SQL. http://groups.googl

Re: Creating a multi-column index

2009-03-08 Thread Alex Gaynor
On Sun, Mar 8, 2009 at 11:58 PM, Matt Doran wrote: > > Hi there, > > I'm porting another system across to Django, and I need to create a > multi-column unique index. I previously used SQLObject which has a > syntax for doing this. > > I came across this old post that said it wasn't possible and

Re: Creating a multi-column index

2009-03-08 Thread Malcolm Tredinnick
On Sun, 2009-03-08 at 21:58 -0700, Matt Doran wrote: > Hi there, > > I'm porting another system across to Django, and I need to create a > multi-column unique index. I previously used SQLObject which has a > syntax for doing this. > > I came across this old post that said it wasn't possible and

Re: Use django.contrib.auth.login at root of site

2009-03-08 Thread joshm
Thanks that is pretty much exactly what I was looking for. I first tried it and didn't realize you were calling the login view...got it now though. Thx! On Mar 7, 1:55 pm, Alex Gaynor wrote: > On Sat, Mar 7, 2009 at 1:59 PM, jmat wrote: > > > I'm trying to figure out a way to use the django.c

pip install error for pinax 0.7.0

2009-03-08 Thread over.nine.k
after getting easy_install, git, bzr, and pip running in my windows environment, i run the code to download the pinax external apps C:\pinax-0.7.0>pip install --requirement requirements/ external_apps.txt and i get the error: C:\Python25\Scripts\pip-script.py run on 03/09/09 00:48:20 Downloadin

Can I set user=request.user automatically when using create_object Generic View?

2009-03-08 Thread Doug
I am writing a simple task management app in Django. I am trying to use the "create_object" generic view to allow a logged on user to create a new Task. It does work, but the form displays a drop-down for the Task's "user" field allowing the user to pick any user as the task's owner. This is bad.

Re: Creating a multi-column index

2009-03-08 Thread Matt Doran
Hi Alex + Malcolm, On Mar 9, 4:03 pm, Malcolm Tredinnick wrote: > On Sun, 2009-03-08 at 21:58 -0700, Matt Doran wrote: > > Hi there, > > > I'm porting another system across to Django, and I need to create a > > multi-column unique index.  I previously used SQLObject which has a > > syntax for do

How to create new User with Profile in elegant way

2009-03-08 Thread myst3rious
Hi, Working on a Django app, which requires profile for each subscribing user, I created a Profile model: class Profile(models.model): user = models.ForeignKey(User, unique=True) middlename = models.CharField(max_length=32, blank=True) gender = models.CharField(max_length=1, blank=True

Re: How to create new User with Profile in elegant way

2009-03-08 Thread Malcolm Tredinnick
On Sun, 2009-03-08 at 23:30 -0700, myst3rious wrote: > Hi, > Working on a Django app, which requires profile for each subscribing > user, I created a Profile model: > class Profile(models.model): > user = models.ForeignKey(User, unique=True) > middlename = models.CharField(max_length=32, b