Re: Weird get_or_create error

2007-05-01 Thread Andy Dustman
On 5/1/07, Brandon Low <[EMAIL PROTECTED]> wrote: > > How can a get_or_create cause an integrity constraint error? Also... It's hard to see exactly what's going on because the code in the traceback is using **kwargs. If you use get() or get_or_create(), it's looking for a match on all the paramet

Re: Why are my FloatFields strings ?

2007-05-01 Thread Andy Dustman
On 5/1/07, Chris Brand <[EMAIL PROTECTED]> wrote: > > I've got a model that includes FloatFields as well as IntegerFields and > CharFields. > When I access the CharFields, I get strings. When I access the > IntegerFields, I get integers, but when I want to use the Floatfields, I > always have to a

Re: Weird get_or_create error

2007-05-01 Thread Andy Dustman
On 5/1/07, Brandon Low <[EMAIL PROTECTED]> wrote: > > my model is very simple: > > class Referrer(models.Model): > url = models.CharField(maxlength=255, unique=True) > > here is the relevent view code: > > referrer = request.META.get('HTTP_REFERER','-') > r, r_new = Referrer.objects.ge

Re: Why are my FloatFields strings ?

2007-05-08 Thread Andy Dustman
On 5/2/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > I'm going to work on that problem (putting in decimal support) this week > sometime. Maybe today or tomorrow. It's starting to annoy me, seeing all > the decimal-reated tickets in Trac, so after I knock off all the email > ones (today), I

Re: Weird get_or_create error

2007-05-08 Thread Andy Dustman
Not sure what is happening there. Django is not setting autocommit, and MySQLdb disables autocommit by default. Have you actually verified that autocommit is on when running your application? It may also be due to the fact that MySQL (5.0 and earlier at least) does not defer foreign key checks in

Re: Weird get_or_create error

2007-05-09 Thread Andy Dustman
On 5/8/07, Brandon Low <[EMAIL PROTECTED]> wrote: > > Still not sure what's going on myself -- I've had one more occurence of > the error, and have now confirmed that autocommit is on in the > production application (by printing the result of select @@autocommit). > > It sounds quite possible that

Searches Across Many-to-Many with Intermediate Table

2007-10-31 Thread Andy Brody
l rather than at the SQL level with a distinct(). The resulting SQL (which I don't want to write myself) should be something like: SELECT DISTINCT * FROM `app_group` WHERE `id` IN ( SELECT `group_id` FROM `app_activity` WHERE `musician_id` = 1 ) Thanks, Andy --~--~-~--~~

Re: Searches Across Many-to-Many with Intermediate Table

2007-11-01 Thread Andy Brody
y_set.all()] group_ids = [] for group in grouplist[:]: if group.id in group_ids: grouplist.remove(group) else: group_ids.append(group.id) Why doesn't set(grouplist) remove the duplicates, anyway? Do these both make sense? Would one hit the database less than the ot

Re: Searches Across Many-to-Many with Intermediate Table

2007-11-01 Thread Andy Brody
method, but I think I'll see how far I get with what I have for now... Many thanks, Andy On Nov 1, 8:29 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2007-11-01 at 11:35 -0700, Andy Brody wrote: > > Ah, thanks for the values() hint. It seems to work decently. I d

Re: Problem with the django tutorial

2007-12-05 Thread andy baxter
I thought I had - in fact I'm pretty sure I remember doing it, but when I looked it wasn't there, so thanks for this. It's now working OK. andy ChaosKCW wrote: > Hi > > It works for me, > > Did you add your application to the settings.py as per a previous > s

Problem with the django tutorial

2007-12-05 Thread andy baxter
ss Poll(models.Model): # ... class Admin: pass This is supposed to bring the Poll class into the admin interface, but on my system it isn't working - nothing changes on the admin page, even when I refresh the page or restart the server. Can anyone hel

Re: static on separate what?

2007-12-09 Thread andy baxter
James Bennett wrote: > On Dec 8, 2007 10:57 PM, Carl Karsten <[EMAIL PROTECTED]> wrote: > >> I this text, does "separate Web server" contingent on a 2nd box? If it is >> only >> one box, the same Apache instance would be preferred, right? >> > > No, and no. > > You don't have to have sep

Re: Unknown column error when I add a field

