Re: Optimizing my ORM query

2009-03-06 Thread Jeff Gentry
On Fri, 6 Mar 2009, Malcolm Tredinnick wrote: > > Bob.objects.filter(foo=myFoo).filter(blah__in=myBlahs) > Seems like the best (and obvious) way to me. Gotcha. > Yes it does. As written, your models have no ordering requirements. That > complete lack of constraint is preserved perfectly. :-) Tr

Re: Why serializing to JSON doesn't work?

2009-03-06 Thread Jeff FW
Keep the way you're serializing the querysets, add each one to a dictionary, and then: return dict((k, simplejson.dumps(v)) for k, v in ret_val.iteritems()) -Jeff On Mar 6, 10:49 am, Marek Wawrzyczek wrote: > Thanks for your responses, they helped :) > > In the code below: >

Re: opposite of icontains

2009-03-06 Thread Jeff FW
Clearly, you get to work on cooler projects than I :-) I had thought of the keywords/phrases case, but the other ones are far more interesting. Thanks for the explanation! -Jeff On Mar 5, 7:02 pm, Malcolm Tredinnick wrote: > On Thu, 2009-03-05 at 12:54 -0800, Jeff FW wrote: > > W

Optimizing my ORM query

2009-03-05 Thread Jeff Gentry
Suppose I have three models (in pseudocode): class Foo: asdf = models.CharField() class Blah: qwerty = models.CharField() class Bob: foo = models.ForeignKey(Foo) blah = models.ForeignKey(Blah) Given a Foo and a list of Blahs (where the length of the list might be very small (0-10)

Re: Why serializing to JSON doesn't work?

2009-03-05 Thread Jeff FW
d. Use the way Marek said for anything other than models (of course, the object has to be serializable.) If that doesn't work, post the full (relevant) code. -Jeff On Mar 5, 7:01 am, Marek Wawrzyczek wrote: > Thomas Guettler wrote: > > > Jeff FW schrieb: > > >> The seri

Re: opposite of icontains

2009-03-05 Thread Jeff FW
earch like that used for? I've had a lot of strange requests from a lot of (generally strange) clients, but that's a pretty weird one. On Mar 5, 12:14 am, koranthala wrote: > Thank you very much Jeff and Malcolm for the extremely helpful > replies. > Jeff, the substring matc

Re: Why serializing to JSON doesn't work?

2009-03-04 Thread Jeff FW
The serializers are for serializing querysets/models. I'm surprised you're not getting an error message there--are you catching all exceptions? What you want is in django.utils.simplejson: from django.utils.simplejson import encoder encoder.JSONEncoder().encode(ret) -Jeff On Mar

Re: opposite of icontains

2009-03-04 Thread Jeff FW
/db/queries/#complex-lookups-with-q-objects A simpler way (also naive) would be this: Entry.objects.filter(headline__in='Today Lennon Honoured'.split()) If you decide to go with the first approach, let me know--I can help you with the syntax. -Jeff On Mar 4, 8:01 am, koranthala wrote: >

Best practices: generating large dynamic files

2009-03-04 Thread Jeff Gentry
In my project I have a need to generate CSV output files for download. Some of these files aren't overly large - 1-20MB or so, but they can get quite big (currently the largest are several hundred MB and this could grow with time). This would appear to be a case where there's no magic bullet, bu

Re: Is ODBC supported so to use DB's like Access, Teradata?

2009-03-03 Thread Jeff Anderson
KG wrote: > What needs to be done to make use of any other DB engine thru ODBC? > An ODBC database backend would need to be written for the Django ORM. signature.asc Description: OpenPGP digital signature

Re: Aggregating Ignores Slicing?

2009-03-03 Thread Jeff FW
ame way as sum--in Python, and in SQL. On Mar 3, 11:36 am, Jeff FW wrote: > Responded too quickly :-) > > If you're already getting a list of the top 100 products (and > displaying them, I assume, in a loop,) then totalling up the prices in > Python really won't hurt at a

Re: Aggregating Ignores Slicing?

2009-03-03 Thread Jeff FW
fetching the top 100 products. -Jeff On Mar 3, 11:34 am, Jeff FW wrote: > The behavior is there because you can't limit an aggregate function in > (AFAIK) SQL in that way.  It just doesn't make sense--what would this > actually mean? > > select sum(price) from product limit

