Re: How do you write a django model that can crunch numbers and automatically populate another field with results?

2012-05-08 Thread Andy McKay
You can hook into the model signal so that when the model changes, you do you calculation and change your models. https://docs.djangoproject.com/en/dev/ref/signals/#django.db.models.signals.post_save -- You received this message because you are subscribed to the Google Groups "Django users"

limit row in change view

2012-05-08 Thread Nenad Cikic
Hello! I am trying to undestand how to limit visible rows in change view. It seems to me a common need, but can not find info in django docs. I am using the admin interface. So I have one model and his admin is something as: ordering =

How do you write a django model that can crunch numbers and automatically populate another field with results?

2012-05-08 Thread Mika
There's a more detailed version of this question where I've embedded graphics and explained my algorithm to make it more clear on stackoverflow. I haven't gotten a response on it yet so I thought I might come here and see if anyone can help me out.

Django Comment Moderation: Anything wrong with using "moderate_after = 0"?

2012-05-08 Thread Gchorn
I'm building a simple blog with class "Post" as follows: class Post(models.Model): title = models.CharField(max_length=1000) author = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') text = models.TextField(max_length=1) I'm trying to

Re: Filter by retirement age?

2012-05-08 Thread Nikolas Stevenson-Molnar
On your second attempt, the problem is that you are trying to call the datetime module, not the datetime class. Change it to datetime.datetime(...) and you should be fine there. _Nik On 5/8/2012 4:12 PM, Lachlan Musicman wrote: > Hola, > > I have a model Person with a dob = models.DateField() >

Filter by retirement age?

