Re: Duplicate object

2006-01-12 Thread Adrian Holovaty
ect but with id set to None. > > +1 -- obj.copy() might be a better syntax to mimic dict.copy(). obj.copy() would be a nice addition, but would it also copy the values of many-to-many relationships? Like, if a poll is on multiple sites, would poll.copy() return an object with the sites

Re: Small problems with admin-site using magic-removal branch

2006-01-14 Thread Adrian Holovaty
tely don't use it on anything resembling a production site. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: psycopg 2.2

2006-01-15 Thread Adrian Holovaty
google.com/group/django-users/browse_thread/thread/dc2197f0de69072a/d801feabc1144518 As soon as psycopg 2 is released officially (i.e., out of beta), we'll add an "official" psycopg2 handler. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: Comparing model objects ...

2006-01-15 Thread Adrian Holovaty
at compares the primary keys, so it's equivalent to doing "user.id == myuser.id". Thanks for bringing this up! I've added a "Comparing objects" section to the docs: http://www.djangoproject.com/documentation/db_api/#comparing-objects Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: django 0.90 -> 0.91 : raw_id_admin representation changed: HELP!

2006-01-16 Thread Adrian Holovaty
ing admin templates, it's probably best to start from the "real" templates rather than retrofitting 0.90-style admin templates to fit the template scheme 0.91 expects. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: Apache2 - Mod_python: ValueError: Empty module name

2006-01-16 Thread Adrian Holovaty
ng your settings module. Do you have the line "SetEnv DJANGO_SETTINGS_MODULE foo" in your httpd.conf, where "foo" is the Python path to your settings module? Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: passing additional parameters to a view

2006-01-17 Thread Adrian Holovaty
or key, value in request.GET.items(): > q.append ( "%s = %s" % (key, value) ) > q = ", ".join(q) > print q > cmd = "milestones_list = milestones.get_values(%s)" % q > exec cmd UGH! Do *not* use that code.

Re: validators 9.1

2006-01-17 Thread Adrian Holovaty
m > manipulator to use from my own views, but I would like the admin view to use > the > same logic. You can check whether manipulator.original_object exists. If it does, it's a change. If it doesn't it's an add. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: Bulk delete?

2006-01-18 Thread Adrian Holovaty
ren't deleted. The patch doesn't appear to handle this, which means we have inconsistent behavior between bulk delete and normal deletion. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: assign or rename a variable in templates

2006-01-18 Thread Adrian Holovaty
d about repeating template code, I'd suggest writing a template tag that does the work of displaying output for the object_list/latest. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: broken link in templates_python

2006-01-18 Thread Adrian Holovaty
On 1/18/06, Luke Skibinski Holt <[EMAIL PROTECTED]> wrote: > The first link in this section > (http://www.djangoproject.com/documentation/templates_python/#subclassing-context-djangocontext) > is broken. Thanks, Luke. I've fixed it. Adrian -- Adrian Holovaty holovaty.com

Re: django on dreamhost

2006-01-18 Thread Adrian Holovaty
ode.djangoproject.com/wiki/DjangoFriendlyWebHosts http://code.djangoproject.com/wiki/ServerArrangements Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: Upgrading models...

2006-01-19 Thread Adrian Holovaty
get any errors, show us the entire CREATE TABLE statement generated by "sqlreset" for the table that includes the genre_id field snippet you pasted above. We'll figure this out! Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: Django and MS SQL

2006-01-20 Thread Adrian Holovaty
out of all Django doctests left. :-) > Anyway it's late night already and my mind started to blur. I will > try to finish up tomorrow, clean up, and submit patches. Excellent! Thanks for your hard work on this. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: Mixing prefixes in one urlconf

2006-01-21 Thread Adrian Holovaty
ut, because none of your views will share the same prefix. You'll have to put the whole view name (e.g. 'django.views.generic.something' or 'project.apps.app_name.views.index') next to each URL. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: get_list not showing up

2006-01-22 Thread Adrian Holovaty
t_list() Hey James, You'll want to do this: >>> from django.models.foundation import ratefunctions >>> ratefunctions.get_list() In this case, ratefunctions is a "magic module" which is created by Django automatically. I know this is a bit confusing, b

Re: get_list not showing up