Re: Aggregating Ignores Slicing?

2009-03-03 Thread Jeff FW
DB may vary.) I could be completely off-base here, as I haven't delved very far into the aggregate code, but from what I can tell, this is the case. -Jeff On Mar 3, 11:08 am, Alex Gaynor wrote: > On Tue, Mar 3, 2009 at 8:55 AM, Ross wrote: > > > I have started using aggregation,

Re: Problems specifying fields for admin inline

2009-02-25 Thread jeff
Wow, that's much simpler. They should list that option on the admin documentation page. Many thanks! On Feb 25, 10:58 pm, Alex Gaynor wrote: > On Thu, Feb 26, 2009 at 1:51 AM, jeff wrote: > > > I'm trying to modify the default Site admin page to include an inline > >

Problems specifying fields for admin inline

2009-02-25 Thread jeff
I'm trying to modify the default Site admin page to include an inline model. Everything seems to be working fine except that no matter what I try I can't get it to limit the fields displayed in the inline. When I go to the site edit page in the admin, it shows the standard site fields as it should

Re: Modifying the default admin edit page for Sites

2009-02-25 Thread jeff
Worked like a charm. Thank you! On Feb 25, 6:07 pm, Alex Gaynor wrote: > On Wed, Feb 25, 2009 at 9:03 PM, jeff wrote: > > > Is there a good way to modify what fields are displayed on the edit > > page for a site (from django.contrib.sites)? I want to have the page > >

Modifying the default admin edit page for Sites

2009-02-25 Thread jeff
Is there a good way to modify what fields are displayed on the edit page for a site (from django.contrib.sites)? I want to have the page include inline editing for a model that has a ForeignKey to Sites. Is there a way to change the django.contrib.admin.ModelAdmin class for the Site model? Do I h

Re: Dealing with multiple M2Ms

2009-02-25 Thread Jeff Gentry
> and suppose "obj_a" is your given A instance. Then I suspect this is the > type of queryset you're after: > C.objects.filter(Q(to_a=obj_a) | Q(to_b__to_a=obj_a)) This did the trick Malcolm, thanks. I'm not sure what was hanging me up as I could swear I had tried this one already, but m

Re: Problem outputting date in template as timestamp

2009-02-20 Thread Jeff FW
icket, someone might change the documentation soon, so you might want to get a word in beforehand: http://code.djangoproject.com/ticket/9850 I'd do it, but you already have the lovely test case :-) -Jeff On Feb 20, 12:46 pm, Sean Brant wrote: > > I asked a similar question a while

Re: New password does not authenticate

2009-02-19 Thread jeff
Yup, obvious. Python newbie forgets the () again. Thanks. On Feb 19, 10:43 am, Alex Gaynor wrote: > On Thu, Feb 19, 2009 at 1:36 PM, jeff wrote: > > > OK, I know I'm missing something obvious here in my basic "Reset > > Password for Forgetful User" form: &g

New password does not authenticate

2009-02-19 Thread jeff
' When I run this and then try to login with the username and new password, it fails. Adding the print statements, I find that check_password() works correctly, but authenticate() fails. Thanks for any help. Jeff --~--~-~--~~~---~--~~ You received this message b

Re: Login to another system with django

2009-02-19 Thread Jeff Anderson
u have described calls for an SSO module. Basically you modify Django and/or the other web app to use the same database table for sessions Django makes this fairly easy, and many PHP applications don't. There is probably a lot of resources "out there" by googling "Django SSO"

Re: seg fault with LDAP authentication

2009-02-17 Thread Jeff Anderson
k) Have you tried the ldap backend contained in Ticket #2507? We've used this in production as long as the code has been around (the original author was my co-worker) We've had very few problems with it. http://code.djangoproject.com/ticket/2507 Jeff Anderson signature.asc

Re: version control convention?

2009-02-10 Thread Jeff Anderson
an add projects and/or apps as submodules/externals. Generally speaking, a single site could/should be a single Django project, and making this distinction doesn't come up terribly often in the configurations I've seen. Hopefully this was helpful and happy coding! Jeff Anderson signature.asc Description: OpenPGP digital signature

Re: user defined model