2006-09-25 Thread Andy Dustman
On 9/20/06, Tool69 <[EMAIL PROTECTED]> wrote: > > Hi, > I'm totally new to django, I've made a little blog application and my > original template is like this one: > > class News(models.Model): > title = models.CharField(maxlength=255, verbose_name="Titre du > billet") > text = models.TextF

Re: ManyToManyFields are not syncdb'able

2006-10-02 Thread Andy Dustman
On 10/2/06, Seemant Kulleen <[EMAIL PROTECTED]> wrote: > Dear All, > > I've attached two files: people/models.py and services/models.py. I > have two many-to-many relationships defined: one is between people and > roles (each person can fill many roles, and each role can be filled by > many peopl

Re: ManyToManyFields are not syncdb'able

2006-10-02 Thread Andy Dustman
On 10/2/06, seemant <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm sorry about that. All the ManyToManyFields have this sorta thing: > > LEM = models.ManyToManyField ( > Person, > related_name = 'LEM', > filter_interface = models.HORIZONTAL, > limit

Re: ManyToManyFields are not syncdb'able

2006-10-02 Thread Andy Dustman
On 10/2/06, seemant <[EMAIL PROTECTED]> wrote: > > Andy, > > This certainly gets me past the syncdb, so thanks! However, when I try > to add a service, I get this (note that I have not yet added people or > roles, I wanted to try adding them using the + in the servic

Re: Anal not Analog, Analysis: DB Question

2006-10-04 Thread Andy Dustman
On 10/4/06, Tom Smith <[EMAIL PROTECTED]> wrote: > > If I am looking for titles like "Anal Sex" or "Being Anal" then how > do I construct this, ahem, query... to not return "Analysis" or > "Analog"? Two options: If your database supports it, try a full-text search: object_list = Products.objects

Re: Relevance

2006-10-04 Thread Andy Dustman
On 9/15/06, mrstone <[EMAIL PROTECTED]> wrote: > > Hi > > I'm fiddling around with MySQL fulltext search and run into a problem. > > Using the below code works: > > match_expr = "MATCH(name) AGAINST (%s IN BOOLEAN MODE)" > qs = > Place.objects.all().filter(name__search=query).extra(select={'releva

Re: Support for static content?

2006-10-04 Thread Andy Dustman
On 10/4/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Django's database-centric approach seems to make certain kinds of > mostly-static sites harder to build. For example, most of what I want > to put on my site is probably going to come from RestructuredText > source, but that source is

Re: Relevance

2006-10-04 Thread Andy Dustman
On 10/4/06, Beau Hartshorne <[EMAIL PROTECTED]> wrote: > > On 4-Oct-06, at 6:12 PM, Andy Dustman wrote: > > > I'm not sure this will fix your problem, but it might from my reading > > of the code. Try reversing the order of the filter() and extra() > > method

Re: ForeignKey field with null = True and blank = True

2006-10-05 Thread Andy Dustman
On 10/4/06, Seemant Kulleen <[EMAIL PROTECTED]> wrote: > Hi All, > > Now I'm at ForeignKey funkiness. So I have the Services model which > has a ForeignKey field to the Sermon model. The funny thing is that > if I choose a sermon object when I first create a new service object, > all is well. I

Re: What IDE do you use? (semi-OT)

2006-10-10 Thread Andy Dustman
On 10/8/06, Serg Kovrov <[EMAIL PROTECTED]> wrote: > I'd like to know what editor/IDE Django users (and developers) uses on > daily basis, to boost development process. And why exactly - what > features you find useful, how it helps you to save time (or just makes > coding enjoyable, which probab

Where do newbies go to ask questions?

2006-10-12 Thread Andy Skogrand
I have a fairly simple question to ask, and I dont know where to ask it. Essentially my issue is that I went through the Django Tutorial: http://www.djangoproject.com/documentation/tutorial2/ and I created the polls app and then stated inside it models.py that it could be editable by the admin p

Re: Where do newbies go to ask questions?

2006-10-12 Thread Andy Skogrand
wrong, and I stumbled across what I gathered to be a pretty important command. pkill python and just like that, it all came together. Reseting the server seems to have done it. Thanks so much for your help and I plan on being back here when I once again overstep my abi

Best way to delete a project

2006-10-14 Thread Andy Skogrand
I am looking to just do a clean sweep and get rid of everything I have on a project. I considered deleting the files on the server and then wiping the entries off from the mySQL database. Is there a better way? --~--~-~--~~~---~--~~ You received this message becau

Re: Django and Media Temple Grid Server

2006-10-18 Thread Andy Dustman
http://news.netcraft.com/archives/2006/10/17/price_competition_emerges_in_grid_hosting.html This article from Netcraft focuses primarily on Media Temple (who I never heard of before this discussion) and lists some competitors. All-in-all, MT's software selections are somewhat conservative, at be

Re: How to make tables generated by Django be utf8 encoded by default?

2006-10-27 Thread Andy Dustman
On 10/25/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi, > I want to store Chinese characters in my MySQL 4.1.11 through Django > but unluckily, like most novices, I get totally mess characters when > displaying them on utf-8 encoded templates. > After some investigation I found that the

Re: Still really struggling with JOINS

2006-10-27 Thread Andy Dustman
On 10/27/06, Tom Smith <[EMAIL PROTECTED]> wrote: > Is there a way to do a complete dump, re-build the database and then > import stuff (avoiding import errors... i.e doing some form of > coercion)? Use mysqldump with the --no-create-info option which avoids dumping the table schemas. Drop the d

Re: Incompatible unicode django / mysql

2006-11-01 Thread Andy Dustman
On 11/1/06, mamcxyz <[EMAIL PROTECTED]> wrote: > > I having this error: > > OperationalError: (1267, "Illegal mix of collations > (latin1_general_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for > operation '='") > > When I try to run code like this: > > City.objects.filter(name='Medellín') > > I h

Re: UTF8 character set problem

2006-11-01 Thread Andy Dustman
On 10/30/06, Pythoni <[EMAIL PROTECTED]> wrote: > > Here are MySQL settings, both on Linux and XP windows > > > LINUX MySQL settings > +--++ > | Variable_name| Value | > +--+---

Re: Adding a button to admin view?

2006-11-15 Thread Andy Dustman
On 10/31/06, iain duncan <[EMAIL PROTECTED]> wrote: > > Hi folks, I would like to add a custom form button to the admin > interface somehow and am not sure how to go about it. > > I want to add a "download now" button the list view for some file > entries, so it needs to be a link to file. Any ide

Somewhat awkward ImageField usage

2006-12-14 Thread Andy Dustman
I have this model: class Photo(Model): title = CharField( maxlength = 80, ) description = TextField() photo = ImageField( upload_to = "photos/%Y/%m/%d", height_field = "H", width_field = "W", ) W = PositiveSmallIntegerField("Width",

Re: >*< Free PC to PC access >*< Remote Access software >*

2006-12-21 Thread Andy Dustman
On 12/21/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: Shabana wrote: > [expunged] there's no way to get google groups to simply just nuke anything that mentions 50webs.com ? I, for one, have been aggressively going after spammers in django-users this morning, and I recommend everyone using

Re: appname in admin

2007-01-05 Thread Andy Dustman
On Jan 5, 9:08 pm, "Aljosa Mohorovic" <[EMAIL PROTECTED]> wrote: i can't find info on how to change appname in admin interface. example: if i have "my_cool_app" app in project and it has admin interface enabled it will display something like "My_cool_app" in administration, can i make it display

Re: What can be done about all the spam in django-users?

2007-01-19 Thread Andy Dustman
Don Arbow wrote: On Jan 19, 2007, at 7:40 AM, LD 'Gus' Landis wrote: > If the spam can't be stopped, the unsubscribe is the only option I > guess, eh? No, you go to the Google Groups web page and report the spam. In the title of the message is a "Show Options" link, click that, then click th

Getting HTTP header data in templates

2007-01-22 Thread Andy Dustman
I have a 404 page that I would like to display some of the HTTP headers (particularly HTTP_REFERER) in so that user receiving the error can make a usable report. Is there some way at getting at this information in a template without having to have your view return a HttpResponseNotFound object? I'

Re: Getting HTTP header data in templates

2007-01-22 Thread Andy Dustman
On 1/22/07, Bo Shi <[EMAIL PROTECTED]> wrote: > > I think request.META is what you're looking for, i.e.: > >referrer = request.META.get('HTTP_REFERER', '/') I know that; I need to have access to it from a template, specifically my 404.html template, in a way that will work with generic views

Re: Getting HTTP header data in templates

2007-01-22 Thread Andy Dustman
On 1/22/07, Andy Dustman <[EMAIL PROTECTED]> wrote: > On 1/22/07, Bo Shi <[EMAIL PROTECTED]> wrote: > > > > I think request.META is what you're looking for, i.e.: > > > >referrer = request.META.get('HTTP_REFERER', '/') > >

Re: Getting HTTP header data in templates

2007-01-22 Thread Andy Dustman
On 1/22/07, James Bennett <[EMAIL PROTECTED]> wrote: > > On 1/22/07, James Bennett <[EMAIL PROTECTED]> wrote: > > On 1/22/07, Andy Dustman <[EMAIL PROTECTED]> wrote: > > > Here's how I made it work: > > > > > > Index: django/views/d

Re: Install woes: error "python: can't open file 'django-admin.py' "

2006-05-05 Thread Andy Dustman
On 5/4/06, jbrewer <[EMAIL PROTECTED]> wrote: > > I have tried to install the MySQLdb and keep getting this error: > > error: command 'gcc' failed with exit status 1 > > at the end of a bunch of stuff. Yeah, that "bunch of stuff" just might be important. ya know. Keep in mind you also would need

Re: auto_now_add bug with MySQL

2006-05-08 Thread Andy Dustman
On 5/5/06, Petar Mariæ <[EMAIL PROTECTED]> wrote: > class Paper(models.Model): > # ... > submited_on = models.DateField( > auto_now_add=True, > ) > # ... > > The above will spit out: > Exception Type: ValueError > Exception Value:year is out of range > Except

Re: [MySQLdb] Could not load database backend: cannot import name ImmutableSet.

2006-05-08 Thread Andy Dustman
On 5/6/06, Paulo <[EMAIL PROTECTED]> wrote: > 4. "python manage.py runserver" and "python manage.py init" start > throwing errors > -- my MYSQL DB is setup > -- settings.py has the correct db info entered > > "python manage.py runserver" gives me quite a few errors: > "bash-3.00$ python manage.py

Re: [MySQLdb] Could not load database backend: cannot import name ImmutableSet.

2006-05-09 Thread Andy Dustman
On 5/8/06, Paulo <[EMAIL PROTECTED]> wrote: > > Thanks for the tip! I will check it out when I get home this evening. > I'll keep my fingers crossed that this will help me get django > going... I've been wanting to start playing with Django for an > upcoming project but am not a sys admin and can'

Re: Time delta problem

2006-05-09 Thread Andy Dustman
On 5/8/06, George Sakkis <[EMAIL PROTECTED]> wrote: > > I posted this in MySQLdb's tracker but it seems it has to do with > Django. I have a view with one field being a time difference, computed > as sec_to_time(unix_timestamp(end)-unix_timestamp(start)). MySQL > specifies that the return type is

Re: mysqldb error

2006-05-30 Thread Andy Dustman
On 5/28/06, Thn <[EMAIL PROTECTED]> wrote: > > Hi all - I'm using the latest code (rev 2997). > Otherwise it's mod_python 1.10 / apache2 / python2.3 / mysql 5.0.21 / > MySQLdb 2.0 -- all installed from Debian packages. You must be a time-traveller if you have MySQLdb-2.0 installed; 1.2.1 is the l

Re: How to debug MySQLdb issues

2006-06-09 Thread Andy Dustman
On 6/9/06, tomass <[EMAIL PROTECTED]> wrote: > I have been testing on an Ubuntu desktop and my app works fine, but > I've now migrated it to Fedora Core 3 where it will be in production > and I'm having problems. I think the problem is related to the fact > that I have custom RPMs for MySQL (usin

Re: error in your SQL syntax near '(DATE_FORMAT... on adding date_hierarchy = 'pub_date'

2006-06-13 Thread Andy Dustman
On 6/12/06, Matt McClure <[EMAIL PROTECTED]> wrote: > > I received in a private email: > > Hello Matthew, > > > > I'm seeing the exact same "date_hierarchy" problem and was wondering > > if you received a solution offline and/or figured it out. > > > > Seems like the problem is somewhere among my

Re: Enforcing relationships in the Admin

2006-06-14 Thread Andy Todd
ty. Then the State and Country values can be inferred from traversing through your model. Because you've got independent links to Country, State and City they don't need to be dependent. Oh, and you should probably standardise on using either Region or State, at the moment you appear to be using th

Re: admin connection mysql problem

2006-06-27 Thread Andy Dustman
On 6/26/06, Patrick <[EMAIL PROTECTED]> wrote: > File "/usr/lib/python2.3/site-packages/MySQLdb/connections.py", line 151, > in __init__ > self.converter[types.StringType] = string_literal > > TypeError: object does not support item assignment I don't really know what the actual cause is,

Re: Django vs. Rails vs. Symfony: Django is fastest

2006-07-14 Thread Andy Dustman
On 7/14/06, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote: > > On Jul 14, 2006, at 1:18 PM, Adrian Holovaty wrote: > > Some folks benchmarked Symfony, Ruby on Rails and Django. Django was > > the fastest. > > By over 30% -- hell yeah! > > Now, I've always known in my gut that Django's pretty damn fa

Re: MySQL UnicodeEncodeError

2006-08-08 Thread Andy Dustman
On 8/7/06, Niran Babalola <[EMAIL PROTECTED]> wrote: > > "UnicodeEncodeError: 'latin-1' codec can't encode characters in > position 75-76: ordinal not in range(256)" This indicates your default database connection character set is latin1. You can change this in your server configuration, or you c

Re: search in django

2006-08-15 Thread Andy Dustman
On 8/15/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Data in the database is searched by LIKE (or ILIKE) SQL command which > is wrapped in Django ORM. If you need fulltext search engine you can > use MySQL which has such feature (you need to user raw SQL for it), > postgresql needs some ad

Re: search in django

2006-08-17 Thread Andy Dustman
On 8/16/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 8/15/06, Andy Dustman <[EMAIL PROTECTED]> wrote: > > In fact, it does LIKE %string%, which is quite expensive. Usually want > > I want out of an admin search is a startswith match, i.e. LIKE >

Re: search in django

2006-08-18 Thread Andy Dustman
On 8/18/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 8/18/06, Matthew Flanagan <[EMAIL PROTECTED]> wrote: > > Why not use the same suffix syntax (or subset thereof) for other > > django queries ie. __istartswith, __iexact, etc, instead of creating a > > new one? > > This is a valid point.

Pope Guido blesses Django

2006-08-18 Thread Andy Dustman
http://pyre.third-bit.com/blog/archives/613.html (found via http://del.icio.us/holovarty) """Guido just pronounced: Django is *the* web framework * Won't be part of the core, but will be as "standard" as PIL or NumPy * This was not what I expected the outcome of my talk would be, but hey

question = Q() | -Q()

2006-08-24 Thread Andy Dustman
I had been hunting around for some way to do negation in queries, and found QNot, though it is undocumented and not exported with Q. I though this was a little bit clumsy, so here's a patch to add unary negation to Q objects: Index: django/db/models/query.py ==

Re: Confused on Where to Put SQL

2006-08-25 Thread Andy Todd
rite access to a single table and that is likely to be were you should look. As a rule of thumb, if your transaction relies on the creation, population and eventual dropping of a temporary table then the chances are that you are doing something wrong. Regards, Andy -- >From the desk of Andre

Re: problems with unicode in website

2006-08-26 Thread Andy Dustman
On 8/26/06, Eugene Pyvovarov <[EMAIL PROTECTED]> wrote: > > hello everybody. I'm new in django... just want to create base apps > from tutorial on djangoproject website. > I am using mysql 4.1 and python 2.4, django from svn > When I create database in iso-8859-1 - all stuff working good, but when

Re: problems with unicode in website

2006-08-27 Thread Andy Dustman
On 8/26/06, Eugene Pyvovarov <[EMAIL PROTECTED]> wrote: > > thanks. when i change collation to utf8_unicode_ci; - all begin to work > fine. MySQLdb-1.2.2b1 is up on Sourceforge, and it should also fix this even for the binary collation case, plus some other bugs. You should also be able to instal

MySQL backend patch

2006-08-31 Thread Andy Dustman
I've come up with a patch to the MySQL backend. If you use MySQL, please check it out. http://code.djangoproject.com/ticket/2635 One of the issues to resolve is: What is the minimum version of MySQL which Django should support? I am doing all my development with 5.0, and the early deployment I h

Re: django cannot connect to mysql after upgrade

2006-08-31 Thread Andy Dustman
MySQL-5.0.24 accidentally introduced an ABI-incompatibilty, which caused the "Commands out of sync" error; MySQL-5.0.24a fixes this. -- This message has been scanned for memes and dangerous content by MindScanner, and is believed to be unclean. --~--~-~--~~~---~--~--

Re: Filtering by groups.

2006-09-01 Thread Andy Dustman
On 9/1/06, Gabriel Puliatti <[EMAIL PROTECTED]> wrote: > > Hello. I have an application in which a list should be filtered > depending on what groups a user belongs, since the application is a > homework list, and the list must only contain the classes the user > (student) is enrolled. > > I know

Re: ReferenceError

2006-09-02 Thread Andy Dustman
On 9/2/06, Lorenzo <[EMAIL PROTECTED]> wrote: > > Hi, > I'm updating an application created with Django 0.91 a few months ago. > I'm writing an external application that fills the db, using django as > an ORM. > Sometimes I get a strange ReferenceError, I think caused by a > concurrency issue with

Re: ReferenceError

2006-09-04 Thread Andy Dustman
On 9/3/06, Lorenzo <[EMAIL PROTECTED]> wrote: > > > Andy Dustman wrote: > > > What versions of MySQL and MySQLdb/MySQL-python are you using? > > > mysql Ver 14.12 Distrib 5.0.22 > mysql-python 1.2.1_p2 > > So it could be caused by mysql/mysql-py, not d

Crappy filename validator

2006-09-07 Thread Andy Dustman
The model docs strongly suggest validating all filenames of uploaded files for security reasons, so I wrote a validator that could be used for this, but it's not pretty: class filenameEndsWith(object): def __init__(self, choices=[], error_message=None): if not choices: ra

Django under IIS with ISAPI

2006-09-08 Thread Andy Robinson
d reload any changed Python modules. http://moinmoin.wikiwikiweb.de/MoinMoin_ISAPI If anyone here already has Django running under IIS, please tell me - otherwise we'll have a crack at this and update the wiki if it works. - Andy Robinson, ReportLab --~--~-~--~~

Re: Creating graphs in Django application

2006-09-08 Thread Andy Robinson
I have just added an article to the Wiki on how to create charts using ReportLab's graphics library I hope this helps! http://code.djangoproject.com/wiki/Charts Andy Robinson, CEO/Chief Architect, ReportLab Europe Ltd --~--~-~--~~~---~--~~ You received

Re: Creating graphs in Django application

2006-09-08 Thread Andy Robinson
x27;ve not really promoted it. Now that we're getting into Django, hopefully we'll get some nice examples out to inspire people.. - Andy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: Uploading Files

2006-09-08 Thread Andy Dustman
On 9/8/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > how can I upload file to /media/images/1.jpg with Django? Start here: http://www.djangoproject.com/documentation/model_api/#imagefield If the admin interface is sufficient for you, you're done. Note that this requires an object/row per

Re: Request for 'transaction' disambiguation

2006-09-13 Thread Andy Dustman
On 9/13/06, Hawkeye <[EMAIL PROTECTED]> wrote: > > Nevermind... > > Looks like Django defaults to the default MySQL table type (MyISAM), > which doesn't support transactions. > > My fault completely. You can change the default table type in your MySQL server configuration (/etc/mysql/my.cnf). You

Concurrent applications

2005-08-17 Thread Andy Shaw
it do import and run the menu application, and use the template system to replace the tags in the output of the previous step This seems perhaps overcomplicated. Is there an easier way to go about it; and if not, can anyone give me any pointers? -Andy

Re: Concurrent applications

2005-08-18 Thread Andy Shaw
ished doing exactly that, using the django.templatetags.* modules for pointers. I'll write a page for the wiki this evening on the subject, 'cos I can't see it being a particularly unusual requirement, and documentation is good :) -Andy

Re: CSS and PNG files in templates

2005-08-22 Thread Andy Shaw
ct=0) bName += " (using default)" except: pass if not stylesheet: raise Http404 css = "/* Stylesheet generated for %s\n Copyright (c) 2005 Andrew Shaw. */\n\n\n" % bName css += stylesheet.css res = HttpResponse(css) res.headers['Content-Type'] = "text/css" return res HTH. -Andy

Re: CSS and PNG files in templates

2005-08-23 Thread Andy Shaw
views? The test server is no longer particularly useful to test applications with. -Andy

Re: CSS and PNG files in templates

2005-08-23 Thread Andy Shaw
Anyway, I see your point, I'm just not sure that it applies in the development environment. -Andy

Re: CSS and PNG files in templates

2005-08-23 Thread Andy Shaw
s task. So I'll probably just have to live with it. -Andy

Model subclass accessing parent instances?

2005-10-04 Thread Andy Shaw
efault string to populate the /about/ field? I'm guessing that I could replace the module's get_object() somehow, but I don't really want to if I don't have to. TIA, -Andy

Re: Proper use of db_column attribute for fields

2005-10-11 Thread Andy Todd
On 10/12/05, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 10/10/05, Andy Todd <[EMAIL PROTECTED]> wrote: > > I'm trying to use different field names in my model from the database > > column names. Reading the manual I see that I can specify a db_column >

Re: site url

2005-10-20 Thread Andy Shaw
? Um... I don't know the actual answer to your question off the bat, but you can use an absolute URI that doesn't contain the site name: Works for me... -Andy

debug tag

2005-11-28 Thread Andy Shaw
;m using the current development version.) Thanks, -Andy

Re: Managing static media urls

2006-01-14 Thread Andy Shaw
) that you haven't written yourself, they won't necessarily follow this standard, and could conflict. -Andy

Extending admin privileges

2006-01-23 Thread Andy Shaw
model in one case), and I've written some decidedly hacky views/model validators that stop users altering other records, but they don't see the error until they try to save their changes. TIA, -Andy