2006-01-22 Thread Adrian Holovaty
On 1/23/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I wonder if it is the module_name statement in the META class? Yeah, get rid of the module_name statement, and you'll be able to do "from django.models.foundation import ratefunctions". Adrian -- Adri

Re: recovering from interpreter db errors

2006-01-24 Thread exoweb adrian
I do this at this start of every django interpreter session: >>> from django.core.db import db >>> db.cursor().close() >>> db.connection.autocommit() Then you don't need to do a rollback and lose your cursor every time you get a database error.

Re: Streaming large responses

2006-01-24 Thread Adrian Holovaty
hunked parts. But to do this there would have to be > support for chunked transfers in the mod_python handler, too, so it > wouldn't be a simple patch, but a bit more involved. I agree that this would be a fine feature to add. Anybody willing to work on a patch? Adria

Re: editing multiple records

2006-01-24 Thread Adrian Holovaty
dable, IMHO). is there any possibility to offer that functionality? The Django admin site can't do that out of the box, but you could create your own custom views that do that. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: several django questions, models, apache

2006-01-24 Thread Adrian Holovaty
cally put a get_FIELDNAME_display() method on the model. In your example, your model objects will have a get_difficulte_display() method. http://www.djangoproject.com/documentation/db_api/#get-foo-display Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: Database API Boolean Queries

2006-01-24 Thread Adrian Holovaty
s.get_list(domestic__exact="t"); Try this: beers.get_list(domestic__exact=True) Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: Admin CSS in mod_python vs. runserver

2006-01-24 Thread Adrian Holovaty
FAQ. http://www.djangoproject.com/documentation/faq/#my-admin-site-css-and-images-showed-up-fine-using-the-development-server-but-they-re-not-displaying-when-using-mod-python Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: 'django_admin_log' problem

2006-01-24 Thread Adrian Holovaty
s prevents me from > logging in into the admin interface. Did you run the command "python manage.py install admin"? That command creates the django_admin_log table. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: magic_removal table update

2006-01-25 Thread Adrian Holovaty
ROP DEFAULT; ALTER TABLE chicagocrime_ward ALTER COLUMN id SET DEFAULT nextval('public.chicagocrime_ward_id_seq'::text); I will edit the RemovingTheMagic wiki page to add this example explicitly. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: Template cache which speeded up my setup 25 times

2006-01-25 Thread Adrian Holovaty
lates. I was thinking we could add a CACHE_COMPILED_TEMPLATES setting and change get_template() to give it a "cache" keyword argument, which would default to the value of CACHE_COMPILED_TEMPLATES. Any quick thoughts before I implement this? Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: rss problem

2006-01-25 Thread Adrian Holovaty
the relevant part of the docs: http://www.djangoproject.com/documentation/syndication/#a-simple-example Check out the part that begins: "To specify the contents of and ..." Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: prepopulate_from

2006-01-26 Thread Adrian Holovaty
; method instead? That's because prepopulate_from is intended to give *recommended* values, not definitive values. If your slug prepopulates from your headline, you still may want to edit the slug after it's been prepopulated. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: How do I get POST variables in my template

2006-01-26 Thread Adrian Holovaty
ss of MultiValueDict -- that's why the docs say QueryDict, not MultiValueDict.) If your request.POST is displayed as , that means request.POST is empty. If request.POST had something in it, it'd look like this: Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: Guido on Django

2006-01-27 Thread Adrian Holovaty
to mention the security implications of allowing pure Python code in templates. The Ruby on Rails people are realizing this, and they've made a template language that closely mirrors Django's: http://home.leetsoft.com/liquid/ Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: BigIntegerField type?

2006-01-27 Thread Adrian Holovaty
g > wrong with this? Hi Roberto, There shouldn't be any problems with this. That's exactly what I'd suggest doing. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: Template inheritance problem

2006-01-28 Thread Adrian Holovaty
plates, rather than something like /home/templates/myapp? Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: Suggestions for documentation

2006-01-28 Thread Adrian Holovaty
ious versions > documents. > > This would allow one page to reference previous documents, rather than > have the tutorial page reference 0.90, 0.91, 0.92.. when new versions > come out. Hi Wade, Thanks for the good suggestion! We'll change that when the docs for next vers

Re: A Many to Many relationship that is not required.

