Re: Upgrade Confusion with ForeignKey

2015-06-05 Thread Tim Sawyer
*could* be the cause appreciated! Cheers, Tim. On Friday, 5 June 2015 23:04:00 UTC+1, Carl Meyer wrote: > > Hi Tim, > > On 06/05/2015 03:44 PM, Tim Sawyer wrote: > > I've just upgraded from a very old version of Django (1.4) up to 1.7.8, > > and some behaviour isn't h

Upgrade Confusion with ForeignKey

2015-06-05 Thread Tim Sawyer
I've just upgraded from a very old version of Django (1.4) up to 1.7.8, and some behaviour isn't how I expect. I may have missed something - I've not been keeping an eye on the framework changes. Two models, Venue and VenueAlias. VenueAlias has a ForeignKey to Venue, one venue has many

Re: howto Single Sign-On with django on windows

2012-11-17 Thread Tim Sawyer
See https://docs.djangoproject.com/en/dev/howto/auth-remote-user/#howto-auth-remote-user Tim. On 17/11/12 09:13, Anton wrote: Hi, I am using in windows 7 64bit: - python 2.7.3 32bit !! - django 1.4.2 If use my internet explorer in my company, it does an automatic login on some services.

Re: Consume Web Service

2012-11-08 Thread Tim Sawyer
I keep it simple and just create the XML manually. Works for me on simple services. http://drumcoder.co.uk/blog/2009/nov/23/running-soap-webservice-without-library/ Tim. On 08/11/12 21:26, Derrick Jackson wrote: Hi all, I have a web service that I need to consume. Do you have any

Re: WebService WSDL

2012-06-29 Thread Tim Sawyer
I did it manually, not using the WSDL. http://drumcoder.co.uk/blog/2009/nov/23/running-soap-webservice-without-library/ Tim. On 28/06/12 20:51, Anurag Chourasia wrote: Try using gSOAP if that fits your needs. http://www.cs.fsu.edu/~engelen/soap.html Regards, Guddu On Thu, Jun 28, 2012 at

Re: Graphs for my Django Application

2012-06-08 Thread Tim Sawyer
On 08/06/12 08:20, Tanveer Ali Sha wrote: Hello, How can I provide graphs in my djnago application.I wanna implement this for my Network Analysis Application . Can anyone give me idea how to provide graphs in Django. Thank Yo... Sha I've done this using flot. http://code.google.com/p/flot/

Re: This Week In History

2012-01-06 Thread Tim Sawyer
could do SELECT * FROM WHERE DATE_FORMAT(, "%u") = DATE_FORMAT(curdate(), "%u") dont know if there is a django orm way to do it, but could always use a raw query. Am 05.01.2012 21:14, schrieb Tim Sawyer: Hi Folks, Does anyone have a strategy for selecting from a dat

This Week In History

2012-01-05 Thread Tim Sawyer
Hi Folks, Does anyone have a strategy for selecting from a database where the date is this week, but a random year in the past? I have ~100 years of events in a database, each with a datefield - I would like to do a "this week in history" box that lists one or two on the homepage, randomly

Re: Oracle's SP OUT param

2012-01-05 Thread Tim Sawyer
This might help: http://drumcoder.co.uk/blog/2010/apr/23/output-parameters-cx_oracle-and-plsql/ Tim. > Hello. > Im trying to get Oracle SPs working in django. > > Procedure recives in_param and out_param > > in get_data function i do > > [code] > def get_data(self, in_param): > cursor =

Re: AW: Performance

2011-12-05 Thread Tim Sawyer
http://pypi.python.org/pypi/django-debug-toolbar will show the number of queries, time taken to query, and allow you to see the stack trace for the code that caused the query to be executed. Hope that helps, Tim. > On Dec 5, 2011, at 3:18 AM, Szabo, Patrick (LNG-VIE) wrote: > >> Okay that

Re: Retrieve object model admin userid & password?

2011-11-30 Thread Tim Sawyer
You can't retrieve the password, as that would be a security flaw. The security works by hashing the password entered into the login form, and comparing the hashed version with the one stored on the database. Hash functions are quick to run one way, but difficult to reverse, hence it's

Re: converting a large site to Django

2011-11-30 Thread Tim Sawyer
Do the pages that you're moving across to the new site need to be change-able through the admin system, or are they static HTML that won't change? Only use flatpages if you want them to be editable through the web. Tim. On 30/11/11 17:09, Juan de Dios Manjon Perez wrote: Try flatpages

