Re: django-admin.py cleanup large scale

2010-08-20 Thread Steve Holden
On 8/20/2010 9:44 PM, Russell Keith-Magee wrote: > On Fri, Aug 20, 2010 at 11:51 PM, bfrederi wrote: >> I just wanted to know if anyone had an opinion or whether running a >> django-admin.py cleanup on 40 million session rows might slow down or >> lock up the database. I

Re: How does Django handle auto-increment PK when a model is sharded horizontally into multiple databases?

2010-08-20 Thread Russell Keith-Magee
On Sat, Aug 21, 2010 at 8:09 AM, Andy wrote: > > So is there any way to write the database router to route the above > query? Other than explicitly naming the database -- not at present. Of course, given that you know your sharding scheme, you could use the router

Re: django-admin.py cleanup large scale

2010-08-20 Thread Russell Keith-Magee
On Fri, Aug 20, 2010 at 11:51 PM, bfrederi wrote: > I just wanted to know if anyone had an opinion or whether running a > django-admin.py cleanup on 40 million session rows might slow down or > lock up the database. I would like to do this cleanup ASAP, but I was >

Re: searching stackedinline fields via search_fields in admin

2010-08-20 Thread Karen Tracey
On Fri, Aug 20, 2010 at 4:54 PM, ringemup wrote: > The admin search isn't searching the ModelAdmin or Inline files, it's > searching the fields from the model. > > You can search a ForeignKey's fields by listing > 'foreignkeyfieldname__relatedmodelfieldname' in your

Re: debug=True changes behavior of admin "fields"

2010-08-20 Thread Ramiro Morales
On Tue, Aug 17, 2010 at 1:34 AM, Jerry Stratton wrote: > On Aug 16, 3:43 pm, Karen Tracey wrote: >> So yes, the ImproperlyConfigured error is something you will only get with >> DEBUG on. But I would expect that the effect of the problem it identified >>

Re: How does Django handle auto-increment PK when a model is sharded horizontally into multiple databases?

2010-08-20 Thread Andy
On Aug 19, 9:03 pm, Russell Keith-Magee wrote: > As for the instance not existing: Consider the following queries: > > MyModel.objects.filter(foo=bar) > > or > > MyModel.objects.update(foo=bar) > > These are read and write queries respectively, but neither has any >

model validation with admin.TabularInline

2010-08-20 Thread bagheera
Take a look into pool app from django tutorial. How can i make validation of Question model to have at least two Answer entered, if admin.TabularInline is used? http://docs.djangoproject.com/en/1.2/intro/tutorial02/#adding-related-objects -- Linux user -- You received this message

Re: jsonrpclib 403 error

2010-08-20 Thread adrian.w...@gmail.com
Hi Jani Thanks for the reply. My real aim was to get the Pyjamas examples working specifically the Jsonrpc example. The reason for the 403 error is that I am using Django version 1.2 which includes csrf, however I don't know how to get Pyjamas to generate the token from a manually created form

Re: Path mess

2010-08-20 Thread Shawn Milochik
If you set your environment variable DJANGO_SETTINGS_MODULE in the environment your script is running in, you need only add this line to your script (in addition to your model imports, of course). from django.conf import settings Otherwise you'll need to import the OS module in your script and

Re: Path mess

2010-08-20 Thread ringemup
You need your external program to do several things: 1) make sure django is on your PYTHONPATH (or within the Python script, on sys.path) 2) make sure your apps are also on the PYTHONPATH (or sys.path) 3) set the DJANGO_SETTINGS_MODULE environment variable in your shell or script Then you just

Re: searching stackedinline fields via search_fields in admin

2010-08-20 Thread ringemup
The admin search isn't searching the ModelAdmin or Inline files, it's searching the fields from the model. You can search a ForeignKey's fields by listing 'foreignkeyfieldname__relatedmodelfieldname' in your search_fields. So for example if you had the following models: class

searching stackedinline fields via search_fields in admin