2006-01-28 Thread Adrian Holovaty
this? Easy! Just add blank=True to the "awards" field on Movie, like so: awards = meta.ManyToManyField(Award, blank=True) Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: one to many confusion

2006-01-29 Thread Adrian Holovaty
API function for related objects, which is, in your case, "self.get_product_group().name". Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: effbot using django...

2006-01-29 Thread Adrian Holovaty
; Good one guys! - coming from effbot, I think that's praise indeed ;) Fantastic news! That's an honor. Getting feedback on Django (both good and bad) from Python luminaries has been a total trip. :D Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: Tutorial -- no attribute error

2006-01-29 Thread Adrian Holovaty
On 1/29/06, kbochert <[EMAIL PROTECTED]> wrote: > > Yeah -- just found it. Sticky key prevented saving of the polls.py > file > Why do these things always happen when I'm learning something new?? > > On to the next stupidity. No problem at all -- we should improv

Re: one to many confusion

2006-01-29 Thread Adrian Holovaty
that I got a _plaintext_ backtrace, not the > pwetty one :) > > Is it a bug or intended behaviour? (backtrace was pretty much useless) Hmm, I'd consider that a bug in the pretty error-page. How'd you invoke the __repr__() -- in a template, or in view code? Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: Tutorial -- no attribute error

2006-01-29 Thread Adrian Holovaty
t.py line 65) > I'm using SQLite. Hi Karl, Chances are you did some stuff in the tutorial out of order. Make sure your polls/models/polls.py file contains some models, and make sure the file polls/models/__init__.py includes the following: __all__ = ['polls'] Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: FileField :: mx file size

2006-01-29 Thread Adrian Holovaty
a good candidate for a validator. Just write a validator (see examples in django/core/validators.py) and add it to your FileField's validator_list parameter. This will let you check the file size before the file is uploaded. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: Using Foreign key attributes in a template

2006-01-29 Thread Adrian Holovaty
t for subsequent accesses. There's no way to set variables in the template language, but if you're wanting to save on typing, I'd recommend passing 'blurb' as a variable in your template's context. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: FileField :: mx file size

2006-01-29 Thread Adrian Holovaty
;content"] > 1: # 10,000 bytes raise validators.ValidationError, "Please enter a smaller file." The trick here is to operate on field_data['content'] instead of field_data. File-upload fields are a special-case; they come across as a dictionary of {'filename'

Re: FileField :: mx file size

2006-01-30 Thread Adrian Holovaty
s something I've always thought HTTP could not > do... As far as the validator I posted, it does the validation *before* the file is saved to the filesystem, when it is still in memory. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: mod_python installation problems

2006-01-30 Thread Adrian Holovaty
ere are some known issues when PHP and mod_python are enabled at the same time. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: validators combined

2006-01-30 Thread Adrian Holovaty
On 1/30/06, Jiri Barton <[EMAIL PROTECTED]> wrote: > I have two text input fields in a form. At least one of them is > required. My question is, how can I check for this? Hi Jiri, Check out RequiredIfOtherFieldNotGiven and RequiredIfOtherFieldsGiven in django/core/validators

Re: Template inheritance problem

2006-01-30 Thread Adrian Holovaty
is a text from test.html > {%block mine%}Hello from test.html {%endblock%} > > > I use this view with the template > > > def TestTemplate(request): > return render_to_response('board/Index1') > ######## Make sure test.ht

Re: Lookup by week

2006-01-30 Thread Adrian Holovaty
people have different definitions of when they start, etc. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: What is save to use in __repr__

2006-01-30 Thread Adrian Holovaty
ct instance or (in the case of date fields) a datetime object. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: Question About Multi Column Keys

2006-01-31 Thread Adrian Holovaty
need a simple way of being able to specify an object to > delete. Nice explanation, Luke! I've added it to the FAQ. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: Can not start admin on production server

2006-02-01 Thread Adrian Holovaty
l need to run the command "python manage.py install admin". Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: ManyToMany: get_FOO_count() and get_FOO()

2006-02-02 Thread Adrian Holovaty
ment as > well. Hey Jan, This is going to be fixed in Django's next version, which changes the DB API. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: Template cache which speeded up my setup 25 times

2006-02-03 Thread Adrian Holovaty
of decoupling template settings in another thread. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: DB Error: String value is not quoted