Re: DJANGO_SETTINGS_MODULE problem

2011-11-15 Thread Tim Sawyer
I've done this. You should be able to startup the test server with --settings=client_settings/foo.py and get all of settings.py and HELLO available to you. What's not working? Tim. > Hi all, > > I don't understand something about DJANGO_SETTINGS_MODULE. My > intention is to serve several

Re: bar charts

2011-11-07 Thread Tim Sawyer
Flot. http://code.google.com/p/flot/ My docs about what I did: http://drumcoder.co.uk/tags/flot/ Example (including zooming by slider): http://brassbandresults.co.uk/bands/rothwell-temperance-band/ Enjoy, Tim. > hi, > > what do people use to display bar charts in their sites? > -- > regards

Virtualenv and Hudson/Jenkins

2011-09-20 Thread Tim Sawyer
Has anyone any instructions for using VirtualEnv with Hudson/Jenkins? Thanks, Tim. -- 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

Re: Norwegian Sorting

2011-09-13 Thread Tim Sawyer
> On Fri, Sep 9, 2011 at 10:18 PM, Tim Sawyer <list.dja...@calidris.co.uk> > wrote: >> Hi Folks, >> >> I have a django site which is against a postgres database which is UTF8. >>  I >> have a large droplist with international names in, and it do

Norwegian Sorting

2011-09-09 Thread Tim Sawyer
Hi Folks, I have a django site which is against a postgres database which is UTF8. I have a large droplist with international names in, and it doesn't appear to be sorting correctly. The list contains Ingvar Mæland and Børre Børresen. I'm told that the Norwegian sort order should be X Y Z

Re: satchmo project down?

2011-08-30 Thread Tim Sawyer
On 30/08/11 15:55, John Fabiani wrote: Hi, I can't get one the website. Johnf http://www.downforeveryoneorjustme.com/http://www.satchmoproject.com/ Tim. http://percussion360.com/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: Web development newbie

2011-07-24 Thread Tim Sawyer
On 24/07/11 16:22, fred.se...@sunrise.com wrote: The only area where I've really struggled is in building a SOAP api to conform to some vendor requirement. It's hard to figure out which python soap module is the right one (i.e. maintained and documented) while Java seems to have better tools.

OT: Drummers / Percussionists

2011-07-01 Thread Tim Sawyer
Hi Folks, I'm in the process of building a Django site to host my drum/percussion tutor books, and could do with some testers with multiple browsers and OSes to have a go and tell me what works and what doesn't. The site allows playback of the percussion music "karaoke" style - see the

Re: storing django object into javascript variable/array

2011-06-15 Thread Tim Sawyer
This might help: http://drumcoder.co.uk/blog/2009/nov/26/google-maps-django/ Tim. > Hello, > > I apologize for seeming too impatient or rude, actually I'm a bit in a > hurry > because I was given a project > and was told that it was urgent. I miscalculated how much time it was > going > to take

Re: Users not logging out

2011-06-07 Thread Tim Sawyer
Try putting: SESSION_EXPIRE_AT_BROWSER_CLOSE = True in your settings.py file. Tim. > I have the django auth system set correctly, my only problem is that > is if the user does not use the logout and just closes the browser, > they are still logged in. > > Any suggestions? > > -- > You received

Re: haystack

2011-05-12 Thread Tim Sawyer
Here's the instructions I wrote when I added search with Haystack and Whoosh to my site. http://drumcoder.co.uk/blog/2010/may/19/django-text-search-haystack-and-whoosh/ Hope that helps point you in the right direction. Tim. > hello friends, i want to use haystack for my website, > but i am

Re: Converting to UTF8

2011-03-02 Thread Tim Sawyer
On 02/03/11 21:50, Javier Guerra Giraldez wrote: On Wed, Mar 2, 2011 at 4:21 PM, Tim Sawyer<list.dja...@calidris.co.uk> wrote: However, my web page now gets Harry Størksen instead. looks like part of your stack is still interpreting utf-8 data as latin1 check that 1: the field 2: the t

Converting to UTF8

2011-03-02 Thread Tim Sawyer
Hi, I have a postgres database that is LATIN1. It contains extended characters, for example Harry Størksen. I dumped this out to a file: pg_dump -U dbuser db > db.sql and then ran iconv iconv --from-code latin1 --to-code utf-8 db.sql > db-utf8.sql and then imported into a database which

Re: Displaying a table and make its columns sortable