2009-02-10 Thread Jeff FW
As much as I hate to suggest it, this sounds like a good time to use XML. Store each report as XML (in a file, or in a database row), then use templates to render the data. -Jeff On Feb 9, 3:24 pm, Dids wrote: > > This is extremely unlikely to work, not to mention very inefficient. &

Re: Bizarre sqlite3 / apache2 behaviour

2009-02-10 Thread Jeff FW
run python, then: >>> import sqlite3 >>> sqlite3.version -Jeff On Feb 9, 12:10 pm, lazyant wrote: > Hello, > > I installed yesterday Django 1.0.2 (current downloadable version) on a > new Ubuntu 8.10 machine with python 2.5.2. I wrote a toy application > and it

Re: html italic tag hinders search code

2009-02-10 Thread Jeff FW
ped version, so your users don't even have to know it exists. -Jeff On Feb 6, 3:54 pm, May wrote: > Creating a duplicate field without tags looks like it might be the way > to go, then.  I just hate the redundancy of two fields of data. > > Thanks to both you and Jeff! > > Ma

Re: mod_python and import path

2009-02-08 Thread Jeff
On Feb 8, 9:52 am, Karen Tracey wrote: > On Sun, Feb 8, 2009 at 9:44 AM, Jeff wrote: > > On Feb 8, 4:29 am, Bradley Wright wrote:> > > > And if you're really using mod_python already with Apache, also post > > > your vhost file. > &

Re: mod_python and import path

2009-02-08 Thread Jeff
On Feb 8, 4:29 am, Bradley Wright wrote: > On Feb 8, 4:39 am, Jeff wrote: > > > I installed django today and have not been able to get it to work with > > apache, or itself really.  I have the path in the sys.path and have > > set the settings module to point to it, bu

mod_python and import path

2009-02-07 Thread Jeff
I installed django today and have not been able to get it to work with apache, or itself really. I have the path in the sys.path and have set the settings module to point to it, but it cannot find it. It works fine when I use 'python manage.py shell' or 'python manage.py validate' but when I exp

Re: html italic tag hinders search code

2009-02-06 Thread Jeff FW
he searches on the stripped field(s), but display the "real" field. You can override your model's save() method to actually set the stripped field. -Jeff On Feb 6, 1:12 pm, May wrote: > In the database I need to italics species names ex.  Survival of > Shigella > In the

Re: Best practices: database connection over SSL?

2009-02-03 Thread Jeff Hammerbacher
Thanks James, that's just what I was looking for. On Tue, Feb 3, 2009 at 7:30 PM, James Bennett wrote: > > On Tue, Feb 3, 2009 at 9:22 PM, Jeff Hammerbacher > wrote: > > I could modify the call to Database.connect() in > > django/db/backends/mysql/base.py, but t

Best practices: database connection over SSL?

2009-02-03 Thread Jeff Hammerbacher
with: db=MySQLdb.connect(user="blah",passwd="blah",db="blah",ssl={'ca':'/path/to/ca.pem'}) I could modify the call to Database.connect() in django/db/backends/mysql/base.py, but that's not the most elegant implementation. Does anyone have id

Re: Model Save with Updated Foreign Key

2009-02-02 Thread Jeff
Nevermind. I had overriden the get_query_set with a custom manager that only returned a subset of the CEOs. Word to the wise. On Feb 2, 1:04 pm, Jeff wrote: > So I have two models a CEO model: > class Ceo (models.Model): >     first_name = models.CharField(max_length=63) >  

Model Save with Updated Foreign Key

2009-02-02 Thread Jeff
pkey" Now the problem here is that if I try: select * from finance_ceo where industry_id is not null; I get 0 rows in either case. But the industry row is there: select * from finance_industry; yields: 1 | Commercial Banks So what's wrong with the lines: ceo.industry = industry

Django-gitosis

2009-02-01 Thread Jeff Anderson
he same thing. What method would you use, and why? Thanks for the input! Jeff Anderson gitosis: |git://eagain.net/gitosis.git| --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users&qu

Re: free django hosting

2009-01-30 Thread Jeff Anderson
Hernan Olivera wrote: details in http://www.alwaysdata.com/offers/shared/ Very cool! I don't speak French, but I know enough about words to get the idea. signature.asc Description: OpenPGP digital signature

Re: free django hosting

2009-01-30 Thread Jeff Anderson
your home machine. If you find otherwise, I'd be interested to know. Thanks! Jeff Anderson signature.asc Description: OpenPGP digital signature