2006-02-03 Thread Adrian Holovaty
ription) ...becomes this: f = foos.Foo(name=name.encode(), full_path=full_path.encode(), description=description.encode()) I believe the next version of psycopg fixes this, but we don't have a Django driver for it yet because psycopg 2 is still in beta. That said, somebody wrot

Re: SQL debugging

2006-02-03 Thread Adrian Holovaty
x27;ve clarified the FAQ a tiny bit, although it seems like clarifying it more could introduce confusion. Really, it's just a log of every query made to the database -- no more, no less. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: Problems with unicode strings and database

2006-02-03 Thread Adrian Holovaty
x27;ll just say again, for the sake of the archives, that you need to use .encode() on any Unicode string before passing it to the database layer. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: how to reference another function inside mode class

2006-02-03 Thread Adrian Holovaty
jango currently does, but it'll be gone in the next version. To solve your problem, put the following in your model's "class META": module_constants = {'bar': bar} Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: Removing the Magic Branch release schedule

2006-02-03 Thread Adrian Holovaty
tp://code.djangoproject.com/wiki/RemovingTheMagic Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: Placing urlpatterns inside view files

2006-02-03 Thread Adrian Holovaty
s, views and manipulators any way you want. There's no restriction on where they live, as long as they're somewhere on your Python path. The only requirement is that the module that contains the URLconf needs to have three module-level variables: urlpatterns, handler404 and handler50

Re: Serving xhtml with correct mime-type

2006-02-04 Thread Adrian Holovaty
leware/ The documentation page is your key to Django nirvana. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: Selecting one related object.

2006-02-07 Thread Adrian Holovaty
So summing up - is there a way to fetch a given object + a related > object, or do I have to do it with handmade SQL? If you don't want to use select_related, you'll have to do it with handmade SQL. We've talked about adding the ability to pass some options to select_related but hav

Re: Dynamic choices

2006-02-08 Thread Adrian Holovaty
model to avoid this problem entirely. The "choices" parameter is intended for a finite list of choices that never change. When you're dealing with data that needs to be dynamic, use the database. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: truncate html filter?

2006-02-08 Thread Adrian Holovaty
On 2/8/06, Milton Waddams <[EMAIL PROTECTED]> wrote: > I'm wondering if anyone has a filter which safely truncates html so as > not to chop through tags. Hey Milton, You could try using the Python interface to HTML Tidy: http://www.egenix.com/files/python/mxTidy.html

Re: "... is an invalid model parameter" -- huh?

2006-02-09 Thread Adrian Holovaty
s the error: > the_unternehmen = meta.ManyToOne(unternehmens.Unternehmen, 'id') You want this instead: the_unternehmen = meta.ForeignKey(unternehmens.Unternehmen) You're never supposed to use meta.ManyToOne directly -- if you let me know where you saw that, I will correct the doc

Re: auto-login upon registration

2006-02-10 Thread Adrian Holovaty
o this, after you've created the User object (u): request.session[users.SESSION_KEY] = u.id I've added a section to the docs: http://www.djangoproject.com/documentation/authentication/#how-to-log-a-user-in Adrian -- Adrian Holovaty holovaty.com | django

Re: tiny patch to improve the url validating regex

2006-02-10 Thread Adrian Holovaty
url_re pattern accepts only url begins with "http://";. Hey Eric, Thanks for the pointer on this. I've updated the code in trunk to accept "https". Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org --~--~-~--~~~--

Re: iterator lookup function crashs

2006-02-10 Thread Adrian Holovaty
On 2/10/06, Sebastien Fievet <[EMAIL PROTECTED]> wrote: > TypeError: got unexpected keyword argument 'event__exact' > > What's wrong with my code ? (I've got the last SVN version of Django, > v2299) Hey Sebastien, You need to use event__id__exact, not eve

Re: locale settings

2006-02-10 Thread Adrian Holovaty
in Django or why this is not used in Django as default? I'm not sure I understand the problem -- could you give a bit more explanation, possibly with an example? Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org --~--~-~--~~~---~--~--

Re: Bug in MultiValueDict?

2006-02-10 Thread Adrian Holovaty
havior. When you access an element in a MultiValueDict, it returns the last item, as a string. See the docs for more info: http://www.djangoproject.com/documentation/request_response/#querydict-objects If you want to get a list instead of a string, use data.getlist('costs') instead of data[&