2010-08-20 Thread gondor
Hello All, I'm wanting to add a field from my stackedinline form to my search_fields in admin. Does anyone know how to do that or point me in a general direction/sample code? Thanx Condor -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: __init__() got an unexpected keyword argument 'core'

2010-08-20 Thread Pankaj Singh
I am using django 1.2.1 -- -- -- -- Thanking You, Pankaj Kumar Singh, 3rd Year Undergraduate Student, Department of Agricultural and Food Engineering, Indian Institute of Technology, Kharagpur Website - http://www.IamPankaj.in Email - cont...@iampankaj.in ,

Path mess

2010-08-20 Thread clochemer
Hi everyone! It's my first question, and that's because I am totally lost. I am not a great Django developer (neither a good Python programmer) so I do not even know if I am doing the right things, let me explain... I have an external Python program which reads from a socket and depending on

Re: deserializing json

2010-08-20 Thread Reinout van Rees
On 08/20/2010 02:16 PM, irum wrote: Hi, I am trying to parse json, loop through it and access its data. At first I tried this: for obj in serializers.deserialize("json", p): a=2 response = HttpResponse()

Using all project URLs when using TestCase.urls?

2010-08-20 Thread Bryan
I've been trying to add the django-lean app to my project. I have not been able to get the tests to pass because of NoReverseMatch errors for named urls defined in other apps. It seems the issue is that the TestCase defines a value for urls: urls = 'django_lean.experiments.tests.urls' As

Re: __init__() got an unexpected keyword argument 'core'

2010-08-20 Thread Rolando Espinoza La Fuente
On Fri, Aug 20, 2010 at 12:40 PM, Pankaj Singh wrote: > I am gettign this error but as per documentation > http://www.djangoproject.com/documentation/0.96/model-api/#core this should > not be a problem > >

__init__() got an unexpected keyword argument 'core'

2010-08-20 Thread Pankaj Singh
I am gettign this error but as per documentation http://www.djangoproject.com/documentation/0.96/model-api/#core this should not be a problem http://code.google.com/p/django-openid-auth/source/browse/trunk/openid_auth/models.py pan...@pankaj-laptop:~/django_projects/mysite$ ./manage.py syncdb

Stockphoto

2010-08-20 Thread John S. Dey
Hi, I am new to django. The stockphoto app interested my but I have discovered that it is not current. I am working my way through it to upgrade--models seem to work but the forms in view still need updating. Has anyone updated the app? And if so, would you share with me. Thanks. John --

django-admin.py cleanup large scale

2010-08-20 Thread bfrederi
I just wanted to know if anyone had an opinion or whether running a django-admin.py cleanup on 40 million session rows might slow down or lock up the database. I would like to do this cleanup ASAP, but I was concerned it might cause some issues. -- You received this message because you are

Re: Newbie question about url and seo

2010-08-20 Thread Karim Gorjux
On Fri, Aug 20, 2010 at 18:19, David Euzen wrote: > Hello, > > you should think of it in terms of ressource, not of file. URLs are > about ressources not about files even if sometimes ressources are > files. Thanks for your answer. Was very useful! Have a nice day. --

Re: Validation error messages without post

2010-08-20 Thread JP
Here is my form code as well: from django import forms from django.contrib.auth.models import User from djangoproject1.authentication.models import UserProfile class UserForm(forms.ModelForm): class Meta: model = User fields = ('username','password','email',) class

Re: Newbie question about url and seo

2010-08-20 Thread David Euzen
Hello, you should think of it in terms of ressource, not of file. URLs are about ressources not about files even if sometimes ressources are files. Django's way to build URLs is flexible. URLs built this way can make much more sense that URLs built upon file path. ie

Validation error messages without post

2010-08-20 Thread JP
My main page contains a form. Because I want the form to appear when I load my page my view looks like this: from djangoproject1.authentication import forms from django.http import HttpResponseRedirect from django.shortcuts import render_to_response def main(request): uf = forms.UserForm()

Re: deserializing json