2011-02-17 Thread Tim Sawyer
On 17/02/11 20:18, Arun K.Rajeevan wrote: I've a table which stores unique ids for an object that I've to retrieve via SOAP( I've a url to a WSDL file) service calls. This table also contains some details like last access to this object from application etc. *What I need very badly and

Re: mis-named setting? SESSION_EXPIRE_AT_BROWSER_CLOSE

2011-01-31 Thread Tim Sawyer
> You can't stop the user from closing the browser, or switching to another > tab, with JS. And you shouldn't try to stop them navigating away - this > sort of thing is only likely to annoy them intensely. Taking this to the extreme - what do you want to happen if a person using your site has a

Re: Can I store full dates (mmddyyyy) and year-only dates (yyyy) in the same field?

2011-01-25 Thread Tim Sawyer
Hi Karen, I did with two fields - storing a date and a date resolution. The values could be: date / resolution - display value 1984-12-31 / Exact Date - 31st December 1984 1984-12-01 / Month - December 1984 1984-01-01 / Year - 1984 So I just used the first of the month where unknown, and

Re: Screen/Form Fields

2011-01-11 Thread Tim Sawyer
ly display the field? So do I make the field I want to display originally a hidden field and then change the type in the javascript or do I mkae the field originally a text input field, but somehow set it to be invisible initially? On Jan 10, 12:03 pm, Tim Sawyer<list.dja...@calidris.co.uk> wrote: O

Re: Screen/Form Fields

2011-01-10 Thread Tim Sawyer
On 10/01/11 17:44, hank23 wrote: First is it possible to conditionally hide a form field on a screen until an item from a dropdown box has been selected? If so how can that be done? Yes, but you'll have to use jQuery or similar and script it with JavaScript, so that when the droplist changes

Re: New to Django, sheet music organization site

2011-01-03 Thread Tim Sawyer
On 03/01/11 03:53, Kyle wrote: When I try to access my Object, I get an error "invalid literal for int() with base 10". I know it has something to do with ForeignKeys, but cannot find how to fix it. It helps if you post the full stack of the error - we can tell which line of code it came from

Re: Subdomain/Accounts

2010-12-29 Thread Tim Sawyer
]: There's an example of what is essentially this rule for Apache here: http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/ Tim Sawyer <mailto:list.dja...@calidris.co.uk> 29 December 2010 17:58 I did this with one settings.py per subdomain,

Re: Subdomain/Accounts

2010-12-29 Thread Tim Sawyer
I did this with one settings.py per subdomain, using the sites framework. So each settings.py had a different SITE_ID. Here's how to limit admin to a given user's records: http://drumcoder.co.uk/blog/2010/oct/02/user-specific-data-admin/ This helps with droplists in admin:

Re: Custom SQL questions

2010-12-20 Thread Tim Sawyer
On 20/12/10 00:10, Andy wrote: On Dec 19, 6:20 pm, Tim Sawyer<list.dja...@calidris.co.uk> wrote: I think so, yes. Something like this: You can then do something like anObjectA = ObjectA.objects.filter(id=1)[0] objectBs = ObjectB.objects.filter(object_a=anObjectA) This requ

Re: Custom SQL questions

2010-12-19 Thread Tim Sawyer
On 19/12/10 22:44, Andy wrote: On Dec 19, 5:06 pm, "Jonas H." wrote: On 12/19/2010 10:20 PM, Andy wrote: Is there a way to specify JOIN using the Django ORM? The 2 tables I'm joining aren't related through a foreign key. Why don't you use a relation field in your models

Re: PyDev Django Debugging

2010-12-17 Thread Tim Sawyer
manage.py, settings.py, urls.py, etc (2) is the "basesite" application. It contains only urls.py. models.py and media_urls.py at this time (no manage.py - not sure if this is the problem). Thank you. MLG On Dec 17, 4:51 pm, "Tim Sawyer"<list.dja...@calidris.co.uk

Re: PyDev Django Debugging

2010-12-17 Thread Tim Sawyer
Here's my instructions for debugging in PyDev, hope that helps: http://drumcoder.co.uk/blog/2010/apr/21/debugging-django-pydev/ This is done using the development server, not Apache, from within Eclipse. Does your app work in the development server? Tim. > Hi, > > I am new to Django trying to

Re: Apache & mod_wsgi are configured correctly. Need Django to recognize my django.wsgi file.