Re: Background process?

2006-02-11 Thread Adrian Holovaty
Hey Ned, That's exactly how I'd recommend doing it. There's no sort of event or scheduling framework within Django itself -- we've always relied on cron to do repetitive tasks. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: Actions on startup?

2006-02-15 Thread Adrian Holovaty
is. We could easily add a hook for you, though. The magic-removal branch has a new dispatching framework (we're using PyDispatcher), so if you're willing to wait for that, we can can add the hook there. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: Actions on startup?

2006-02-15 Thread Adrian Holovaty
;m looking for. Not > an elegant solution, though. Ah, right. By that logic, you could also put stuff in your settings module, but I agree that it'd be inelegant. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: prefill admin forms

2006-02-15 Thread Adrian Holovaty
ttp://somedomain/admin/blah/authors/add/?author=foo If you need to populate a foreign-key value, use the ID of the value. http://somedomain/admin/blah/authors/add/?author=3 Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

Re: some suggestion about url parsing?

2006-02-15 Thread Adrian Holovaty
rgs): return HttpResponse("Hello world.") foo_instance = Foo() If the above code lives in path/to/bar.py, you'd put "path.to.bar.foo_instance" in your URLconf. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org --~--~-~--~

Re: MD5 Password being changed to SHA1 and no longer working

2006-02-15 Thread Adrian Holovaty
with which future logins do not work. Hmmm, I don't recall anybody having this issue, so I suspect it's something with your code. Are you, perchance, subclassing the auth.User model or doing anything else custom with the auth app? Adrian -- Adrian Holovaty holovaty.com

Re: mod_python Segmentation fault importing django.utils.feedgenerator.py - with fix

2006-02-15 Thread Adrian Holovaty
other causes), please speak up. http://www.djangoproject.com/documentation/modpython/#if-you-get-a-segmentation-fault Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org --~--~-~--~~~---~--~~ You received this message because you are sub

Re: mod_python Segmentation fault importing django.utils.feedgenerator.py - with fix

2006-02-16 Thread Adrian Holovaty
ks. I've updated the documentation: http://www.djangoproject.com/documentation/modpython/#if-you-get-a-segmentation-fault Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org --~--~-~--~~~---~--~~ You received this message because you are

Re: DB.cursor doesn't work properly

2006-02-16 Thread Adrian Holovaty
bject, not the cursor object. cursor = db.cursor() cursor.execute("UPDATE something...") db.commit() Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org --~--~-~--~~~---~--~~ You received this message because you are

Re: Collecting field data in admin when field is not in model

2006-02-17 Thread Adrian Holovaty
ot; here: http://www.djangoproject.com/documentation/model_api/#admin-options Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django user

Re: ForeignKey dropdown list in custom view

2006-02-17 Thread Adrian Holovaty
place -- foods.get_object(pk=whatever) -- pass the select_related=True argument. That'll automatically grab and cache the related Period object as well. For example: foods.get_object(pk=3, select_related=True) If you don't do select_related=True, your call to f.get_period() will execute

Re: Adding a list filter that points to a function?

2006-02-18 Thread Adrian Holovaty
stom methods aren't supported in list_filter. In order for that to work, Django would have to select every single record of the database and filter them in memory, which is not something we want to do. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org --~--~--

Re: user login over ssl

2006-02-22 Thread Adrian Holovaty
On 2/22/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > How could we have a user login to a django-powered app over ssl? Hi Chris, There's nothing Django-specific about using SSL. Just set up your certificates and stuff in Apache and set up Django as usual. It just works. Adr

Re: django without database

2006-02-23 Thread Adrian Holovaty
is, just write your views and don't make any database calls; it's simple. :) Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups &quo

Re: django without database

2006-02-23 Thread Adrian Holovaty
odel so it wouldn't make much sense to use them without database tables. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django us

Re: Django versions

2006-02-24 Thread Adrian Holovaty
#x27;s the most stable and has the latest non-magic-removal features. The magic-removal branch is still for living-on-the-edge developers at this point. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org --~--~-~--~~~---~--~~ You rec

Re: ORDER BY on get_object?