2012-05-08 Thread Lachlan Musicman
Hola, I have a model Person with a dob = models.DateField() I would like to filter by age - in particular only include people less than 60 years old. I am having no luck getting the syntax right and was looking for pointers? queryset=Person.objects.filter(dob__year__gte =

Open Django Central - June 8/9

2012-05-08 Thread Steve Holden
OK, anyone want to help build the broader Django community? Open Django Central is on June 8 and 9 - http://opendjango/central/ the registration site is open and the hotel is taking reservations at an amazingly low rate if you are flying in from elsewhere. Chicago locals please note I am flying

Re: server error occurred. Please contact the administrator.

2012-05-08 Thread Python_Junkie
I am not an expert on the csrf module, but the error is pointing towards this module. I am using 'django.middleware.csrf.CsrfViewMiddleware', with django 1.3 and app is working just fine. If I were you I would research this module in the django web page and focus on this module On Tuesday,

Re: Upload files without form

2012-05-08 Thread kooliah
As often happens to me, things are much less complicated than i figure out I loose hours running after UploadedFile, HttpRequest, etc. Finally, it was my fault, a wrong path Using os.path.join(settings.MEDIA_ROOT, 'images') create a new tree from static folder Using

Re: server error occurred. Please contact the administrator.

2012-05-08 Thread James Pyrich
CsrfResponseMiddleware was deprecated in Django 1.3, removed for 1.4. From the 1.3 code: DEPRECATED Middleware that post-processes a response to add a csrfmiddlewaretoken. This exists for backwards compatibility and as an interim measure until applications are converted to

Re: how to get text of a ChoiceField populated with ajax

2012-05-08 Thread Kurtis Mullins
cleaned_data should return the value of the field, not the index. Did you create your own clean__fieldname method? On Tue, May 8, 2012 at 11:35 AM, francescortiz wrote: > You have to make sure that the javascript code that populates the second > select box sets the value

Re: how to get text of a ChoiceField populated with ajax

2012-05-08 Thread francescortiz
You have to make sure that the javascript code that populates the second select box sets the value properly, or create a custom form validation (custom form/field clean methods). On Tuesday, May 8, 2012 5:59:19 AM UTC+2, HDayi wrote: > > hi people, > i am new to all of this. > i have a form

Question regarding Generic Foreign Keys and relations

2012-05-08 Thread David
I am trying to abstract a log app that I have made for my project to make it more DRY. In order to achieve this I have tried to implement Generic FKs class Modification(models.Model): content_type = models.ForeignKey(ContentType) object_id = models.PositiveIntegerField()

Re: Paramiko EOFErrors start to occur after a while

2012-05-08 Thread Kurtis Mullins
Hey, I'd take a look at these options if you want to stick with Django-Storages ( http://django-storages.readthedocs.org/en/latest/index.html listed on the top of the page). Otherwise, I wonder if you could use the hadoop fileystem or some other, similar distributed file system built for high

Re: server error occurred. Please contact the administrator.

2012-05-08 Thread azizmb.in
What version of django are you using? On Tue, May 8, 2012 at 6:11 PM, ritvik wrote: > Hey guys i am gettting "server error occurred. Please contact the > administrator."this message while i am running my django > application > > my application is not calling even

Re: How to use ImageField??

2012-05-08 Thread Phang Mulianto
you would use MEDIA_URL for calling the image path to be view in your template. and the image will be upload to the media root folder.. On Mon, May 7, 2012 at 8:35 PM, Boris Shemigon wrote: >

server error occurred. Please contact the administrator.

2012-05-08 Thread ritvik
Hey guys i am gettting "server error occurred. Please contact the administrator."this message while i am running my django application my application is not calling even any url please help me out this is my error log Traceback (most recent call last): File

Re: Django - Worldwide Developer Rates - Hourly Income - location and project duration specific

2012-05-08 Thread Raphael
LAST CALL 2 contribution. Hello djangos - once again: one last call to contribute. After this message almost enough people should have been notified about our try to collect worldwide django development project data to being able to publish useful statistics. We even are going to create

Re: Paramiko EOFErrors start to occur after a while

2012-05-08 Thread Phang Mulianto
Hi, i also have the script to sftp using python...run with cron every 30 mins, and suddently since last week, the eol errors come out.. i think this problem bcoz the sftp server.. are you trying rsync to transfer between host ? On Tue, May 8, 2012 at 6:31 AM, Tino de Bruijn

Re: Django Pagination Not Working!

2012-05-08 Thread Tom Evans
On Sun, May 6, 2012 at 10:56 PM, coded kid wrote: > I'm trying to paginate a page in order to display five statuses per > page. After inputting these codes, it fails to paginate. Below are the > codes for pagination and updating of status in my django app. > > > Views: > >

Re: Save Tweepy tweets in database

2012-05-08 Thread Aziz Bookwala
Hey You can go through the Django basic documentationon views. It should answer most of your questions. On Tue, May 8, 2012 at 4:43 PM, coded kid wrote: > creating the model is not a problem but the problem is

Re: Hooking into Django Sessions

2012-05-08 Thread Tom Evans
On Mon, May 7, 2012 at 7:48 AM, M Oklah wrote: > > Hello, > > Is it possible to hook into Django so that a user defined callback method is > executed each time a session expires? > > > Thanks, > > -Moe > Yes/no/maybe. Depends what you want to do. First of all, nothing

Re: Save Tweepy tweets in database

2012-05-08 Thread coded kid
creating the model is not a problem but the problem is how to make use of it in views.py. You have any idea? On Tuesday, 8 May 2012 11:19:27 UTC+1, coded kid wrote: > > I want to save users tweets in my db (MySQL) But I'm finding it > difficult to get how I will go about it. The main problem is

Re: Save Tweepy tweets in database

2012-05-08 Thread kenneth gonsalves
On Tue, 2012-05-08 at 03:19 -0700, coded kid wrote: > I want to save users tweets in my db (MySQL) But I'm finding it > difficult to get how I will go about it. The main problem is that, I > didn't create any models for it, I just input the below codes in my > views,since I'm getting users tweets

Re: system can not find specified path

2012-05-08 Thread Babatunde Akinyanmi
Hi theo, Why not show your settings.py file and the exact traceback On 5/8/12, AJAYI THEOPHILUS wrote: > I installed django with setup.py perfecctly but after configuring sqlite3 > database and running the syncdb command i received system can not find > specified path so i

Save Tweepy tweets in database

2012-05-08 Thread coded kid
I want to save users tweets in my db (MySQL) But I'm finding it difficult to get how I will go about it. The main problem is that, I didn't create any models for it, I just input the below codes in my views,since I'm getting users tweets through tweepy api. The question now is, how will I save

Re: inspectdb+oracle

2012-05-08 Thread Jani Tiainen
You're using old CX_Oracle (5.0.4) which is known to have issues with unicode. Try updating to 5.1.1 and see if problem persists. 8.5.2012 10:50, mapapage kirjoitti: I'm working on a django project on Ubuntu 10.04 with Oracle Database Server I use Oracle Database 10g xe universal

Re: Presentation Viewer on django

2012-05-08 Thread Jani Tiainen
To be able to do that you have to convert your presentation to something more generic that can be shown. Plain HTML and Flash are two popular formats to do that. For a free solution you can use (headless) openoffice/liberoffice to automatically convert your ppt to html/flash and then show it on

system can not find specified path

2012-05-08 Thread AJAYI THEOPHILUS
I installed django with setup.py perfecctly but after configuring sqlite3 database and running the syncdb command i received system can not find specified path so i uninstalled django but i kept getting the same message. -- You received this message because you are subscribed to the Google

inspectdb+oracle

2012-05-08 Thread mapapage
I'm working on a django project on Ubuntu 10.04 with Oracle Database Server I use Oracle Database 10g xe universal Rel.10.2.0.1.0 against cx_Oracle-5.0.4-10g-unicode-py26-1.x86_64 My db is generated by oracle 10gr2 enterprise edition (on Windows XP, import done in US7ASCII character set and

how to get text of a ChoiceField populated with ajax

2012-05-08 Thread HDayi
hi people, i am new to all of this. i have a form which has several selcet boxes. one is a ModelChoiceField gets school list from database. the other is only a ChoiceField and it's empty. when school is chosen i populate the ChoiceField using dajax. it works perfectly but... while validating