Re: Has anyone looked into writing an SSH backend for file uploads?

2009-01-30 Thread Jeff FW
might be even easier to just set up an NFS mount of the other > machines. It would be a lot like Jeff's idea, but NFS is pretty tried > and true. (I don't know anything about SSHFS, it might be really good > too.) > > On Jan 30, 9:54 am, Jeff FW wrote: > > > Inste

Re: Has anyone looked into writing an SSH backend for file uploads?

2009-01-30 Thread Jeff FW
Instead of trying to get Django to do something like that, have you looked into using sshfs? That would make it essentially transparent-- all Django would know is that it's saving a file to a filesystem. http://en.wikipedia.org/wiki/SSHFS On Jan 29, 9:05 am, Andrew Ingram wrote: > On Jan 29, 1

Re: charts in django

2009-01-29 Thread Jeff Hammerbacher
I've employed flot (http://code.google.com/p/flot/) with some success. It's pure javascript and requires jquery. On Thu, Jan 29, 2009 at 7:39 PM, Nick Lo wrote: > > > I need to generate some line charts and bar graphs from django. I > > recall seeing a very promissing package a couple months ago

Re: Cron Job Question

2009-01-29 Thread Jeff Anderson
tiple scripts with their fingers in the same table. Cheers! Jeff Anderson signature.asc Description: OpenPGP digital signature

Re: File as data backend for model

2009-01-27 Thread Jeff Hammerbacher
ORM is not well suited to non-relational data sources right now, from my brief experience, so you'll probably be better off implementing your own class to perform these manipulations. Regards, Jeff On Tue, Jan 27, 2009 at 2:13 PM, Matthias Julius wrote: > > I am trying to write a model

Re: Creating test databases. Nose framework

2009-01-27 Thread Jeff Hammerbacher
Hey Oleg, To load some sample data for your tests, see Django's documentation on fixtures: http://docs.djangoproject.com/en/dev/topics/testing/#fixture-loading. Later, Jeff On Tue, Jan 27, 2009 at 1:05 PM, Karen Tracey wrote: > On Tue, Jan 27, 2009 at 3:51 PM, Oleg Oltar wrote: >

Re: Frankenstein App (or: dynamic subtemplates)

2009-01-20 Thread Jeff FW
What you're looking for is explained in the documentation on writing your own template tags: http://docs.djangoproject.com/en/dev/howto/custom-template-tags/ Specifically, I'd look into inclusion tags: http://docs.djangoproject.com/en/dev/howto/custom-template-tags/#inclusion-tags -Je

Re: Any libraries to create an online help system in Django or Python?

2009-01-17 Thread Jeff Anderson
thon projects, and it's the documentation build system that Python and Django both use. Cheers! Jeff Anderson signature.asc Description: OpenPGP digital signature

Re: How to receive Emails in my django app

2009-01-16 Thread Jeff Anderson
at hosts your app that is separate from your domain's mailserver. The third option is to use an imap or pop library and download the messages that way. Python has the 'imaplib' module for imap, and 'poplib' for pop3. I haven't implemented this either. I'd be wi

Re: can Django's views call on several programs to run at the same time?

2009-01-13 Thread Jeff Anderson
n. I'm working on a set of examples of things I've implemented using Django, but I haven't gotten my example for this one running quite yet. Hopefully this is enough to give you an idea as to how to design things. I don't really have any code that is sharable, but the concept is fairly straightforward (I hope.) I'm happy to clarify anything if needed. Happy Coding! Jeff Anderson signature.asc Description: OpenPGP digital signature

Re: Putting pieces back together again

2009-01-12 Thread Jeff FW
Mark, You should really use Forms and FormSets--they'll make this problem essentially go away. http://docs.djangoproject.com/en/dev/topics/forms/#topics-forms-index http://docs.djangoproject.com/en/dev/topics/forms/formsets/ -Jeff On Jan 12, 12:46 am, Mark Jones wrote: > I have som

Re: drawing diagrams in django?

2009-01-10 Thread Jeff Hammerbacher
Hey Alistair, For static image generation, I've used pygraphviz ( http://networkx.lanl.gov/pygraphviz/), a Python interface to AT&T's graphviz library. Regards, Jeff On Sat, Jan 10, 2009 at 12:41 PM, Alistair Marshall < runninga...@googlemail.com> wrote: > > hi folks,