2006-02-25 Thread Adrian Holovaty
ome people might be using, for example, get_object(limit=1), relying on the fact that get_object() would be using the model's ordering. However, I think this is an acceptable change, as long as we document the change on the backwards-incompatible changes page. Any objections before I check in

Re: ORDER BY on get_object?

2006-02-25 Thread Adrian Holovaty
As of revision 2392 in trunk, I've made this change. ORDER BY is no longer added for get_object() queries, unless you explicitly specify it. Thanks again for suggesting, Ned! Adrian --~--~-~--~~~---~--~~ You received this message because you are subscrib

Re: Django scalability question

2006-02-27 Thread Adrian Holovaty
so do some sort of database replication, but I haven't had to deal with that in my experience. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dja

Re: Class in views.py

2006-02-27 Thread Adrian Holovaty
u can put whatever the heck you want in views.py -- it's just a normal Python module, with nothing magic about it. If you paste your full traceback, we may be able to help debug your problem. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com --~--~-~--~~~--

Re: code mod to get raw admin template output

2006-02-28 Thread Adrian Holovaty
On 2/24/06, hsitz <[EMAIL PROTECTED]> wrote: > Back in middle of last year Adrian Holovaty posted some very helpful > information on how to get the raw output of admin templates for use as > basis for your own views. I'm a newbie trying to get my head around > Django, an

Re: Model Basics

2006-02-28 Thread Adrian Holovaty
has anyone had any other thoughts about how to implement > this? Yeah, we talked about this on Sunday at the Django sprint. The tentative plan is to introduce a CurrentUserField which is special-cased in the admin logic. Adrian -- Adrian Holovaty holovaty.com | djangoproject.c

Re: Django in a Load-Balanced environment (ORM issues) ...

2006-02-28 Thread Adrian Holovaty
e could roll this into Django proper in a generic way if there's a demand. Alternatively, SQLAlchemy solves this problem by implementing an identity map, which is quite cool. You should be able to use SQLAlchemy with the rest of Django with no problems at all -- the only thing you won't be

Re: Django in a Load-Balanced environment (ORM issues) ...

2006-03-01 Thread Adrian Holovaty
go is to activate potentially complex/performance-heavy features only on an opt-in basis. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "D

Re: Django scalability question

2006-03-01 Thread Adrian Holovaty
ss/ . No problems. And if/when there are problems, they'll be at the database level, not at the Django level. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: caching questions

2006-03-01 Thread Adrian Holovaty
we were to allow certain views to be left out of the cache, the cache middleware would have to do URL dispatching to find out what the associated view is, then check the view to see whether it should use the cache, then finally check the cache. The extra overhead of URL dispatching isn't a hug

Re: Django Admin

2006-03-01 Thread Adrian Holovaty
stable trunk, or the latest released version (0.91) if you're starting with Django. The magic-removal branch remains for core developers only at this point. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com --~--~-~--~~~---~--~~ You received this mes

Re: Dreamhost - agh!

2006-03-02 Thread Adrian Holovaty
still kinda-sorta affordable in the grand scheme of things if you're serious about making Web apps. Note that I'm not affiliated with 1and1 in any way, and I'm sure there are plenty of other (even cheaper) alternatives. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com --~

Re: Django filter hack

2006-03-12 Thread Adrian Holovaty
, anyway? I'm not in a position to apply the patch to my local copy.) Adrian -- Adrian Holovaty holovaty.com | djangoproject.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Re: import calendar

2006-03-12 Thread Adrian Holovaty
called calendar :) You > can tell I'm new to Python (and Django) Yeah, that one got me when I was learning Python, as well. :) We ought to improve manage.py to disallow project names that conflict with common Python standard-library modules... Adrian -- Adrian Hol

Re: variables in a variable in templates

2006-03-12 Thread Adrian Holovaty
orted. To accomplish what you want, you'll have to write either a custom tag or filter. (It's easy enough to do.) Adrian -- Adrian Holovaty holovaty.com | djangoproject.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Question about _pre_save

2006-03-12 Thread Adrian Holovaty
ailable ID in _pre_save(). Then compute your value based on that. * Write a trigger at the database level that automatically calculates the computed field whenever a record changes in the table. This would be entirely out of Django's control,

<    4   5   6   7   8   9   10   11   >