No POST data

2007-05-03 Thread tomass
I realise this is likely something trivial I am missing, and I'm aware of http://code.djangoproject.com/wiki/NewbieMistakes... However, I have a form that's set up like this: From: Calendar.setup({ inputField : "date_from", button : "date_from_cal" }); To: Calendar.setup({ inputField : "date_to"

Re: No POST data

2007-05-03 Thread tomass
Turns out it was the "disabled" directive in the form. Weird, as I'm pretty sure it works on other forms in other applications, but when I remove it, it works great. On May 3, 11:36 am, tomass <[EMAIL PROTECTED]> wrote: > I realise this is likely something trivial I a

Django SOAP server

2006-11-01 Thread tomass
Hi Folks, I'm interested in serving SOAP requests through Django. I've taken a look at the pages below, but I'm not sure what the current state of development is, as I couldn't get the example in 552 working. http://code.djangoproject.com/ticket/552 http://code.djangoproject.com/ticket/115 I ha

Re: Django SOAP server

2006-11-02 Thread tomass
Hi Jure, Thanks for the response. I've made the changes you suggest, but just have a few questions: - The urls.py file: the soapview.soap - does this refer to a file called "soapview.py" and then the "soap" portion refers to whatever the name you assign the SimpleSOAPView() function to? - How d

Login redirect

2006-11-12 Thread tomass
Hi Folks, I'd like to be able to log users in based on accounts in Django and then redirect them to a specific page after they've logged in. I'd also like to be able to do a similar thing for logouts. Can anyone help me out with this... Couldn't quite make sense of it from the documentation, beca

Re: Login redirect

2006-11-12 Thread tomass
Sorry, too quick off the mark there. Seems exactly what I need can be found here (basically just set up my own login/logout mechanism): http://www.djangoproject.com/documentation/authentication/#authentication-in-web-requests Thanks, Tom --~--~-~--~~~---~--~~ Y

Permissions question

2006-05-08 Thread tomass
Hi Folks, So I have a question about how best to implement a permission structure for an app I'm writing. The app is a way of automating running commands on different servers. So my command model looks like this: class Command(models.Model): command_type = models.ForeignKey(CommandType)

Re: Subclassing question

2006-05-08 Thread tomass
You may need to define the return value with the following: def __repr__(self): return "%s" % ('Whatever value you want to return, such as self.name') --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django use

Re: Template Tags in MR

2006-05-08 Thread tomass
No, never have --~--~-~--~~~---~--~~ 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 [EMAIL PROTEC

Re: Permissions question

2006-05-09 Thread tomass
So I decided the easiest way to do this was to add this to the top of my model: from django.contrib.auth.models import Group and then adding this to my class: group_perm = models.ManyToManyField(Group) Thanks, Tom --~--~-~--~~~---~--~~ You received this messag

Accessing request.user in urls.py

2006-05-09 Thread tomass
Hi Folks, The subject says it, really. Is there any way to access the request.user in the urls.py. Basically I want to pass the current user's id as an option to a generic view. I have a field in my model which is a ForeignKey on User, so each instance of the model is associated with a specific u

Re: Accessing request.user in urls.py

2006-05-09 Thread tomass
Great, 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 group, send email to [EMAIL PROTECTED]

ifequal string with spaces

2006-05-10 Thread tomass
Hi Folks, I'm not sure if this is a bug, but it seems like if I do a test with {% ifequal %} for a string with spaces in it, I get a TemplateSyntaxError: 'ifequal' takes two arguments. Here's my code: {% for tower in towers %} {% ifequal tower.country "United Kingdom" %} document.towers.elements

Flatpages shows "FlatPage object" instead of friendly name

2006-05-11 Thread tomass
In the Flatpages list in the admin interface by default I see "FlatPage object" instead of, for instance, the title or URL field. Ditto with Sites. Is this supposed to be this way? I realize I could create a wrapper around the object and use a def __repr__(self) to take care of this, but just wo

Re: Flatpages shows "FlatPage object" instead of friendly name

2006-05-11 Thread tomass
Great, glad to help out!! --~--~-~--~~~---~--~~ 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 [EMAIL

Runserver from 0.95 problems

2006-05-12 Thread tomass
Installed from subversion. Ran "django-admin.py startproject greenleaftech; cd greenleaftech; python manage.py runserver" and I get the following. Can anyone help out? Thanks, Tom python manage.py runserver Validating models... admin.logentry: 'user' has relation with uninstalled model User adm

Re: Runserver from 0.95 problems

2006-05-12 Thread tomass
Okay, so I try python manage.py syncdb and I get: Error: None couldn't be installed, because there were errors in your model: admin.logentry: 'user' has relation with uninstalled model User admin.logentry: 'content_type' has relation with uninstalled model ContentType Here is the contents of my

Re: Runserver from 0.95 problems

2006-05-13 Thread tomass
As you can see from my installed apps above, I don't have django.contrib.admin in there yet, and so the first item is satisfied. Also, I don't have django.contrib.flatpages or django.contrib.redirects. And in any case, I am using django-admin.py to generate all of this - I'm not modifying anythin

Re: Runserver from 0.95 problems

2006-05-13 Thread tomass
Found it. I had an old install that was overriding the settings. Not exactly sure how as it wasn't in the sys.path, but in any case I've moved the old directory and now it's all good. Thanks, Tom --~--~-~--~~~---~--~~ You received this message because you are sub

Post data for multi step form

2006-05-20 Thread tomass
Hi Folks, I'm sure there's a better solution for this, just not sure what it is... I have a 4 step form and I'm currently capturing all posted data between each step and then re-posting it through hidden input fields and recapturing it at each successive step. URL redirects won't quite work for

Dynamic template extension

2006-05-30 Thread tomass
Hi Folks, I'm wondering if there's a way to include dynamic (context) data in an {% extends %} statement. I don't seem to be able to do {% extends "base_{{ reseller }}_.html" %} for instance. Thanks, Tom --~--~-~--~~~---~--~~ You received this message because y

Re: Dynamic template extension

2006-05-31 Thread tomass
Great, this seems to work a treat! Thanks, Tom --~--~-~--~~~---~--~~ 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

Change cols and row in generic update page textarea

2006-06-06 Thread tomass
Hi Folks, Wondering if there's a way to specify how many rows and columns the generic update page uses for a textarea? It seems to default to 10 and 40, and I'd like to make this much larger. Thanks, Tom --~--~-~--~~~---~--~~ You received this message because y

Re: Change cols and row in generic update page textarea

2006-06-06 Thread tomass
This is for a generic view. I may have missed this in the doc, but how do I specify my html? I'm currently doing: EmailBody: {{ form.emailbody }} {% if form.emailbody.errors %}*** {{ form.emailbody.errors|join:", " }}{% endif %} And this is what punches out the: How can I control what co

Re: Change cols and row in generic update page textarea

2006-06-06 Thread tomass
But how do I show the value of the field in the textarea: is there such as thing as {{ form.emailbody.value }} or something? This is for an update form, so I need to display the current value Thanks, Tom --~--~-~--~~~---~--~~ You received this message because yo

Re: Change cols and row in generic update page textarea

2006-06-06 Thread tomass
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 group, send email to [EMAIL PROTECTED] For mo

How to debug MySQLdb issues

2006-06-09 Thread tomass
Hi Folks, I'm using PostgreSQL for my local database, but my application connects to a number of other databases to do some queries. I have written a DB abstraction module which I use to connect to PostgreSQL, MySQL and Oracle, which has worked fine for me in all situations (Django and otherwise)

Re: How to debug MySQLdb issues

2006-06-09 Thread tomass
I'll give that a try. Any ideas why it would work from the python interpreter and not from Django? I'll update on whether the suggested MySQL-python-1.2.1 fixes it. Thanks for the response. Tom --~--~-~--~~~---~--~~ You received this message because you are sub

Re: How to debug MySQLdb issues

2006-06-09 Thread tomass
Works a treat. Compiled from source... Thanks, Tom --~--~-~--~~~---~--~~ 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 g

Admin's User edit broken

2006-06-09 Thread tomass
Hi Folks, I just deleted a Group, and now whenever I try to edit a user within the admin interface I get the following error message: AttributeError at /opscenter/admin/auth/user/3/ 'bool' object has no attribute 'get' Request Method: GET Request URL: http://cscenter.uk.scansafe.

Re: Admin's User edit broken

2006-06-09 Thread tomass
I should mention that I got this error when running syncdb: Error: None couldn't be installed, because there were errors in your model: provisioning.email: At least one field in Email should have core=True, because it's being edited inline by user.User. Here's the appropriate models.py: from dj

Re: Presenting information from an external system

2006-06-09 Thread tomass
Another approach might be to simply run this as an independent process (from cron, or whatever) and use django's ORM from within that script to update the database which can then be viewed in your web app. I've done this quite successfully with some of my apps. --~--~-~--~~-

User editing/adding broken in Admin interface

2006-06-12 Thread tomass
Hi Folks, Can anyone help out with a broken part of the admin interface? I get this message if I try to edit a user: AttributeError at /admin/auth/user/1/ 'bool' object has no attribute 'get' Request Method: GET Request URL:http://example.com/admin/auth/user/1/ Exception Type:

Re: User editing/adding broken in Admin interface

2006-06-12 Thread tomass
It seems to be related to this in my models: from django.contrib.auth.models import User class Email(models.Model): owner = models.ForeignKey(User) ... ... If I comment out this line, I'm good. What's am I doing wrong here? --~--~-~--~~~---~--~~ You recei

Re: User editing/adding broken in Admin interface

2006-06-12 Thread tomass
I've changed it to email_owner, and I still get the same message... Incidentally, I don't have a model named owner, but changed it in case it was a reserverd word... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "

Re: Using DB module(s) in another app (twisted)

2006-06-12 Thread tomass
Don't see why you can't do just that. Is it not working for you, or are you just wondering if it's possible? I use the db_api outside of Django web apps with no problems... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gr

Re: User editing/adding broken in Admin interface

2006-06-12 Thread tomass
I changed the model name from Email to ProvEmail and that fixed it. Seems like this may be a bug related to the one you were mentioning. Thanks, Tom --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gr

Time field issues

2006-06-28 Thread tomass
Hi Folks, I've just tried to add a time field to one of my models, and then I ran: ALTER TABLE blah ADD COLUMN blah_blah TIME; UPDATE blah SET blah_blah='09:00:00' I restarted apache, and I can see my current entries are showing 9am correctly in the new "blah_blah" field, but when I try to add

Re: Time field issues

2006-06-28 Thread tomass
Turns out it's because I had "default='09:00' in my model. I guess it needs a time entry, not a string entry. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email t

Rich text editor with code snippets

2006-07-25 Thread tomass
Hi Folks, I'm wondering which rich text editors people are using in their apps, and if any of them (that have been successfully integrated into the admin app) have the capability to display code snippets. Basically, what I'm looking for is a code block to render in fixed width font and with all

Re: Rich text editor with code snippets

2006-07-28 Thread tomass
Thanks. Added in the extra Tiny MCE options (like the full screen one), and it works pretty well just using the tags. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Process forking issues

2006-08-17 Thread tomass
Hi Folks, I know this topic has been brought up a few times, but I have a slightly different issue here (I think). I have a backend process that runs a number of commands. It connects to the database (via the ORM) to check it's queue and then executes jobs. All fine and dandy. My problem is tha

Re: Process forking issues

2006-08-18 Thread tomass
Thanks, that's very helpful, and sounds very likely to be the problem. I'll give it a try and see what I can come up with... May take a little while but I'll post back once I have a resolution one way or the others. Cheers, Tom --~--~-~--~~~---~--~~ You received

Re: Process forking issues

2006-08-21 Thread tomass
Well, limited success. I was able to get the code working through closing the django db connection just after I'd forked my processes, but it seems that what I thought I was doing wasn't really what I thought I was doing. Essentially I wanted to be able to run multiple tasks simultaneously. I tho

Tag library not found

2005-10-19 Thread tomass
Hi Folks, Getting this strange error message on my admin login. File "/usr/lib/python2.4/site-packages/django/core/template/defaulttags.py", line 627, in do_load raise TemplateSyntaxError, "'%s' is not a valid tag library" % taglib TemplateSyntaxError: 'auth.log' is not a valid tag librar

Re: Tag library not found

2005-10-20 Thread tomass
Works a treat, thanks! Wonder if you've had a chance to take a look at this: http://code.djangoproject.com/ticket/480#preview Still seems to be bothering me... Thanks, Tom

Date issues

2005-11-07 Thread tomass
I'm getting the following error when I try to upload a photo: File "/usr/lib/python2.3/site-packages/django/core/meta/fields.py", line 327, in get_db_prep_save value = value.strftime('%Y-%m-%d') AttributeError: 'str' object has no attribute 'strftime' Here's my model: from django.core impo

manage.py vs. django-admin.py

2006-02-24 Thread tomass
Hi Folks, I have /usr/local/lib/python2.4/site-packages in my sys.path. I've added a symlink from my project directory (/home/mthaddon/jmon_code/jobmonitor) to /usr/local/lib/python2.4/site-packages/jobmonitor and in this folder I have the settings.py, manage.py and urls.py as well as my app dire

Re: manage.py vs. django-admin.py

2006-02-28 Thread tomass
Thanks, that seemed to do it. --~--~-~--~~~---~--~~ 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 [E

Customizing the admin interface

2006-03-03 Thread tomass
Hi Folks, I think there are two ways of doing what I want to do. Essentially what I want to do is be able to have read-only tables in the admin interface (these tables get populated from an external app), but I'd like the flexibility to be able to view the data in them from within the admin appli

Can't import view

2006-03-06 Thread tomass
Hi Folks, I have an application that I'd written in an older version of Django that I'm upgrading to 0.91 and for some reason I'm having problems with the views. Here's an excerpt from my urls.py (r'^admin/', include('django.contrib.admin.urls.admin')), (r'^jobmonitor/$', include('greenleaftech

Re: Can't import view

2006-03-07 Thread tomass
Thanks! Bit of a duffer with that one... --~--~-~--~~~---~--~~ 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

CSS issues

2006-03-09 Thread tomass
Hi Folks, I've copied the admin css to be used for my views, but I've added in this custom section which is a modified version of the FILTER COLUMN from changelist.css: /* FILTER COLUMN (CUSTOM VERSION) */ #changelist-filter-custom {position:absolute; top:0; right:0; width:180px; border-left:

Re: CSS issues

2006-03-11 Thread tomass
Great, works a treat! Thanks so much Tom --~--~-~--~~~---~--~~ 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, sen

ifequal issues

2006-03-13 Thread tomass
Hi Folks, I'm having some issues with {% ifequal %}. What I'm trying to do is have a drop down list remember the values that are sent on a get request that is sent to the same page. I pass the value of the variable (show_only in this case) back to the template, and then I have this statement in t

Re: ifequal issues

2006-03-13 Thread tomass
Great, thanks! I thought it might be something like this. Should have dug a little deeper... --~--~-~--~~~---~--~~ 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@go

Forking a new process

2006-04-25 Thread tomass
Hi Folks, I'm trying to fork a new process using os.fork(), and everything seems to be working well, except that I need to then reference django models from the forked process. This seems to mean I need to reimport all the relevant modules into the function that's running as a forked process, and

Re: Forking a new process

2006-04-25 Thread tomass
Well, basically I have processes that could take minutes to execute, and I'd like to background them, serve up a page showing the status, and then allow users to view the output once they've completed. Thanks, Tom --~--~-~--~~~---~--~~ You received this message b

Magic Removal syncdb error

2006-04-28 Thread tomass
Hi Folks, I'm trying out the magic-removal branch, and am trying to just create my database from scratch. When typing "python manage.py syncdb" I get: Traceback (most recent call last): File "../../django/magic-removal/django/bin/django-admin.py", line 5, in ? management.execute_from_comma

Re: Magic Removal syncdb error

2006-04-28 Thread tomass
Sure, here it is: from django.db import models import datetime SERVER_STATUS_CHOICES = ( ('A', 'Active'), ('I', 'Inactive'), ) COUNTRY_CHOICES = ( ('UK', 'United Kingdom'), ('US', 'United States'), ) class Country(models.Model): country_name = models.CharField(maxlength=2)

Re: Forking a new process

2006-04-28 Thread tomass
You know, I actually tried JobControl, and it looked like it was going to do exactly what I was after, but it seemed to be created extra processes that weren't being terminated correctly (for each "job" I kicked off, there were 2 extra apache processes). In the end I went with the idea of an indep

Re: Magic Removal syncdb error

2006-04-28 Thread tomass
Hi Malcolm, Thanks! I'm not getting that error any more, but am getting this: Error: None couldn't be installed, because there were errors in your model: admin.logentry: 'user' has relation with uninstalled model User admin.logentry: 'content_type' has relation with uninstalled model ContentType

Re: Magic Removal syncdb error

2006-04-28 Thread tomass
Thanks! Tom --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] Fo

Different versions of Django - apache virtual hosts

2006-04-28 Thread tomass
Hi Folks, Just wondering how I configure an apache virtual host to use a different version of Django. I've installed the magic-removal branch and have added the following to my virtual host config file, but I'm still getting an error message which indicates that it's using the 0.91 version of Dja

Template Tags in MR

2006-05-02 Thread tomass
Hi Folks, Just having a few problems getting custom template tags working in MR. I think I'm supposed to create a directory called templatetags in the directory that holds my models.py, then drop an __init__.py file into there and the file I want to import (in my case automator.py). However, I

Re: Template Tags in MR

2006-05-03 Thread tomass
Hi Adrian, I get no output/error messages when I try python automator.py. Here's the contents of the file: from django import template register = template.Library() @register.filter def bash_special(value): value = value.replace('[00;34m', '')