2010-08-20 Thread Bill Freeman
Have you tried looking at the raw data to see if it is what you expect (capture to a file or pdb.set_trace() is your friend)? Have you tried (assuming relatively recent python, >= 2.6 I think) loads from the json module? Bill On Fri, Aug 20, 2010 at 8:16 AM, irum wrote:

Re: Accessing model field validators from within form template

2010-08-20 Thread omat
Please see below. > Why do you use MaxLengthValidator instead of max_length property? max_length does not work for models.TextField > What are you using those values for? Couldn't it be a possibility to > use help_text attribute? It won't be DRY to repeat the value both as a parameter to the

deserializing json

2010-08-20 Thread irum
Hi, I am trying to parse json, loop through it and access its data. At first I tried this: for obj in serializers.deserialize("json", p): a=2 response = HttpResponse() response.status_code = 200 return response

Newbie question about url and seo

2010-08-20 Thread Karim Gorjux
Hi all! This is my first post here in the list, I'm new in django and python but I really found it fun and exciting so here we are! My first question is pretty simple. I noted that the url I create using urls.py are cleaned and pretty but there is no index.html or simila. It seems that every url

Re: jsonrpclib 403 error

2010-08-20 Thread Jani Tiainen
> I have python 2.5.4 installed along with Django-1.2.1 and am trying to > test jsonrpc using jsonrpclib. I have been following the Pyjamas > tutorial and have got to the point where Django is introduced. > > I have tried numerous different things but everything I try results in > a 403 error. I

Re: admin interface titles

2010-08-20 Thread emre can karabacak
Thanks a lot, =) On 20 Ağustos, 14:37, Steve Holden wrote: > On 8/20/2010 4:22 AM, emre can karabacak wrote:> I'm new to django, and > apparently django automatically adds an 's' to > > the ends of category titles i.e. Groups,Users, etc. but I have > > 'category' and other

Re: admin interface titles

2010-08-20 Thread Steve Holden
On 8/20/2010 4:22 AM, emre can karabacak wrote: > I'm new to django, and apparently django automatically adds an 's' to > the ends of category titles i.e. Groups,Users, etc. but I have > 'category' and other titles that end with a 'y'. so django turns these > into Categorys, etc. how can I fix

jsonrpclib 403 error

2010-08-20 Thread adrian.w...@gmail.com
I have python 2.5.4 installed along with Django-1.2.1 and am trying to test jsonrpc using jsonrpclib. I have been following the Pyjamas tutorial and have got to the point where Django is introduced. I have tried numerous different things but everything I try results in a 403 error. I have taken

admin interface titles

2010-08-20 Thread emre can karabacak
I'm new to django, and apparently django automatically adds an 's' to the ends of category titles i.e. Groups,Users, etc. but I have 'category' and other titles that end with a 'y'. so django turns these into Categorys, etc. how can I fix this? Is there a way to override the function that does

django-registration0.8 args on /activation/complete/

2010-08-20 Thread Alex
Hi, Thanks for great package - just stuck now on how to update app specific user profile on /activate/complete/ Although I have seen the code (re ln 80 in django-registration/ registration/views.py) I don't understand how to write the correct url pattern and view params to pick up the activated

Re: return json format

2010-08-20 Thread Torsten Bronger
Hallöchen! Imad Elharoussi writes: > I got readystate = 4 but status = 500 Is Django's setting DEBUG=True? If so, what does the error message page say? Tschö, Torsten. -- Torsten Bronger, aquisgrana, europa vetus Jabber ID: torsten.bron...@jabber.rwth-aachen.de

Re: Bind variables in Oracle backend - how to use them?