Re: Shouldn't blank=True imply null=True?

2009-01-07 Thread Jeff Anderson
tofer...@gmail.com wrote: > On 07.01-08:51, Jeff Anderson wrote: > >>> I agree with this. I use null=False, blank=True for some ImageFields >>> and integers. >>> >> I'm interested in how a blank integer looks in a MySQL database. Can you >

Re: Shouldn't blank=True imply null=True?

2009-01-07 Thread Jeff Anderson
Karen Tracey wrote: > On Wed, Jan 7, 2009 at 10:51 AM, Jeff Anderson > wrote: > > >> varikin wrote: >> >>> I agree with this. I use null=False, blank=True for some ImageFields >>> and integers. >>> >> I'm intere

Re: lighttpd + django on windows

2009-01-07 Thread Jeff Anderson
Eric Simorre wrote: > it does not work , and I don't find what to do > Well, there's your problem. You should just make it work. :) signature.asc Description: OpenPGP digital signature

Re: Shouldn't blank=True imply null=True?

2009-01-07 Thread Jeff Anderson
varikin wrote: > I agree with this. I use null=False, blank=True for some ImageFields > and integers. I'm interested in how a blank integer looks in a MySQL database. Can you provide an example? signature.asc Description: OpenPGP digital signature

Re: Django: creating formset is very slow

2009-01-06 Thread Jeff FW
Post the code for DataForm--I'll bet it's hitting the database a number of times. That would be the only reason I can think of that it would take that long. I just created a formset containing simple forms, and it instantiated almost instantly--even with 2000 forms. -Jeff On Jan

Re: Newbie: Help to understand string handling

2009-01-06 Thread Jeff Anderson
phoebebright wrote: > Thanks for your response. Do you think a working knowledge of python > is essential for django then? And do I import modules the same in > django and python? Are there any python things you can't do in > django? > Django *is* Python. In fact, Django is only a Python libra

Re: Django forms usage with mutliple rows

2009-01-06 Thread Jeff FW
Yup, that's exactly what formsets are for. You essentially take the form you've already written, and pass it to formset_factory() to create a list of identical forms. http://docs.djangoproject.com/en/dev/topics/forms/formsets/#topics-forms-formsets -Jeff On Jan 6, 1:02 am, "

Re: Shouldn't blank=True imply null=True?

2009-01-05 Thread Jeff Anderson
Malcolm Tredinnick wrote: > On Mon, 2009-01-05 at 23:39 -0700, Jeff Anderson wrote: > >> Malcolm Tredinnick wrote: >> >>> The way to think about this problem is whether there's a situation where >>> blank=True, null=False makes sense or is even

Re: Shouldn't blank=True imply null=True?

2009-01-05 Thread Jeff Anderson
least Integer fields (and quite possibly other non-text fields) should behave the way that Mike is describing. Jeff Anderson signature.asc Description: OpenPGP digital signature

Re: Permissions: is something wrong with them?

2009-01-01 Thread Jeff Anderson
Artem Skvira wrote: > Is it worth asking this question is dev group? > No. Your usage question does not belong on the dev group. It belongs here, on the user group. signature.asc Description: OpenPGP digital signature

Re: Slow application performance...

2009-01-01 Thread Jeff Anderson
g all your available memory on your slice, and swapping. I had this same problem. I posted about it to this group a couple weeks ago. Basically, switch to mod_wsgi in daemon mode. It'll reduce your memory usage, and increase the speed of the site. Search the archive for more details. Je

Re: caching...mechanism

2008-12-29 Thread Jeff Anderson
but people going to a programming blog might be more inclined to disable javascript. As a fallback, you could simply use an iframe to point to your analytic view. That'll probably cover most everything. Cheers! Jeff Anderson signature.asc Description: OpenPGP digital signature

Re: Variables in templates

2008-12-28 Thread Jeff Anderson
to put that data into the final file format for the end user (html in most cases). Jeff Anderson signature.asc Description: OpenPGP digital signature

Re: '.schema' is not recognized as an internal or external command, operable program or batch file

