How to retrieve "sms" for a user on Admin

2009-06-09 Thread David
Hi, I am in a position of "/admin/auth/user/", where it lists a user's username, e-mail address, first name, last name and staff status. The title of this page is "Select user to change". If I click a user's username, then I am transferred to "Change user" webpage. I checked /django/contrib/auth

Re: How to retrieve "sms" for a user on Admin

2009-06-09 Thread David
Actually I have already created a "userProfile" that extends User. In the "userProfile" I have "sms". However, this makes me have an extra table though it works. I just wonder if I should modify the original view or just use this userProfile to extend. On Jun

Re: How to retrieve "sms" for a user on Admin

2009-06-09 Thread David
Thanks Alex. Then I do not make any modifications. Have a great day. On Jun 9, 8:29 am, David wrote: > Actually I have already created a "userProfile" that extends User. In > the "userProfile" I have "sms".  However, this makes me have an extra > table

Can't get css working

2009-10-14 Thread David
/django-project/media_site/" MEDIA_URL = "/media_site/" ADMIN_MEDIA_PREFIX = "/media/" in the template base.html: blabla in urls.py: patterns('', (r'^media_site/(?P.*)$', 'django.views.static.serve', {'document_root'

Re: Can't get css working

2009-10-14 Thread David
Okt., 18:17, Jim McGaw wrote: > Hi David, > > I don't anything wrong with what you've typed. I have one suggestion: > use the os.path module from Python to avoid hard-coding the paths to > your project. Inside of settings.py, you could add: > > import os > # CURRE

How to start this dev server

2009-10-14 Thread David
Hello django community, I checked out a django project from svn and tried to start dev server, however I met d...@sgbr:~/nimma$ python manage.py runserver Error: No module named nimma d...@sgbr:~/nimma$ In my home directory I have nimma -> svn/nimma/trunk/ svn and "svn" is a work copy and lea

Re: How to start this dev server

2009-10-14 Thread David
-14 14:52 urls.py d...@sgbr:~/nimoy$ On Oct 14, 4:07 pm, Gregor Müllegger wrote: > Hi, > > please try to create an empty __init__.py file in your ~/nimma/ > directory. > > Gregor > > On 15 Okt., 00:50, David wrote: > > > > > Hello django community, > &

Re: Can't get css working

2009-10-15 Thread David
Thank you for the interesting discussion. Still, my original problem is bothering me. Any idea what I could do to narrow it down? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this g

Re: Can't get css working

2009-10-15 Thread David
;t tell whether the url wasn't found other the problem occured later on. Later it would try to find the file in the file system, in $PROJECT_DIR/media_site/style.css right? On 15 Okt., 21:38, Jim McGaw wrote: > Sorry, David, didn't mean to hijack your discussion! > > Looking ov

invalid sytax when naming url