Re: How to find out id of the first record?

2006-03-08 Thread Andy Shaw
ulling all records from the database and finding the one with the lowest ID, or you can write a custom SQL query to do the same thing. I don't know if Django currently has a built-in feature to let you do this, though it is possible that the database will return the records in creation o

Re: How to find out id of the first record?

2006-03-08 Thread Andy Shaw
Andy Shaw wrote: > lowest ID, or you can write a custom SQL query to do the same thing. I > don't know if Django currently has a built-in feature to let you do > this, though it is possible that the database will return the records in Julio Nobrega wrote: > first_record

Extreme file uploading

2006-03-24 Thread Andy Dustman
I'm working on a little app to manage a podcast RSS feed (believe it or not, someboody actually edits it by hand now). So my first thought was to use the FileField for uploading the enclosure. This worked fine except for one issue: The podcast in question is for video, and the files are typically

Re: Need help for query, how could i do this with django ? or a raw SQL.

2006-03-24 Thread Andy Dustman
On 3/24/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > coulix wrote: > > Hello, > > I was trying to play with custom query but i didnt manage to get it > > working, > > I too could not get the custom query from the API reference working: > > polls.get_list( > select={ > 'choice_c

Re: Need help for query, how could i do this with django ? or a raw SQL.

2006-03-25 Thread Andy Dustman
On 3/25/06, coulix <[EMAIL PROTECTED]> wrote: > > i got it working : > > def _module_get_top_users(limit): > cursor = db.cursor() > cursor.execute(""" > SELECT auth_users.username, COUNT(*) AS count > FROM auth_users,

Model inheritance

2006-03-25 Thread Andy Dustman
(Maybe this should go to django-developers, but I'm still a relative noob on Django.) I've been reading (and making some notes on) this page: http://code.djangoproject.com/wiki/ModelInheritance Surprisingly (a bit, at least), I created an app with the example model: {{{ class Place(models.Mode

Re: admin apache solved? / now mysql problem

2006-03-28 Thread Andy Dustman
On 3/28/06, abe <[EMAIL PROTECTED]> wrote: > OperationalError: (2002, "Can't connect to local MySQL server through > socket '/var/lib/mysql/mysql.sock' (13)") This indicates your MySQL server isn't running, and you are using DATABASE_HOST="localhost". -- The Pythonic Principle: Python works the

Re: admin apache solved? / now mysql problem

2006-03-28 Thread Andy Dustman
On 3/28/06, abe <[EMAIL PROTECTED]> wrote: > > > Andy Dustman wrote: > > On 3/28/06, abe <[EMAIL PROTECTED]> wrote: > > > > > OperationalError: (2002, "Can't connect to local MySQL server through > > > socket '/var/lib/mysql

Re: admin apache solved? / now mysql problem

2006-03-28 Thread Andy Dustman
On 3/28/06, abe <[EMAIL PROTECTED]> wrote: > > > Andy Dustman wrote: > > On 3/28/06, abe <[EMAIL PROTECTED]> wrote: > > > > > > > > > Andy Dustman wrote: > > > > On 3/28/06, abe <[EMAIL PROTECTED]> wrote: > > >

Re: Admin interface using CharField as a primary key

2006-03-30 Thread Andy Dustman
On 3/30/06, Daniel Bimschas <[EMAIL PROTECTED]> wrote: > > Hi there! > > I'm currently trying to convert an old webapp written in PHP into a > django-based app. The PHP-System used VARCHAR-Fields as primary keys > in the MySQL - DB. > > Now, if i convert the data for the new tables created by Djan

Re: Model inheritance

2006-03-30 Thread Andy Dustman
On 3/25/06, James Bennett <[EMAIL PROTECTED]> wrote: > > On 3/25/06, Andy Dustman <[EMAIL PROTECTED]> wrote: > > Surprisingly (a bit, at least), I created an app with the example model: > > ..snip... > > > Which is not what you'd expect based on that

Re: Database views

2006-04-10 Thread Andy Dustman
On 4/10/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 4/10/06, George Sakkis <[EMAIL PROTECTED]> wrote: > > I understand Django doesn't support database views > > (http://en.wikipedia.org/wiki/View_%28database%29) right out of the > > box, but I was wondering if there's a reasonably easy w

Re: Problem with threads accessing MySQL database

2006-04-10 Thread Andy Dustman
On 4/10/06, Eugene Lazutkin <[EMAIL PROTECTED]> wrote: > > kopikopiko wrote: > > Hi, > > > > I have an application set up under: > > Django 0.91 > > Windows 2000 Server > > MySQL 5.0 > > which reads scheduled events from a table then spawns threads (using > > the Thread module) to p

Re: MySQL Query cache hits stay zero

2006-04-20 Thread Andy Dustman
t; > > > using MySQLdb the number of Cache hits do not increase. However, the > > number of Qcache_queries_in_cache also do not increase. Strange. > > > > I did find an issue on the MySQL for Python Sourceforge website that > > seems to be describing the exact same is

Re: MySQL Query cache hits stay zero

2006-04-20 Thread Andy Dustman
On 4/20/06, Andy Dustman <[EMAIL PROTECTED]> wrote: > I've reopened that bug, but I am very skeptical that anything in > MySQLdb can be causing it. And I'm probably right, since it seems he is using MySQL-4.0 which, while it does have the query cache, it is disabled for

double forms

2022-05-06 Thread Andy Li
Hi I'm trying to put two forms, here is my code: ``` class FrontView(LoginRequiredMixin, UserPassesTestMixin, FormView): template_name = "template.html" form_class = FirstForm coupon_form = SecondForm def get_context_data(self, **kwargs): kwargs['second_form'] = self.second_form return super().get

Re: Checking template

2012-02-06 Thread Andy McKay
On Mon, Feb 6, 2012 at 9:04 AM, xina towner wrote: > How can I  check the template of a view?? .. >         self.assertTemplateUsed(resp, 'name_of_the_template', 'Bad > Template') Yes, the docs on assertTemplateUsed are at: https://docs.djangoproject.com/en/dev/topics/testing/#django.test.TestCa

Re: Django (and Python) speakers

2012-02-08 Thread Andy McKay
> The Django crowd seems to prefer PostgreSQL collectively, but I know > there are a million sites out there using MySQL, so that would > probably resonate with people. Sort of the "frank Wiles of the mySQL > world"? +1 on good MySQL speakers, whilst its not preferred by many, its very under repre

<    1   2   3   4   5   6   7   >