2008-12-28 Thread Jeff Hammerbacher
from there. Regards, Jeff On Sun, Dec 28, 2008 at 5:24 PM, mango7 wrote: > > I am new to django, and following the tutorial at: > http://docs.djangoproject.com/en/dev/intro/tutorial01/?from=olddocs > > I got as far as creating and syncing a DB, but when I type .schema > into my c

Re: django static-generator and fastcgi

2008-12-25 Thread Jeff Anderson
i ? > I've never used this middleware, but its homepage seems to have an nginx example: http://superjared.com/projects/static-generator/#sample_nginx_configuration I don't think that using fastcgi should affect anything if you're using nginx. Jeff Anderson signature.asc Description: OpenPGP digital signature

Putting external web service accesses into models.py?

2008-12-24 Thread Jeff Hammerbacher
ource that describes best practices for putting external API accesses into the model layer? Thanks, Jeff --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send e

Re: dynamically instantiate a model at run time

2008-12-24 Thread Jeff FW
I think you've got a small typo in the code there, that might be confusing to the OP--shouldn't the get_model() call have quotes around "tag"? Like so: model_class = get_model("test", "tag") -Jeff On Dec 23, 5:03 pm, bruno desthuilliers wrote: > O

Re: Serializing QuerySets and Python objects best practices

2008-12-23 Thread Jeff Anderson
I believe there is a python json module. I know that Django makes use of it for importing/exporting database fixtures. It is bundled with django at: django.utils.simplejson. I'd start there, and poke around in the Django code for more examples. I'm no expert here, this is just where I'd start looking. Happy coding! Jeff Anderson signature.asc Description: OpenPGP digital signature

Re: Model with CharField primary key, force_update=True to prevent saving other object

2008-12-23 Thread Jeff Kowalczyk
Jeff Kowalczyk wrote: > I'm working with a model using a CharField primary key, ... > I need to prevent other objects from being created/updated > if save() is called with a changed pk value. > > class Widget(models.Model): >     identifier = models.CharField(primary_key=

Model with CharField primary key, force_update=True to prevent saving other object

2008-12-22 Thread Jeff Kowalczyk
I'm working with a model using a CharField primary key, and want to ask whether it is appropriate to use force_update=True in a save() override on the model. I need to prevent other objects from being created/updated if save() is called with a changed pk value. class Widget(models.Model): ide

Re: "Building you first Django app, Part 1" example not working

2008-12-21 Thread Jeff Anderson
gy, you need to read up on some unix basics. There are many tutorials about the unix shell out there. I can't recommend one because I would just google for an introduction to the unix/linux/macos terminal. Jeff Anderson signature.asc Description: OpenPGP digital signature

Re: "Building you first Django app, Part 1" example not working

2008-12-21 Thread Jeff Anderson
ly what you need to do. The django-admin.py script exits on success with no output. That's what it's supposed to do. Does the mysite directory not exist after you run that command? Jeff Anderson signature.asc Description: OpenPGP digital signature

Re: "Building you first Django app, Part 1" example not working

2008-12-20 Thread Jeff Anderson
my osx terminal: jeffe...@pax:~$ django-admin.py startproject mysite jeffe...@pax:~$ cd mysite/ jeffe...@pax:~/mysite$ Cheers! Jeff Anderson signature.asc Description: OpenPGP digital signature

Re: Admin formatting

2008-12-20 Thread Jeff Anderson
dmin css files. Correct. You have to tell apache that the location of the admin media should be handled with the default handler, and then make an alias for that location to point to the correct location on disk. This is in the docs: http://docs.djangoproject.com/en/dev/howto/deployment/modpython

Re: urls.py password reset view.

2008-12-20 Thread Jeff FW
That error is occuring because you don't have a URL defined for password_reset_done, which, presumably, is being referred to in your forgotpassword.html in a {% url %} tag. Check out this brief tutorial, it's rather handy: http://www.rkblog.rk.edu.pl/w/p/password-reset-django-10/ -Je

Re: del session variables

2008-12-20 Thread Jeff FW
Wow, you're right. I've been programming Python for years, and I somehow never noticed that. I'll be quiet not :-) On Dec 17, 6:33 pm, Malcolm Tredinnick wrote: > On Wed, 2008-12-17 at 15:09 -0800, Jeff FW wrote: > > You've got a space in between "HttpRes

Re: newie, django and apache, somethings are not working