2010-08-20 Thread Tim Sawyer
Excellent, thanks Ian. It works a treat, post updated. Tim. > On Aug 19, 11:58 am, Tim Sawyer wrote: >> No, I don't think you're mistaken, especially if you want to use hints. >> >> I tried this code again today with the django database connection (using >> 1.2

Re: return json format

2010-08-20 Thread Xavier Ordoquy
Please, it is not the first time we ask you to describe as much as you can if you got an issue. We don't have access to your code and what you do before/after. Saying just "it doesn't work" could be because: - you didn't turn on your computer - you didn't started the dev server and a lot of

Re: return json format

2010-08-20 Thread Imad Elharoussi
I got readystate = 4 but status = 500 2010/8/20 Emily Rodgers > What goes wrong? > > On Aug 20, 10:34 am, Imad Elharoussi > wrote: > > It's not the case for me !!! > > > > 2010/8/20 Emily Rodgers > > > > >

Re: return json format

2010-08-20 Thread Emily Rodgers
What goes wrong? On Aug 20, 10:34 am, Imad Elharoussi wrote: > It's not the case for me  !!! > > 2010/8/20 Emily Rodgers > > > On Aug 20, 10:01 am, Imad Elharoussi > > wrote: > > > Hello > > > > How can we

Re: return json format

2010-08-20 Thread Imad Elharoussi
It's not the case for me !!! 2010/8/20 Emily Rodgers > On Aug 20, 10:01 am, Imad Elharoussi > wrote: > > Hello > > > > How can we return an object in a json format? > > > > it is like this : > > > > return

Re: return json format

2010-08-20 Thread Emily Rodgers
On Aug 20, 10:01 am, Imad Elharoussi wrote: > Hello > > How can we return an object in a json format? > > it is like this : > > return HttpResponse(simplejson.dumps(ihmAgentRoot), >                                     mimetype='application/json') > > or do we need an

return json format

2010-08-20 Thread Imad Elharoussi
Hello How can we return an object in a json format? it is like this : return HttpResponse(simplejson.dumps(ihmAgentRoot), mimetype='application/json') or do we need an other thing? thank you -- You received this message because you are subscribed to the

Re: Displaying images

2010-08-20 Thread Ivan
Do you write your own context processors? If yes, you need to add 'django.core.context_processors.media' in TEMPLATE_CONTEXT_PROCESSORS manually. TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.media', ) Cheers, Ivan On Fri, Aug 20, 2010 at 4:07 AM, Greg Pelly

Re: Using databrowse with a different ORM?

2010-08-20 Thread bruno desthuilliers
On 19 août, 11:29, Brianna Laugher wrote: > Hi, > > I have a read-only Oracle database that I'd like to use Django's > databrowse to, well, browse. However Django's primary key requirement, > along with my database being read-only, means I can't use Django's > default

Re: adding a summary field to a model

2010-08-20 Thread bruno desthuilliers
On 20 août, 00:32, widoyo wrote: > Try to add function 'quota_ore' below. > > On Aug 19, 3:03 am, djnubbio wrote:> Sorry for > wasting your preciuose time. I'm very newby in django. > > > I have de following > > > class Commessa(models.Model): > >

Re: adding a summary field to a model

2010-08-20 Thread djnubbio
yes you are right. Howto? On 19 Ago, 17:47, Mathieu Leduc-Hamel wrote: > But by the way you field seem to be a sum of some others, maybe it should > not be a new field but just a new method returing the resulting calculation > depending of the attributes of your instance. No

Re: adding a summary field to a model

2010-08-20 Thread djnubbio
in fact I DO NOT want denormilize On 19 Ago, 16:56, bruno desthuilliers wrote: > On 19 août, 16:25, Nick wrote: > > > You need to look at overriding the model's save method in order to add > > data from one field to another dynamically. > >

Re: adding a summary field to a model

2010-08-20 Thread djnubbio
Hu, denormalizing...it isn't best solution On 19 Ago, 16:25, Nick wrote: > You need to look at overriding the model's save method in order to add > data from one field to another dynamically. > > http://docs.djangoproject.com/en/dev/topics/db/models/#overriding-mod... > >

Re: adding a summary field to a model

2010-08-20 Thread djnubbio
tank very much, widoyo. It was what i was looking for...and It works. On 20 Ago, 00:32, widoyo wrote: > Try to add function 'quota_ore' below. > > On Aug 19, 3:03 am, djnubbio wrote:> Sorry for > wasting your preciuose time. I'm very newby in