2010-12-11 Thread Tim Sawyer
Here's the config I'm using for mod_wsgi: http://drumcoder.co.uk/blog/2009/nov/21/apache-mod_wsgi-config/ Hope that helps, Tim. On 11/12/10 23:35, jc wrote: You definitely lost me in some places but you've also cleared some things up in the process. I also noticed that I had "", which is

Re: ORA-01425

2010-12-04 Thread Tim Sawyer
On 03/12/10 17:29, Ian wrote: On Dec 2, 3:17 pm, Tim Sawyer<list.dja...@calidris.co.uk> wrote: I unpatched mine (changed LIKEC to LIKE) and then ran: >>> from django.db import connection >>> cursor = connection.cursor() >>> result = cursor.execute(r&q

Re: ORA-01425

2010-12-03 Thread Tim Sawyer
On 03/12/10 12:52, Jani Tiainen wrote: On Thursday 02 December 2010 17:13:48 Tim Sawyer wrote: Hello, I'm using Django against an Oracle 10 database. It used to work. Then they upgraded it to 10.2.0.5 (not sure what from, I can probably find out). This query now gives: ORA-01425: escape

Re: Initial Create Table Script

2010-12-03 Thread Tim Sawyer
* instead of *./manage.py sql django.contrib.auth* Regards, Anurag On Fri, Dec 3, 2010 at 5:48 PM, Tim Sawyer <list.dja...@calidris.co.uk <mailto:list.dja...@calidris.co.uk>> wrote: Is there a way to generate a sql script that gets the entire table structure required for a dj

Initial Create Table Script

2010-12-03 Thread Tim Sawyer
Is there a way to generate a sql script that gets the entire table structure required for a django project? Including contrib.auth etc. ./manage.py sql django.contrib.auth is giving me: Error: App with label django.contrib.auth could not be found. Are you sure your INSTALLED_APPS setting is

Re: ORA-01425

2010-12-02 Thread Tim Sawyer
On 02/12/10 19:14, Jirka Vejrazka wrote: It looks as though something like that may be necessary. For those of you running into this problem, do you get the error with the following query? cursor.execute(r"SELECT 1 FROM DUAL WHERE TRANSLATE('A' USING NCHAR_CS) LIKE TRANSLATE('A' USING

Re: ORA-01425

2010-12-02 Thread Tim Sawyer
On 02/12/10 15:40, Jirka Vejrazka wrote: I'm using Django against an Oracle 10 database. It used to work. Then they upgraded it to 10.2.0.5 (not sure what from, I can probably find out). Hi Tim, sorry, I don't have a solution for you, but you might want to check out

Re: ORA-01425

2010-12-02 Thread Tim Sawyer
/backends/oracle/base.py?rev=12293 that regressed back to LIKE. http://code.djangoproject.com/ticket/11017 the reason. Tim. On 02/12/10 15:13, Tim Sawyer wrote: Hello, I'm using Django against an Oracle 10 database. It used to work. Then they upgraded it to 10.2.0.5 (not sure what from, I can

ORA-01425

2010-12-02 Thread Tim Sawyer
Hello, I'm using Django against an Oracle 10 database. It used to work. Then they upgraded it to 10.2.0.5 (not sure what from, I can probably find out). This query now gives: ORA-01425: escape character must be character string of length 1. 'SELECT

Re: Mobile website using Django

2010-11-18 Thread Tim Sawyer
If it helps, I've used iui and now jquery mobile with Django. http://code.google.com/p/iui/ http://jquerymobile.com/ Some random scribblings of mine on jQueryMobile here: http://drumcoder.co.uk/blog/2010/nov/12/jquery-mobile-basics/ Tim. On 18/11/10 20:51, Helge wrote: Hi I wish to develop

Re: Postgres LATIN1 to UTF-8

2010-11-12 Thread Tim Sawyer
On 08/11/10 07:03, Christophe Pettus wrote: On Nov 7, 2010, at 2:17 PM, Tim Sawyer wrote: Does anyone have a recommended method for converting a Postgres database from LATIN1 to UTF-8? Probably the most efficient way is to use pg_dump with the --encoding option: Dump the database in UTF8

Postgres LATIN1 to UTF-8

2010-11-07 Thread Tim Sawyer
Hi Folks, Does anyone have a recommended method for converting a Postgres database from LATIN1 to UTF-8? Am I best sticking to postgres tools or will dumpdata help? I already have accents in my LATIN1 data, and postgres doesn't like importing these back into a database with encoding utf8.

Re: Django and Flux

2010-10-18 Thread Tim Sawyer
> You cant combine Django and Flex Builder - but you can write apps using > Django and Flex. With Flex 3 (and maybe 4, I don't know) you could install it as an Eclipse Plugin, instead of standalone. You could then install pydev into Eclipse as well, and edit both sides of the app in the same

Re: django graphs

2010-10-06 Thread Tim Sawyer
I've used http://teethgrinder.co.uk/open-flash-chart-2/ and http://g.raphaeljs.com/ To do charts in a Django app. Tim. > ashy wrote: >> Hi All, >> >> I want to create line graph in django. I have installed django graphs, >> but there aren't sufficient examples for line graphs in the examples

Re: apache reload

2010-10-04 Thread Tim Sawyer
On Oct 3, 5:39 pm, Олег Корсак wrote: Hello. I'm using mod_wsgi 3.3 + apache 2.2.16 on Gentoo Linux box. Is it possible to make apache kinda "reload"/"re-read"/"re-compile" python files from my django code every time they are changed? Yes. You get get

Re: Adding help text to Django admin

2010-10-04 Thread Tim Sawyer
Set help_text on the appropriate model field name = models.CharField(max_length=100, help_text='Current name of band') Tim. On 04/10/10 09:46, Sithembewena Lloyd Dube wrote: Greetings folks, I need to add "help text" to a Django admin. Sort of like the text below fields in the Django

Re: Removing the 'site' (not the website/url) field from django-comments

2010-09-28 Thread Tim Sawyer
> Hi all, > > I'm trying to have comments on my sites shown on all other sites, as I > have a 'mobile' skin for my site on a separate domain and site_id. > > So for example: > Joe posts a comment on http://www.site1.mydomain.com > > Mary goes to http://www.mobilesite.mydomain.com and can see and >

Re: SITE_ID

2010-09-27 Thread Tim Sawyer
> On 25/09/2010 18:32, Tim Sawyer wrote: >> On 25/09/10 15:57, craphunter wrote: >>> Yes, I have read it, but I don't really get it. What is the meaning of >>> it? >> >> Consider a website that has multiple blogs, all of which are deployed to >> the sam

Re: error in urlconf

2010-09-25 Thread Tim Sawyer
On 25/09/10 21:14, bagheera wrote: Dnia 25-09-2010 o 22:04:16 Tim Sawyer <list.dja...@calidris.co.uk> napisał(a): On 25/09/10 20:39, CarloRatm wrote: http://pastebin.com/aY6tZm6j What's wrong with that code ? Thank you, cheers ^blog/ ^(?Pd+)$ should be ^blog/ ^(?P\d+)/$ ?? Tim.

Re: error in urlconf

2010-09-25 Thread Tim Sawyer
On 25/09/10 20:39, CarloRatm wrote: http://pastebin.com/aY6tZm6j What's wrong with that code ? Thank you, cheers ^blog/ ^(?Pd+)$ should be ^blog/ ^(?P\d+)/$ ?? Tim. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Django on Apache

2010-09-25 Thread Tim Sawyer
On 25/09/10 19:36, Derek wrote: on several occasions I've made changes to a view, and got a "cannot load page/no response" (from the browser, not a Django error). Once I quit the server (Control-C), start it up again and refresh the page, it works fine. I get that sometimes too - I think it's

Re: Django on Apache

2010-09-25 Thread Tim Sawyer
On 25/09/10 16:07, Derek wrote: I am about a week into learning Django, having developed with PHP and the CodeIgniter framework for the past 3 years. That said, I'm used to making a change to a file, refreshing my browser and seeing the results. Django's "syncdb" aside, it's been pretty weird

Re: SITE_ID

2010-09-25 Thread Tim Sawyer
On 25/09/10 15:57, craphunter wrote: Yes, I have read it, but I don't really get it. What is the meaning of it? Consider a website that has multiple blogs, all of which are deployed to the same database. Consider that you want each blog to be a separate URL: www.blog1.com, www.blog2.com,

Re: writing HTML Code into Template with render_to_response: How?

2010-08-25 Thread Tim Sawyer
On 25/08/10 13:36, mdolphin wrote: OK, that's probably a Newbee Question: My Code generates an HTML-Table, that I want to show up inside a {% block %} in my Template. All I get is an encoded output of my generated HTML-Sourcecode inside the Template. so i.e becomes tr and so on. How could I

Re: command python not recognized with syncdb

2010-08-25 Thread Tim Sawyer
Add your python directory to your PATH Control Panel/System/Advanced/Environment Variables You'll need to restart your DOS box to pick up the new PATH. Type SET in the DOS box to see the values. Tim. On 25/08/10 09:21, yotta wrote: Hi i am new on Djagon and i was fellowing the tutorial

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 <list.dja...@calidris.co.uk> 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 databa

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

2010-08-19 Thread Tim Sawyer
t;my" and yours solution suffer from the same defect imho -- that the ORM machinery of Django is unusable. We are back to manual mapping of rows onto objects... Or -- am I mistaken? Tim Sawyer-6 wrote: Friends, I'm in need of an implementation which calls for using bind variables (in Oracl

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

2010-08-18 Thread Tim Sawyer
Friends, I'm in need of an implementation which calls for using bind variables (in Oracle sense, not generic) in my SQL in a Django application. Any experience with that, anyone? Here's an example using bind variables to return output values from a PL/SQL block. >>> import cx_Oracle >>>

Re: javascript

2010-08-13 Thread Tim Sawyer
Yes myJavaScriptFunction( {{DjangoTemplateVariable}} ); function myJavaScriptFunction( pValue ) { ... } Tim. > Hi > Is it possible to give a javascript function a django variable as a > parameter? > thank you > > -- > You received this message because you are subscribed to the Google Groups

Re: accessing a dictionary in template

2010-08-09 Thread Tim Sawyer
On 09/08/10 19:56, owidjaya wrote: in php i can do this $some_mapping = array( "var1" : content_var1, "var2" : content_var2, ) for($i =1; $i< 3; $i++){ echo $some_mapping["var"+$i]; } can i do this in django

Re: Search Field on All Pages

2010-08-08 Thread Tim Sawyer
On 08/08/10 14:48, kostia wrote: To continue, Tim, do you use haystack? I passed its beginning tutorial and configured with xapian through haystack-xapian module. Now I'm discovering the other haystack docs and api. Not everything is clear. For example I have a user with name Bob. When I type in

Re: Search Field on All Pages

2010-08-08 Thread Tim Sawyer
What I do is to setup a search that works at /search/q=search_term, and then create a form on each page that submits to /search. This form is in my top level site template. The /search/ url is part of a search application. There's an example of this working at

Re: URL problem

2010-07-19 Thread Tim Sawyer
I think the problem is your regular expression: ^(?P\d{4})/(?P[a-z]{3})/(?P\w{1,2})/(?P\w+)/$ This says - four digits for a year (2010 - ok) - slash - three letters from a-z for month (jul - ok) - slash - one or two letters for day (11 - not ok, this should be \d{1,2}) - slash - slug, made up of

Re: No module named site - error deploying a django-jython war in tomcat

2010-07-16 Thread Tim Sawyer
I got around this problem by downgrading from jython 2.5.2beta1 to jython 2.5.1. Hope that helps! Tim. On 15/07/10 22:47, Jose Flores wrote: Hi guys, Any workaround on this issue? Regards, Jose On Jul 8, 2:43 pm, Rafael Nunes wrote: Same problem here. Any

subprocess.Popen breaks dev server

2010-06-18 Thread Tim Sawyer
Hi Folks, I have code that does this: lCommand = ["hg","history", "-r", "%s:%s" % (pFrom, pTo)] lProcess = subprocess.Popen(lCommand, stdin=subprocess.PIPE, stdout=subprocess.PIPE) in a view. When using the dev server, I'm quite often getting a blank page instead of my HTML, and for each

Re: Oracle cursor.execute problem

2010-04-29 Thread Tim Sawyer
Excellent, I'll give trunk a go. Thanks Ian. Tim. Ian wrote: On Apr 27, 2:36 pm, Tim Sawyer <list.dja...@calidris.co.uk> wrote: Hmm, nearly. That gets around the error, but the return value isn't populated. >>> import cx_Oracle >>> from django.db impor

Re: Oracle cursor.execute problem

2010-04-27 Thread Tim Sawyer
Ian wrote: On Apr 25, 11:13 am, Tim Sawyer <list.dja...@calidris.co.uk> wrote: >>> import cx_Oracle >>> from django.db import connection >>> cursor = connection.cursor() >>> lOutput = cursor.var(cx_Oracle.STRING) >>> cursor.execute(

Re: Oracle cursor.execute problem

2010-04-25 Thread Tim Sawyer
Ian wrote: On Apr 23, 1:59 pm, Tim Sawyer <list.dja...@calidris.co.uk> wrote: Hello. This code works fine: >>> import cx_Oracle >>> lDsn = cx_Oracle.makedsn(lDatabaseHost, int(lDatabasePort), lDatabaseName) >>> lConnectString = "%s/%...@%s" %

Oracle cursor.execute problem

2010-04-23 Thread Tim Sawyer
Hello. This code works fine: >>> import cx_Oracle >>> lDsn = cx_Oracle.makedsn(lDatabaseHost, int(lDatabasePort), lDatabaseName) >>> lConnectString = "%s/%...@%s" % (lDatabaseUsername, lDatabasePassword, lDsn) >>> lConnection = cx_Oracle.connect(lConnectString) >>> cursor =

Feeds from the Tag Framework

2009-12-19 Thread Tim Sawyer
Hi Folks, The complex example of an Atom feed (http://docs.djangoproject.com/en/1.1/ref/contrib/syndication/#a-complex-example) is based on a model where it's possible to work out from a single element in the feed (in this case a Crime), what the driving object is (a Beat). So there's a

Re: how to import a library in only in django project

2009-11-25 Thread Tim Sawyer
Hi Amit, It depends how you're running. If you're using ./manage.py testserver, then change manage.py to add in your new path. If you're using mod-wsgi, then change the site-wsgi.py file: import os, sys sys.path.append('/home/path/to/add') os.environ['DJANGO_SETTINGS_MODULE'] =

Re: Django with GXmlHttp

2009-11-25 Thread Tim Sawyer
Not quite sure what you're looking for, but I've used google maps with django, without using GeoDjango. http://www.brassbandresults.co.uk/map/ The script used in this page is here: http://www.brassbandresults.co.uk/map/map_script.js which is generated using this template: function

Redirects on HTTPS

2009-10-26 Thread Tim Sawyer
I still can't get this to work (original thread at http://groups.google.com/group/django-users/browse_thread/thread/cdece5ef2e7fd280). I'm looking to get a HttpResponseRedirect in my django app to redirect to HTTPS not HTTP. I've tried: * proxy server Apache (the one doing the SSL) does:

Redirects on HTTPS

2009-10-22 Thread Tim Sawyer
Hi, I have a django app that works fine using http. We have a requirement to serve the entire site using https, which is being done at the proxy level - so the Apache that my django is running inside (mod_wsgi) doesn't know about the https. I have a problem with using HttpResponseRedirect -

onkeyup event on form field

2009-07-09 Thread Tim Sawyer
Hi, I'd like to add an onkeyup event on a form field. I've defined the following in my form: contest = forms.CharField(max_length=100, widget=forms.TextInput(attrs={"onkeyup" : "lookup(this.value,'id_contest');",} ) ) This comes

Re: Anyway to render a template without inheritance?

2009-06-22 Thread Tim Sawyer
Yes, just don't do the extends and include all the HTML you need in the template. Tim. > > Hello. > > Is there any way to render a template, omitting the "extends" tag? > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: django-reversion with recent svn django

2009-06-02 Thread Tim Sawyer
. On Tuesday 02 June 2009 22:01:26 Tim Sawyer wrote: > Hi, > > I'm using django svn 10784, and I've just added django-reversion, latest > svn version from trunk (198). I'm using the middleware option for django- > reversion. > > It's not working, and I'm getting the followi

django-reversion with recent svn django

2009-06-02 Thread Tim Sawyer
Hi, I'm using django svn 10784, and I've just added django-reversion, latest svn version from trunk (198). I'm using the middleware option for django- reversion. It's not working, and I'm getting the following error. I've tried with the same django version and the tagged 1.1.1 release of

Re: user.is_authenticated

2009-06-01 Thread Tim Sawyer
You need a RequestContext for the user object to be available in templates http://lincolnloop.com/blog/2008/may/10/getting-requestcontext-your-templates/ I use a render_auth method instead of render_to_response, which automatically adds the RequestContext to all of my templates. Tim. On

Re: Newbie Django 1.0 help with create object, uopdate object

2009-06-01 Thread Tim Sawyer
clicked. The various "print" commands operate as expected. However, > the validation fails and a form with no data is returned with > "required data" labels. I conclude the line: > form = PropertyForm(request.POST) > does not populate the validation form. What ha

Re: Newbie Django 1.0 help with create object, uopdate object

2009-06-01 Thread Tim Sawyer
On Monday 01 June 2009 01:38:30 adelaide_mike wrote: > I found a really clear explanation of creating and updating database > objects in SAMS TeachYourself Django, but it appears to be for v > 0.96. > > I have looked at "Creating forms from models" in the documentation, > and about one-third the

Re: Oracle and Primary Keys

2009-05-19 Thread Tim Sawyer
On Tuesday 19 May 2009 16:20:58 Karen Tracey wrote: > On Tue, May 19, 2009 at 10:51 AM, Tim Sawyer wrote: > > It hasn't created a sequence/trigger for the primary key. Why is this? > > It does work for tables that have an implicit primary key (ie not > > specified in th

Oracle and Primary Keys

2009-05-19 Thread Tim Sawyer
Hi, I have a django model that looks like this: class Lender(models.Model): id = models.IntegerField(primary_key=True, db_column='lse_serial') version = models.IntegerField(db_column='lse_version') name = models.CharField(max_length=50, db_column='lse_lender') uri =

Re: I/O operation on closed file

2009-05-14 Thread Tim Sawyer
On Tuesday 12 May 2009 21:28:35 Alex Gaynor wrote: > On Tue, May 12, 2009 at 3:27 PM, Tim Sawyer wrote: > > ValueError: I/O operation on closed file > > This is probably a symptom of http://code.djangoproject.com/ticket/11084 . > Thanks Alex. I've just updated to 10

I/O operation on closed file

2009-05-12 Thread Tim Sawyer
Hi, I'm getting the following error uploading images to my gallery using the admin site, written in django (full stack at bottom of mail) ValueError: I/O operation on closed file It doesn't always happen, and it;s more likely to occur using "Save but keep editing" in the admin. I'm using

Re: ForeignKey Select List Filter

2009-05-08 Thread Tim Sawyer
Will this do? http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey.limit_choices_to You could always fallback on doing the droplist manually. Tim. On Friday 08 May 2009 14:23:36 cfiles wrote: > Still stuck on this one. Does anybody have any ideas? > > On Apr 29,

Re: save_formset in admin

2009-05-08 Thread Tim Sawyer
On Friday 08 May 2009 12:39:59 Alex Gaynor wrote: > On Fri, May 8, 2009 at 1:38 PM, Tim Sawyer <list.dja...@calidris.co.uk>wrote: > > Hi, > > > > > > I'm overriding save_formset in a subclass of ModelAdmin. This worked fine > > using svn 9382, but

save_formset in admin

2009-05-08 Thread Tim Sawyer
Hi, I'm overriding save_formset in a subclass of ModelAdmin. This worked fine using svn 9382, but I've just updated to svn 10674 and it's not working. def save_formset(self, request, form, formset, change): """ Stamp the model as last changed by the current user Set the

Re: to_field in model not working

2009-02-12 Thread Tim Sawyer
On Thursday 12 February 2009 01:47:31 Malcolm Tredinnick wrote: > On Wed, 2009-02-11 at 10:45 +0000, Tim Sawyer wrote: > > Hi, > > > > We're building an application with django on top of a legacy database and > > we've hit a problem with a to_field option being ign

to_field in model not working

2009-02-11 Thread Tim Sawyer
Hi, We're building an application with django on top of a legacy database and we've hit a problem with a to_field option being ignored. We've reproduced it with the latest svn version of django and a different database (oracle -> sqllite) Our model includes: uas_use_oracle_user =

Fwd: Re: Class coverage report for automated tests in django apps

2009-02-06 Thread Tim Sawyer
I'm doing that using coverage.py, I based my solution on these blog posts: http://siddhi.blogspot.com/2007/04/code-coverage-for-your-django-code.html http://siddhi.blogspot.com/2007/07/django-code-coverage-followup.html Cheers, Tim. -- Forwarded Message -- Subject: Re:

Re: DateField comparison with date.today()

2009-01-30 Thread Tim Sawyer
On Wednesday 28 January 2009 04:34:50 Malcolm Tredinnick wrote: > On Tue, 2009-01-27 at 22:03 +0000, Tim Sawyer wrote: > > Hi, > > > > I have a model that includes: > > > > from datetime import date as pydate, datetime > > > > date = models.Dat

DateField comparison with date.today()

2009-01-27 Thread Tim Sawyer
Hi, I have a model that includes: from datetime import date as pydate, datetime date = models.DateField() I've overridden delete to do: def delete(self): ... if self.date < pydate.today(): Notification.process(None, self, 'Event deleted') and that works fine If

  1   2   >