2008-12-20 Thread Jeff FW
x27;re hardcoding your URLs in your templates/views --use the {% url %} tag and reverse() instead. http://docs.djangoproject.com/en/dev/topics/http/urls/#reverse -Jeff --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Grou

Re: Django Session Variables

2008-12-20 Thread Jeff FW
Looking at http://code.djangoproject.com/browser/django/trunk/django/contrib/auth/__init__.py#L46 it doesn't look like it clears the session. It *does* generate a new key, but that shouldn't affect anything. It should only take you about two minutes to test it though--just try it o

Re: Help with batch processing

2008-12-20 Thread Jeff FW
Check out: http://www.doughellmann.com/PyMOTW/contents.html He's got tutorials on quite a lot of the python stdlib--very handy resource. csv and zipfile are on there. -Jeff On Dec 19, 9:40 pm, Brandon Taylor wrote: > I've been looking at the methods from those libs. Glad to know

Re: Delete multiple items from an admin change list

2008-12-19 Thread Jeff Kowalczyk
On Dec 19, 6:15 am, bcurtu wrote: > Is it possible to get the admin item list with a kind of checkboxes in > order to select multiple items and delete them all together? http://code.google.com/p/django-batchadmin/ --~--~-~--~~~---~--~~ You received this message be

Re: Multiple apps extending admin/change_list.html

2008-12-18 Thread Jeff Kowalczyk
claim list word-wrapping there. My carefully-prepared description of an interaction between reusable apps was a svelte 349 lines as composed ;) Seriously though, I plan to omit the template listings next time. Thanks, Jeff --~--~-~--~~~---~--~~ You received this m

Re: FTP'ing without locking

2008-12-17 Thread Jeff Anderson
hang, I don't imaging having a persistant python thread hanging around processing for a minute or two would make the webserver hang in a mod_python or mod_wsgi environment, but I didn't try it. Why would this be the case? From the "I've done it without a hitch" department, Jeff Anderson signature.asc Description: OpenPGP digital signature

Re: del session variables

2008-12-17 Thread Jeff FW
You've got a space in between "HttpResponseRedirect" and "('../ shop')" . On Dec 17, 2:44 pm, Bobby Roberts wrote: > > Have a look at theflush() method; I believe that might well be close to > > what you are after. > > > Regards, > > Malcolm > > I'm trying to call the view below: > > def DoSessi

ModelAdmin list_filter presets: usability best practice?

2008-12-15 Thread Jeff Kowalczyk
Does anyone have a best-practice suggestion for ModelAdmins which are best used with a preset list_filter? Put another way, where are the best usability customization points so the user sees a specific list filter when entering that modeladmin, and when being redirected after various actions, but

Re: Multiple apps extending admin/change_list.html

2008-12-15 Thread Jeff Kowalczyk
On Dec 13, 9:31 pm, Malcolm Tredinnick wrote: > That sounds like the only way. If you want to see batchadmin's changes, > you have to extend from that. Thank you, I have made batchadmin find its media in my development setup. My change_list.html, which now extends batchadmin/change_list.html, i

Multiple apps extending admin/change_list.html

2008-12-13 Thread Jeff Kowalczyk
I am developing an app with a customized admin/change_list.html [1]. I added djang-batchadmin, which itself has a template extending admin/ change_list.html (batchadmin/templates/batchadmin/change_list.html) What is the most effective pattern to manage multiple apps extending the same admin templ

Re: "Legal" way to have foreign key field in the custom form

2008-12-13 Thread Jeff FW
e you defined a Media class in your admin class? Or you overrode the wrong block in your template? If you're overriding the block "extrahead", make sure to put a {{ block.super }} in there, so it includes anything that's been defined by parent templates. -Jeff On Dec 12, 2:32 

Re: "Legal" way to have foreign key field in the custom form

2008-12-12 Thread Jeff FW
at you may have to adapt a little to do that: [(t.id, unicode(t)) for t in queryset.all()] That assumes that you add "queryset" as an argument to __init__(), which you should probably do. -Jeff On Dec 12, 1:06 pm, Eugene Mirotin wrote: > I was busy for several days and could give

Re: generating an image?

2008-12-12 Thread Jeff Anderson
e.net/ - Windows only, uses IE for rendering http://cutycapt.sourceforge.net/ - cross platform, uses the same rendering engine as konquerer/google chrome/safari. Jeff Anderson signature.asc Description: OpenPGP digital signature