2009-10-15 Thread David
(r'^admin/doc/', include('django.contrib.admindocs.urls')), (r'^admin/(.*)', admin.site.root), ) And My Error: ('invalid syntax', ('/home/david/project/cube/urls.py', 15, 41, "(r'^$', objec

Re: Can't get css working

2009-10-16 Thread David
hat won't work I'll comeback! would you try using a debugger? thanks anyway for all your help! On 15 Okt., 23:54, bruno desthuilliers wrote: > On 15 oct, 17:44, David wrote: > > > Thank you for the interesting discussion. > > Still, my original problem is bot

Re: invalid sytax when naming url

2009-10-16 Thread David
Ah great thanks! On Oct 15, 10:33 pm, Adam Olsen wrote: > On Thu, Oct 15, 2009 at 10:14 PM, David wrote: > > > I can't figure out why this is invalid syntax... > > You can't pass a keyword argument to a tuple.  It should read: > > url(r'^$', object_

Question about template

2009-10-16 Thread David
Hello, I would like to use if clause to check if a number is nagative or not with template in my html file. I read related part in Django template online document however I did not find what I need. Is it possilbe to do this with built-in Django filter functions? Or do I have to install a third-

Re: Question about template

2009-10-16 Thread David
Thanks Michael for your reply. What I need is to present money values to end users online. If the values are less than zero, then I need to put "-$" before them. Otherwise I just put "$" there. I will read your link and write a filter to do this. Thanks again. On Oct 16, 4:53 pm, "Michael P.

Re: Can't get css working

2009-10-17 Thread David
Finally I solved it, and my first suspicion of me being to stupid proved to be true. I've put my url-settings in the projects-url-file, instead of the app's. However, now I can sleep again :) Thanks everybody for looking into this, and at least I've learned about clean setting-files! --~--~

Re: Can't get css working

2009-10-17 Thread David
Finally I solved it, and my first suspicion of me being to stupid proved to be true. I've put my url-settings in the projects-url-file, instead of the app's. However, now I can sleep again :) Thanks everybody for looking into this, and at least I've learned about clean setting-files! --~--~

Re: Versionable Models?

2009-10-28 Thread David
is maintained and delivered as an app. Any expert's opinions? david On 28 Okt., 01:15, Mike Dewhirst wrote: > Todd Blanchard wrote: > > Total django noob here.  Rails/PHP/WebObjects refugee here. > > > I'm starting a project where some models need to be fully version

Re: models.py

2009-10-28 Thread David
can you explain a bit better? where do you want to insert? On 28 Okt., 00:46, Vman wrote: > how do i insert this: > > from django.contrib.auth.models import User > class Bookmark(models.Model): > title = models.CharField(maxlength=200) > user = models.ForeignKey(User) > link = models.ForeignKey(

Re: Versionable Models?

2009-10-29 Thread David
rrent_pony. or did i miss anything? david On 28 Okt., 17:01, hcarvalhoalves wrote: > On Oct 27, 4:54 pm, Todd Blanchard wrote: > > > > > Total django noob here.  Rails/PHP/WebObjects refugee here. > > > I'm starting a project where some models need to be fu

Best Practices: How to best implement Rating-Stars in Django Templates

2009-10-31 Thread David
I would like to have reusable ratings (typical layout with 5 stars). I have found this http://www.thebroth.com/blog/119/css-rating-stars that explains how to display this using css. For actually collecting the rating I was thinking of using an image map or maybe simple radio buttons. I would like

Re: Best Practices: How to best implement Rating-Stars in Django Templates

2009-11-01 Thread David
thank you very much. very interesting answers that will help me! David On 31 Okt., 17:54, Ethan Jucovy wrote: > Hey, > > I actually just did 5-star ratings for a project I'm working on, and have > been trying to figure out if I have anything reusable worth releasing as a >

urls.py generic views and foreign keys

2009-11-04 Thread David
Hello I have just started to learn Django. I have setup a Blog model, and an Entry model. I would like to use a generic view to list all of the entries in a given blog. The url to this should be /blog-slug/. I am unclear how I can bring up all of the entries for my blog, or rather how I can pas

Re: urls.py generic views and foreign keys

2009-11-04 Thread David
Thank you Daniel, that worked perfectly. --~--~-~--~~~---~--~~ 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 em

unique_for_date

2009-11-04 Thread David
Hello I was wondering if unique_for_date is not working or if I am not understanding how it is meant to be used. My model: class Entry(models.Model): title = models.CharField(max_length=255) content = models.TextField() pubDate = models.DateTimeField(auto_now=False,auto_now_add=True

Re: unique_for_date

2009-11-04 Thread David
Hi Alessandro I just tried converting pubDate to a DateField and it didn't solve the problem. Does unique_for_date apply to only the admin interface ? Or, just everything else ? I am testing this purely with the admin interface. Thanks --~--~-~--~~~---~--~~ You

Dictionary pagination

2009-11-04 Thread David
Hello, I just wonder if anybody has handled this before. Here is a 2-D dictionary. dict[key_1] = {'a':'aa', 'b':'bb', 'c':'cc'} dict[key_2] = {'a':'dd', 'b':'ee', 'c':'ff'} dict[key_3] = {'a':'eef', 'b': 'ff', 'c':'ghh'} Assume that this dict is so long that I need to paginate. Do

Re: Dictionary pagination

2009-11-04 Thread David
Thanks Bill. Your reply is quite helpful. On Nov 4, 12:01 pm, Bill Freeman wrote: > On Wed, Nov 4, 2009 at 1:32 PM, David wrote: > > > Hello, > > > I just wonder if anybody has handled this before. Here is a 2-D > > dictionary. > > > dict[key_1] = {&#

Re: unique_for_date

2009-11-04 Thread David
Hi Ramiro I'm using Django 1.1.1 --~--~-~--~~~---~--~~ 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

Comments & redirection

2009-11-05 Thread David
Hello Is it possible to redirect upon successful comment submission to the previous page when using Djangos built in render_comment_form ? Thank you --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gro

Ordering over ManyToMany relationship omits records

2009-11-26 Thread David
When I order over a ManyToMany relationship, certain records will not appear. The record which disappears changes depending on the order by which I sort it. Specifically: >>> Listing.objects.order_by("book__courses") gives me Listings with id's (5, 1, 3, 5, 2, 4), and >>> Listing.objects.order_

Re: Ordering over ManyToMany relationship omits records

2009-11-26 Thread David
as if the duplicate id "swallowing up" the missing records. I have no clue why though... hope these details help clarify my problem. On Nov 26, 1:31 pm, David wrote: > When I order over a ManyToMany relationship, certain records will not > appear. The record which disappears chan

How to call this function

2009-11-30 Thread David
Hello, In my template file I have {% for value in data %} {% endfor %} "showDomain(...)" is a JavaScript function. I would like this function to be called in each iteration of the for-loop when all_domain == 1. Anybody knows how to call this function? There are no events (click,

Re: How to call this function

2009-12-01 Thread David
Hello John and Daniel, thanks for your replies. Let me tell what I need in more details. {% for value in data %} ... {% endfor %} Here "showDomain(...)" is ajax. There are many lines of records on the webpage. If I click a line, then just below this line it shows doma

Re: How to call this function

2009-12-01 Thread David
Thanks Daniel. I am working in the way just as you said. On Dec 1, 10:21 am, Daniel Roseman wrote: > On Dec 1, 3:53 pm, David wrote: > > > > > > > Hello John and Daniel, thanks for your replies. Let me tell what I > > need in more detai

Passing data from view to template

2009-12-11 Thread David
hello, This is my first time to work in the Ajax filed. What I need to do is to pass an object from view to a javaScript function in template. The javaScript is Ajax. I have googled online and read some posts about json, ajax, etc, but I am still not quite clear. Can anybody tell me how to do thi

Re: Passing data from view to template

2009-12-11 Thread David
Hi Shawn, Thanks so much for your reply. Here is an example. I have a following dictionary in Python employees = { "accounting" : [ // accounting is an array in employees. { "firstName" : "John", // First element "lastN

Re: Passing data from view to template

2009-12-11 Thread David
Cool. Thanks Shawn! On Dec 11, 7:32 pm, Shawn Milochik wrote: > You don't need to transfer this to JavaScript once it's in JSON, which is a > JavaScript object. > > If you're using AJAX, it's dead easy. > > #use this in your view > return HttpResponse(simplejson.dumps(employees), mimetype="appli

Admin site - unticking a field stores date in model

2010-05-22 Thread David
Hello If I have a checkbox field for expiration, is there a built-in way I could store the date that this field is ticked in a datetimefield in the same model ? and also clear this entry when the checkbox is unticked ? Thank you -- You received this message because you are subscribed to the Goo

Re: Admin site - unticking a field stores date in model

2010-05-22 Thread David
Thank you Shawn :-) I'll give that a go. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.co

MultiValueField and MultiWidget

2010-06-02 Thread David
I created a MultiWidget, SelectDateTimeWidget, to allow date/time input with select boxes. I created a MultiValueField, SelectDateTimeField, to use this widget. I created a ModelForm, SubmissionForm, that uses this field. Here are the source files: * widgets.py: http://dpaste.com/hold/202352/ * fi

Re: Tutorial Help

2010-07-08 Thread david
Bradley, I think there's a typing error somewhere there, search for where you have pollsdjango within your script, you might have mistakenly join some text together. David On Jul 6, 4:56 pm, Bradley Hintze wrote: > Hi all, > > I am following the tutorial

Best way to get data into a HTML table?

2010-07-17 Thread david
Hello, Just learning about Django, and I would like to know what the best way to generate a table from my data, similar to what the "admin" app does. I attempted to dig into the source of the admin app, but I was unable to achieve much. I don't want to create a template that has for loops that l

Re: Best way to get data into a HTML table?

2010-07-17 Thread david
how the admin app did it. Thanks anyways, I will probably end up using this solution :) On Jul 17, 9:33 am, Carl Nobile wrote: > David, > > The best thing to do is use the Django docs, maybe do their tutorial. > > The link below should get you there: > > http://docs.dja

update_object generic view doesn't see model's get_absolute_url

2010-07-30 Thread David
I am using the generic view django.views.generic.create_update.update_object to edit a model. The form is displayed, the model gets updated, but on redirect, I get an ImproperlyConfigured exception. Django tells me I need to define a get_absolute_url method, but I already did, it just doesn't see

Re: update_object generic view doesn't see model's get_absolute_url

2010-07-30 Thread David
Solved. I used Django's traces to discover that the object wasn't being passed to the view on POST. Inserting some exceptions in different places in the source, I found that it was at the point the form was saved that the model reference was lost. Looking at the form I realized I wasn't returnin

Re: MySQL Newbie question

2010-08-16 Thread David
mysql_config is usually part of the MySQL client library (not to be confused with the Python/MySQL library). You can get the full mysql package from http://dev.mysql.com/downloads/mysql On Aug 16, 12:21 pm, Bradley Hintze wrote: > Hi all, > > I'm trying to install MySQL for Python on Snow Leopar

ModelName.objects.none().update() makes changes to db

2010-09-10 Thread David
if I do nothing = ModelName.objects.none() nothing.update(status='new_status') Then all of my objects in the database get updated. I would expect nothing to happen but... is an empty QuerySet really supposed to apply changes like that? -- You received this message because you are subscribed to

Django logging database changes

2010-10-10 Thread David
Hello I have a very simple app that I am writing that simply stores form data to a database. I can then scroll through and edit data stored in the database. I was wondering if there is a built in function that would enable me to log all data update/changes like the django admin history log does.

Pagination with bound form

2010-10-15 Thread David
Hello I need to be able to create a form that contains data from my database. It also needs to have basic pagination at the bottom of the form as there will be many records, and I would like my users to be able to use pagination to access them (kind of like MS Access). I can produce the form ok,

Re: Pagination with bound form

2010-10-15 Thread David
Hi Devin Thank you for your reply. I'm not sure if I've explained myself properly, or if I'm misinterpreting your reply. What I am aiming for is a form containing a single record. At the bottom of this form will be the pagination tools << Prev 1 2 3 etc. which will enable the user to navigate thr

Re: mysql and Django

2010-10-15 Thread David
I think there is some confusion here. I'm guessing you are using mysql- python v1.2.1 since a 1.x mysql version would probably date back to the mid to late 90s. Ask the admin if it is possible to upgrade mysql- python for which you do not need to upgrade MySQL itself or even take down the database.

Creating multiple related objects to a given QuerySet without evaluating the QuerySet

2010-01-04 Thread David
I have a QuerySet of Books, and I want to create an Action for each Book in that QuerySet. I want to avoid evaluating the Books QuerySet, but the only way I can think of doing what I want to do evaluates it. For example, def create_actions(books, action) books is a QuerySet of Book"""

Re: Creating multiple related objects to a given QuerySet without evaluating the QuerySet

2010-01-05 Thread David
Alright, thanks Daniel. On Jan 5, 1:12 am, Daniel Roseman wrote: > On Jan 4, 11:40 pm, David wrote: > > > I have a QuerySet of Books, and I want to create an Action for each > > Book in that QuerySet. I want to avoid evaluating the Books QuerySet, > > but the only way I

Editing ModelForm instance

2010-01-17 Thread David
When editing an object using ModelForm, the best way I know is def my_view(request): obj_id = request.POST.get('obj_id', '') old_object = MyModel.objects.get(pk=obj_id) form = MyModelForm(request.POST, instance=old_object) ... but I'm thinking the first two lines are a pain to wri

Mod Python ImportError

2010-01-19 Thread David
I'm getting an ImportError... I think it's a sys.path problem but I can't figure out what to do. Below are the details. Any help? ## Mod Python Error ## MOD_PYTHON ERROR ProcessId: 17855 Interpreter:'my_django' ServerName: 'cube.twusa.ca' DocumentRoot: '/var/www/html' URI:

Re: Select *Latest* Grade Information for every Student

2010-01-28 Thread David
In SQL, this would be (and I'm winging this right now so I might be slightly off) SELECT name, address, `date`, test_name, grade FROM Student as stu LEFT JOIN Grade ON stu.id = Grade.student_id WHERE `date` >= (SELECT max(`date`) FROM Grade WHERE student_id = stu.id) ORDER BY name Unless you

Re: how to redirect to another page in if else condition.

2010-02-09 Thread David
Generally, when you are redirecting, you usually aren't returning an HTTP status code of 200. Redirecting implies a status code in [300,400). You might want to take a look at the HttpResponse subclasses: http://docs.djangoproject.com/en/dev/ref/request-response/#httpresponse-subclasses However, if

Re: SQL Server 2008

2010-03-03 Thread David
using SQLAlchemy/Elixir with pyodbc. -David On Mar 3, 6:52 am, "Steven R. Elliott Jr" wrote: > Hello, > > I have been asked to write a front-end for an accounting system that will > allow business participating in certain benefits plans the ability to > receive and pay thei

Re: hi help regarding sharding

2010-03-10 Thread David
ly be writing a custom router to direct your traffic. -David On Mar 10, 2:41 am, chiranjeevi muttoju wrote: > Hi, > i want to use *Sharding* concept in for my project. i requirement is, i have > one user model, and i want to save users by selecting the random databases. > ie. i have

Re: custom authentication for admin

2010-03-10 Thread David
against a remote database. I'd look at the code for the remote user classes if that were the case. -David On Mar 9, 1:24 pm, Tim Arnold wrote: > Hi, > I've read about the custom authentication you can do so you can use > upstream validators for your views. And a snippet tha

Re: SQL Server 2008 and django

2010-03-11 Thread David
As the stackoverflow link states, pyodbc is the most advanced sql server library for python. Quite a few libraries use it like sqlalchemy. If you are using Django on Linux, your only options are django-pyodbc or use sqlalchemy outside of the Django ORM. If your environment is on Windows, you can al

Re: xmlrpc + 'django.contrib.auth.middleware.RemoteUserMiddleware' throws "Forbidden"

2010-03-26 Thread David
ubclass the RemoteUserMiddleware [3]. [1] http://docs.djangoproject.com/en/1.1/howto/apache-auth [2] http://code.djangoproject.com/ticket/10809 [3] http://docs.djangoproject.com/en/1.1/howto/auth-remote-user -David On Mar 26, 7:48 am, Simone Orsi wrote: > Hi *, > > I'm trying t

Re: xmlrpc + 'django.contrib.auth.middleware.RemoteUserMiddleware' throws "Forbidden"

2010-03-26 Thread David
r, I did not really like this solution for a variety of reasons. [1] http://docs.python.org/library/xmlrpclib.html#xmlrpclib.ServerProxy [2] http://github.com/samuraisam/django-json-rpc On Mar 26, 10:13 am, Simone Orsi wrote: > Hi David, Ale, thanks for your answers :) > > On 03/26/2

Generic Relations + Admin Interface

2007-07-03 Thread David
I was really excited about Rails. But however much it claims that it follows the DRY convention, I unfortunately do find myself repeating myself for things like the admin area of my site. That's why the Admin interface of Django has now become ever so much more appealing to me. Having spent a who

Re: Calling different Django sites from the same external application

2007-07-12 Thread David
call the relevant configure() method each time I need to use one of the APIs. Is that the only approach that will work for this? On Jul 11, 8:10 am, Robin Becker <[EMAIL PROTECTED]> wrote: > Hancock, David (DHANCOCK) wrote: > > We have two Django "projects" with distinct

I quit my job and now I'm making roughly 150 dollars a day! haha

2007-08-04 Thread David
About a month ago I quit my job at Hollister. I didn't quit it because I didn't like it there I quit because I was making about 150-200 dollars a day filling out opinion surveys for Nike. I mean seriously that's close to four times what I was making at Hollister. There are still job openings if an

Re: GeoDjango - error running GDAL tests

2008-01-06 Thread David
Excellent. I just updated to 7003 and the error message is gone. I really appreciate your taking the time to help me with this. Cheers! -- David Hancock On Jan 6, 6:01 pm, tlp <[EMAIL PROTECTED]> wrote: > Hello David, > > I was not able to reproduce the error on any Linux, Win

Re: How to get detailed tracebacks if DEBUG=False?

2008-04-10 Thread David
> > If you enter a valid email address in the ADMINS tuple of your > settings.py, any tracebacks will be emailed to you. > -- Yes, sorry, I should have been clearer. I'm not having a problem getting the tracebacks by email, but they contain much less data than the traceback screens do with DEBUG=

A couple questions about generated queries

2008-05-01 Thread David
I've been looking at our PostgreSQL logs, trying to track down a slowness issue, and I've got two questions. 1. Do queries that are created by the API use bind parameters? When I look in the logs I see the full text of the query and it includes the actual parameter. Perhaps that's simply just how

Re: Django and Comma-Formatting Numbers

2008-05-29 Thread David
I had need of commas in floating-point numbers, and slightly modified humanize.py with a floatcomma function: def floatcomma(value): """ Converts a float to a string containing commas every three digits. For example, 3000.65 becomes '3,000.65' and -45000.00 becomes '-45,000.00'. "

Model inheritance problem in admin

2008-07-14 Thread David
When I save objects from the admin pages, I get COPIES of what I'm saving. When I save them through the API, I don't get the duplicates. I'd like to know if I'm doing something wrong or misunderstanding something. Model: from django.db import models class Process(models.Model): process_name

Re: django vps hosting

2007-05-15 Thread david
It's not in Europe, but I've been using RimuHosting since December or so, and they've been great. The connection is fast, downtime is minimal, and their responses to support questions are always prompt. On Tue, 15 May 2007 15:12:24 -, urielka <[EMAIL PROTECTED]> wrote: > > I am running tw

Re: OT: Resources for converting MySQL data to PostgreSQL for Django

2007-05-26 Thread David
o use the InnoDB storage engine and thus have no foreign-key-constraint enforcement. It also seems like Django authors (in The Book at least) favor PostgreSQL. On May 26, 8:40 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sun, 2007-05-27 at 08:14 +0800, Russell Keith-Magee wrote: &

Re: OT: Resources for converting MySQL data to PostgreSQL for Django

2007-05-26 Thread David
My apologies. I am using 0.96, not an SVN checkout of recent vintage. I'll check out the two tickets mentioned (starting with 3324), and search tickets first from now on. On May 26, 9:46 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sat, 2007-05-26 at 18:02 -0700, Davi

Re: CSS problem

2007-11-09 Thread David
1'974 settings.pyc 09.11.2007 10:42 templates 18.10.2007 09:24 128 __init__.pyc dir media: 09.11.2007 10:54 images 14.08.2007 18:37 4'929 style.css I get the content of the html-file (in templates/myDir) but no style or images. I

Re: CSS problem

2007-11-09 Thread David
excuse me, can you explain this please? On Nov 9, 7:25 pm, pepe <[EMAIL PROTECTED]> wrote: > alert('x'); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dj

Re: CSS problem

2007-11-12 Thread David
Nobody that could help me? Do you need further information? On Nov 9, 7:16 pm, David <[EMAIL PROTECTED]> wrote: > I seem to have a similar (stupid) problem, which I just can't get: > (Though it's not the backslashes!) > > This is from my settings.py: > MEDIA_

Re: CSS problem

2007-11-13 Thread David
Thank you Lazlo, today your my hero! David --~--~-~--~~~---~--~~ 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

Invalid character error using Oracle backed

2006-08-05 Thread David
Django-0.95, with Oracle backend patch (latest: 3496?) applied. Python 2.4 on Linux Oracle XE and Oracle 10gR2 When I try to run syncdb using the Oracle backend, I reliably get the following error (last part of traceback only, let me know if I should post the whole traceback): File "django/db/

Re: ANN: Django site on washingtonpost.com

2005-12-05 Thread david
Very cool. Great to see. david. On 12/5/05, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > Check it out: The first Django app at washingtonpost.com! > > The U.S. Congress Votes Database > http://projects.washingtonpost.com/congress/ > > It lets you browse every vote

Re: How to view/run first app?

2006-03-21 Thread david
I'd suggest moving on through the tutorial, and, as the end of Tutorial 2 states, "When you're comfortable with the admin site, read part 3 of this tutorial to start working on public poll views." That's where you can start seeing the poll app's public view. "Playing with the API" actually = "lea

M2M Field addition for logging purposes

2012-03-20 Thread David
Hello I have a form for model test (code below) that saves correctly. I wish to add records to the modificationlog model every time an instance of test is saved. What should be saved is the logged in user and the time of the modification. The below is what I have tried to achieve this goal, but it

Re: M2M Field addition for logging purposes

2012-03-20 Thread David
In hindsight a m2m field was inappropriate and instead I have added a ForeignKey(Test) to the ModificationLog model. Then added: a = ModificationLog.objects.create(test=a, modifier=request.user) after the successful save of any Test instances -- You received this message because you are subsc

Django ORM - query help

2012-04-11 Thread David
class Log(models.Model): thing = models.ForeignKey(Thing) context = models.CharField(max_length=255) action = models.CharField(max_length=255) modifier = models.ForeignKey(User, limit_choices_to={'groups__in': [2]}) modified_on = models.DateTimeField(auto_now=True) class Thing(

Re: Django ORM - query help

2012-04-11 Thread David
Thanks for your reply. I am grateful for your help. If you remember this question when you feel less sleepy I'd be very interested to see the inner join alternative :) Thanks again -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this

Re: Django ORM - query help

2012-04-12 Thread David
Hi Jani That was very helpful. Is there a way to include select_related into that query? or do I have to list every single field I would like to return using values()? last_deleted = ModificationLog.objects.values('thing__id', ' thing __prefix', ' thing __first_name', ' thing__last_name', ' t

Re: Django ORM - query help

2012-04-12 Thread David
> > Hi Jani > > That was very helpful. Is there a way to include select_related into that > query? or do I have to list every single field I would like to return using > values()? > > last_deleted = ModificationLog.objects.values('thing__id', ' > thing__prefix', ' thing __first_name', ' thing__

Re: Django ORM - query help

2012-04-12 Thread David
Thank you akaariai That put me on the right track. Log.objects.distinct('thing__id').order_by('thing__id', '-modified_on').select_related().filter(thing__deleted=0)[:20] By avoiding the use of values() I was able to then use the result as an object and access everything I needed. The above OR

Form logic query

2012-04-23 Thread David
Hello Given the following models: CHOICES = ( (0, u'AM'), (1, u'PM'), ) class Person(models.Model): first_name = models.CharField(max_length=255) last_name = models.CharField(max_length=255) class PersonStuff(models.Model): person = models.ForeignKey(Person) stuff = mode

Multi object form

2012-04-24 Thread David
Hello I need to produce a form that will contain a series of rows. Each row will be a specific object. Columns for each row will have data that will need editting. ie: Person1 EditA EditB EditC Person2 EditA EditB EditC Person3 EditA EditB EditC Person4 EditA EditB EditC The form

Re: Multi object form

2012-04-24 Thread David
Thank you both for your replies. Having created a modelform and used: ArticleFormSet = formset_factory(ArticleForm, extra=2) I have a queryset that produces the objects I want to edit in my formset. How can I bind these objects to the formset and therefore remove the need for the extra=2 para

Re: Multi object form

2012-04-24 Thread David
Hi That is brilliant thank you! I've been struggling with this for too long :( MyModel Set = modelformset_factory(MyModel) formset = MyModelFormSet(queryset= MyModel.objects.select_related().filter(left_team__isnull=True).filter(team=pk)) variables = RequestContext(request, {

Re: Multi object form

2012-04-24 Thread David
Adding ,extra=0 to the modelformset_factory() line appears to do the job. Thanks for your help guys -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/aJyLcUk

Left Join

2012-04-26 Thread David
I have models similar to this: class Person(models.Model): first_name = models.CharField(max_length=255) last_name = models.CharField(max_length=255) class PersonAttendance(models.Model): person = models.ForeignKey(Person) worked_date = models.DateField() class PersonTeamLog(mode

Re: Left Join

2012-04-26 Thread David
Thanks Tom Not the end of the world. Just wanted to be sure I hadn't misinterpreted the ORM capabilities. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/

Raw SQL and modelformset

2012-04-27 Thread David
Hi I have a known working rawsql queryset that I am trying to use in my modelformset formset = ModelFormSet(queryset=q). When trying this I receive the following error: 'RawQuerySet' object has no attribute 'ordered' Can Raw SQL querysets be used for modelformsets? Thank you -- You received

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() content_obje

Re: Question regarding Generic Foreign Keys and relations

2012-05-10 Thread David
Just an update, the following got me on the right track. http://blog.roseman.org.uk/2010/02/22/django-patterns-part-4-forwards-generic-relations/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https:/

Distinct queries and order_by

2012-05-10 Thread David
Hello With a distinct query I understand the need to make the column that is required to be distinct the first column to order by. eg: lm = Modification.objects.select_related().distinct('object_id').filter( content_type=topic_ct ).exclude(action=2).order_by('object_id', '-m

Middleware order

2012-05-15 Thread David
Hi This is how my middleware is currently ordered: 'django.middleware.cache.UpdateCacheMiddleware', 'django.middleware.gzip.GZipMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMid

<    1   2   3   4   5   6   7   8   9   10   >