Re: model string reprentations

2008-12-12 Thread Jeff FW
Sure do: it should be __str__() with two underscores on either side, not one. -Jeff On Dec 12, 7:33 am, ben852 wrote: > Hi, > I am new to django and programming. > I have a problem with the method _str_( ). > Following the tutorial, I edited my models.py file in mysite/books

Re: can't get new model to show up in admin

2008-12-11 Thread Jeff FW
Glad to help :-) I know that problem messed us (my coworker and I) for a while, so I'm glad to see that our fumbling around led to someone else's solved problem. -Jeff On Dec 11, 1:58 pm, Norm Aleks wrote: > THANK YOU THANK YOU THANK YOU!!  Oh man, oh man, was that frust

Re: can't get new model to show up in admin

2008-12-11 Thread Jeff FW
er, so I feel like > it's unlikely to be a Dreamhost issue. > Norm > > On Dec 11, 6:11 am, Jeff FW wrote: > > > Possibly a silly question--but did you run syncdb after adding > > staticimage2 to your INSTALLED_APPS? > > > -Jeff > > > On Dec 10, 9:

Re: can't get new model to show up in admin

2008-12-11 Thread Jeff FW
Possibly a silly question--but did you run syncdb after adding staticimage2 to your INSTALLED_APPS? -Jeff On Dec 10, 9:49 pm, Norm Aleks <[EMAIL PROTECTED]> wrote: > I'm using Django 1.0.2 (on Dreamhost, if that matters) and having > trouble getting a new model to show up

Re: Index page using flatpages

2008-12-10 Thread Jeff FW
aps you have something in your urls.py that's overriding what flatpages should be handling? -Jeff On Dec 10, 5:33 am, Nuno Machado <[EMAIL PROTECTED]> wrote: > Hi Jeff, > > Yes, I do. It's a default setting. > > I've been thinking about the 'django.contrib.flat

Re: Index page using flatpages

2008-12-09 Thread Jeff FW
Do you have CommonMiddleware enabled in your settings.py? http://docs.djangoproject.com/en/dev/ref/middleware/#module-django.middleware.common On Dec 9, 7:29 pm, Nuno Machado <[EMAIL PROTECTED]> wrote: > Hi, > > I'm using flatpages to display some static content in a site. The > "about" page is

Re: Using random.random() while running on server

2008-12-09 Thread Jeff FW
Also, as an aside to all of that--what you're generating is in no way guaranteed to be unique. If you really need a unique string, use a UUID or hash of the primary key. On Dec 9, 3:48 pm, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > On 9 déc, 11:32, Chris <[EMAIL PROTECTED]> wrote: > > > He

Re: Using random.random() while running on server

2008-12-09 Thread Jeff FW
Can you show me exactly what you're trying to do? That would make it much easier to help you. -Jeff On Dec 9, 1:19 pm, Chris <[EMAIL PROTECTED]> wrote: > I found this snippet:http://www.djangosnippets.org/snippets/814/and > noticed that it does not work as intended do to

Memory Footprint

2008-12-09 Thread Jeff Anderson
ng switching to lighttpd. I've read it has a smaller footprint than apache. I've also read that mod_wsgi performs better than mod_python. Please let me know if you have any other ideas! I'm also curious to know if anyone thinks that one of the things I mention trying would help or hurt. Thanks! Jeff Anderson signature.asc Description: OpenPGP digital signature

Re: Using random.random() while running on server

2008-12-09 Thread Jeff FW
to pass an argument of default=random.random in the definition. If it's somewhere else you're trying to call it, let us know. -Jeff On Dec 9, 5:32 am, Chris <[EMAIL PROTECTED]> wrote: > Hello, > when django is running on a server, I want to make a call to: > random.r

Re: "Legal" way to have foreign key field in the custom form

2008-12-09 Thread Jeff FW
._meta.get_field('parent').rel, admin.site, ) -Jeff On Dec 9, 6:50 am, Eugene Mirotin <[EMAIL PROTECTED]> wrote: > Well, looks that the ModelChoiceField solves the problem except of the > plus icon > > On Dec 9, 12:34 pm, Eugene Mirotin <[EMAIL PROTECTED]> wrote: &g

<    1   2   3   4   5   6   7   >