e and
update.
See the Django tutorial for full information on how the admin site works.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Dja
f. See the "Forms and
manipulators" documentation.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to t
#x27;t already in the
database).
(I'll insert the standard disclaimer here that magic-removal is not
ready for production use and is only for the faint of heart.)
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received th
You'll need to use the
PythonInterpreter directive to tell Apache not to mix those
interpreters. See the docs for full information:
http://www.djangoproject.com/documentation/modpython/#multiple-django-installations-on-the-same-apache
Adrian
--
Adrian Holovaty
holovaty.
t's not currently possible. I'd recommend just writing your own
view -- it shouldn't take much code.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
On 3/13/06, Luke Plant <[EMAIL PROTECTED]> wrote:
> On Monday 13 March 2006 15:20, Adrian Holovaty wrote:
>
> > (I'll insert the standard disclaimer here that magic-removal is not
> > ready for production use and is only for the faint of heart.)
>
> Only for
7;t
make much sense to use them.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email
et us know how it goes.
def get_table_list(cursor):
raise NotImplementedError
def get_table_description(cursor, table_name):
raise NotImplementedError
def get_relations(cursor, table_name):
raise NotImplementedError
def get_indexes(cursor, table_name):
raise NotImplementedError
Adrian
--
d out an easy way to do this in the admin. Is there some
> setting I completely missed? Thanks in advance!
Hi Yuri,
Yes, this is entirely possible. See the DATE_FORMAT, TIME_FORMAT and
DATETIME_FORMAT settings. They're documented in the "Settings"
documentation.
or
> example, the calendar widget in the admin men is still entering dates
> in the US format, even though the settings for the variables you
> mention are set to the european format.
Hi Yuri,
That part isn't changeable at this point.
Adria
tch would certainly be welcome.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
r database command-line client and type "\dt" (Postgres) or
"show tables;" (MySQL) to list the table names.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed t
eeping in to this list
I've been deleting each one and marking them as spam in the Google
Groups archives. It's best to ignore them.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you a
Key(Building, edit_inline=meta.TABULAR)
> ..
>
> class Light(meta.Model):
> window = meta.ForeignKey(Window, edit_inline=meta.TABULAR)
> ..
>
> Opening an entry in the Window table correcly shows all Lights. Opening
> an entry in
o the Django community, and thanks for the note!
There have been *several* discussions about adding such a feature, and
even a few attempts at implementing it. Database schema changes are a
hard problem to automate, so we haven't come up with anything perfect
enough yet. Specific ideas and implemena
'hidden' property or function like:
> self.content_type or self.get_content_type
The cleanest way to do this would be:
from django.models.core import contenttypes
ct = contenttypes.get_object(package__package__exact='news', \
python_module_name__ex
ed to remove duplicates:
dict([(c.get_poll(), 1) for c in
choices.get_list(choice__exact='foo')]).keys()
(The second example exploits the fact that dictionaries can't have
duplicate keys.)
The database API doesn't support this kind of "reverse" lookup in 0.91.
On 3/19/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote:
> Here's how I'd solve this particular problem:
>
> [c.get_poll() for c in choices.get_list(choice__exact='foo')]
>
> If you need to remove duplicates:
>
> dict([(c.get_poll(), 1)
rect and
> it works in another host with the same settings.
Does the "apps" directory have an __init__.py file in it? Generally
that "no module named..." error signifies there's no __init__.py.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-
gant importing system
and do things like "from django.db.models import IntegerField as
IntegerCol" if you're really concerned about the names. You could even
create your own module of renamed field classes and import from there.
Adrian
-
axlength,
because maxlength=200 would result in a horribly long field. There
would have to be some sort of upper limit.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
this could be done
Hi Mary,
This should be as simple as using your custom code in one place, and
other custom code in another place. If the two usages are different
enough, there's no point in sharing code -- just make them separate
applications.
Adrian
--
Adrian Holovaty
holovaty.
this could be done
Hi Mary,
This should be as simple as using your custom code in one place, and
other custom code in another place. If the two usages are different
enough, there's no point in sharing code -- just make them separate
applications.
Adrian
--
Adrian Holovaty
holovaty.
tly
passed. We're removing the magic, not adding to it! :)
But as for your question, it seems like you're getting that error
because you're passing in 'queryset' twice.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~-
On 3/22/06, Alan Bailey <[EMAIL PROTECTED]> wrote:
> Thanks! Silly me. But maybe a mention in the custom SQL section pointing
> to the where / tables stuff would be good.
Good idea! I've updated the docs to put in that pointer. Should be
live on the site within 15 minutes.
he final product we'd want Wilson's loving
design touches. Also, this does a good job of pointing out the areas
in which we need to add docstrings.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message be
y your database provides. Or,
if you absolutely want to do it in Python, use the
cursor.executemany() functionality of the Python DB-API layer.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you
#x27;t change the naming convention on a global level, but you can
manually override the name of the database column by specifying
"db_column" in the field parameters. For example:
foo = meta.ForeignKey(Foo, db_column='foo')
The docs are here:
http://www.djangoprojec
#x27;ve
removed that print statement and checked in the change.
By the way, you might be the first person ever to use Django with CGI.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
otice] child pid 13817 exit signal
> Segmentation fault (11)
>
> does anybody have an idea what goes wrong?
Hey there,
Check out the Django/mod_python docs for some possible explanations/solutions.
http://www.djangoproject.com/documentation/modpython/#if-you-get-a-segmentation-fau
/documentation/models/
That's incorrect; you do indeed get the model examples. Although it's
not obvious, they're in the directory tests/testapp/models directory
of the Django distribution. The model examples are generated
automatically from th
#x27;t set to True. If it's set to True,
Django will log every database connection in the variable
django.core.db.queries, and that variable is never purged or reset.
If you're not using DEBUG=True, could you give more information, such
as your model?
Adrian
--
Adrian
rade
to the development (Subversion) version, and you should get a clearer
error. Hope this makes sense!
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
ng a tag for that -- it's the right tool for the job.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
formation, I guess. Alternatively, we
might be able to move the standard error e-mailing bit into a
middleware of its own, so it can be overridden. If neither of those
solutions work, we could add a specific hook for this, too. Let us
know what you think!
Adrian
#x27;ve never used J2EE (or any Java at all, actually), so I
certainly couldn't write that chapter. Not sure on the final deadlines
of the book yet -- we're just now firming that up after having
submitted the first couple rounds of drafts.
Adrian
lower().replace(' ', ''))
You're right to imply that this goes against the DRY principle,
because you have to define URLs in two places -- the URLconfs and the
models. In practice, this isn't that big of a deal (in my humble
opinion), but we've given some th
CSS
and images. I would prefer not to include all of that in the main
Django distribution, because it's a lot of cruft.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the G
ing the fix.
Thanks, guys! I've commited that.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send
ixed in Django's development branch and will no
longer be an issue in the next release.
For now, you could hack around it by removing that button with
JavaScript using the admin.js hook...
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~--
; it's been this way since the first public
> release of Django. Adrian and others have said elsewhere that it's not
> nice and they'd love to see a better way to handle this, but no-one's
> yet come up with one that works.
Yeah, precisely. Elegant solutions are qui
specify the
blocks. I believe we have unit tests backing that up.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to t
I'm still digging into this one, but is this a
> known issue?
I'm not aware of any problems with select_related...Could you paste
the exact code you're using?
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
make any changes to data
(assuming you're dealing with read-only views).
The other thing to be aware of is you'll want to manually make sure
not to install a database table for your model, because it'll be
hitting a view instead.
Adr
us far. (I'm
on Linux/Apache, which appears to make a difference, I guess...)
Keep us posted!
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Dja
an SQL statement failed and the error wasn't caught
until the *next* statement was executed. So the SET TIME ZONE query
isn't the one that failed -- it's the one that happened just before
that.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~-
e issue was resolved yesterday in
http://code.djangoproject.com/changeset/2655 . It no longer throws
ImportError if an imported model isn't in INSTALLED_APPS.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message b
te" your code, and all will be well.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
N a ON b.id=a.b_id WHERE b.a_id IS
> NULL;
>
> How would I construct such a query using the Django ORM?
That's not possible with the Django ORM, but you can drop into raw SQL
quite easily. See this page for an example:
http://www.djangoproject.com/documentation/models/custo
uot;models.TABULAR" is wrong now.
"svn update" your magic-removal code, and all should be well.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Grou
.
Django 0.92 will *definitely* be out before the book comes out.
Possibly Django 1.0 will be out before the book.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Gr
it'll be 0.92 and
magic-removal will be 0.95, to signify it's a big leap. Thoughts?
For your immediate concern, I'd urge you to use Django's trunk.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received th
many more changes are expected before a new release or in other
> words: what's the schedule? :)
Look for an announcement on this soon...It's about time to get a
schedule set up.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--
g against them, just that we've never found a use for them.)
That said, we'd be happy to accept patches that add schema support!
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are s
ngth=250,
> choices=getDirs())
>
> with a custom getDirs method that uses python os module and returns a
> list of 2 tuples of the desired directories.
Hey Frank,
The FilePathField solves that exact problem. The docs are here:
http://www.djangoproject.com/documentation/model_api/
jango development version**".
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users
o
maybe it's not as big of a question as I'm making it out to be. Maybe
it doesn't make sense to put the schema in the model?)
I forgot to mention this ticket, which has a patch for adding schema support:
http://code.djangoproject.com/ticket/1051
That's on an older v
tried replacing self.vendor.name
> with self.vendor.get_name() but with the same results.
Hey Scott,
Change the __repr__() of ServerModel to this:
return (self.get_vendor().name + " " + self.model)
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~
like that exists (to my knowledge) for Django,
but it wouldn't be too hard to do, I don't think. Could be a nice pet
project for somebody!
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you ar
t Django involved in Summer of
Code. We'll set something up.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to thi
ht proposal. Give it a shot (on the magic-removal branch,
please), and keep us posted...
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django user
,100])
>
> would work as expected and not return string instead ? If not, I'll add
> a ticket, though I'm not sure if it should be filed as an enhancement
> or a bug; certainly the current behaviour is surprising, to say the
> least.
Hi George,
I don't follow w
the matter, or you can find similar discussions
across the Internet using your favorite search engine.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"
7;, db='foo', passwd='foo')
>>> cursor = connection.cursor()
>>> cursor.execute('select ...')
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you ar
for that functionality.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users
andard
Django view with the admin look-and-feel.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send e
ngs out on the Django mailing list,
so he might be able to shed more light on the issue.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django
the magic-removal branch:
http://code.djangoproject.com/wiki/RemovingTheMagic
Please feel free to ask questions on the django-developers mailing list.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message
ind what
> I'm looking for
At the end of the day, this isn't a huge problem. If you're looking
for something that you know is in the sidebar, just look at the
sidebar. It's pretty short!
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~
ates for Python programmers" docs). An example of this
is in run_tests() method in tests/othertests/templates.py. It's
hackish, but it works. If there's interest, we can expose things so
that you pass in the loader list as an optional argument to
g
On 4/20/06, Andy Dustman <[EMAIL PROTECTED]> wrote:
> Do statements generated by Django have columns in a deterministic order?
Just for the record, yes, the columns will always be in the same order.
Adrian
--
Adrian Holovaty
holovaty.com | djangopr
x and
Solaris). Frankly, it knocks the crap out of any other
dynamic-language framework I'm aware of, performance-wise.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
n't explain
> which MPM.
Good call. I've updated the docs.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" gro
model to something more detailed?
You'll either have to change __repr__() or specify "list_display" in
the "class Admin". I could see some value in adding a hook in the
"class Admin" to override the object's __repr__() in the admin
interface, though.
ure additions have been frozen for the moment.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, se
REATE TABLE `test_test` (
> `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
> ... some other fields ...
> `bool_field` bool NOT NULL
>
> It doesn't generate the DEFAULT "1" part...
Hi Viktor,
Default values aren't created at the SQL
ssion object s, use s.get_decoded() to get the session
data, which should be a Python dictionary.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django
;s no way to limit the inline
related objects in the admin, because we've never had a need for that.
It's either all or nothin'!
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are sub
tting an error message which indicates that it's using the 0.91
> version of Django.
Hi tomass,
You want the "PythonInterpreter" directive. See "Multiple Django
installations on the same Apache":
http://www.djangoproject.com/documentation/modpython/#multiple-django-inst
gt; from within a view, I get:
>
> TypeError at /cadastro/pesquisa/
> got unexpected keyword argument 'servicos__id__exact'
Hi Luis,
When using the Django database API, you use the field names, not the
model names. So you want this:
cadastros.get_list(serv_cliente
't consider this a bug, but
perhaps we should document it more clearly.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" gro
e "id IN ()" is utterly
meaningless, because a lookup of an ID in an empty list would still
return all records.
In short, it's up to the developer to be more explicit about what he/she wants.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~-
ot; by mistake and aren't yet ready for the
magic-removal APIs, you'll be able to "svn switch" back to the last
version of pre-magic-removal Django, which will be tagged in
Subversion.
Look for an announcement here (on both the django-users and
django-developers mailing lists)
;final" version of 0.91 that has a few months' worth of bugfixes
applied.)
As always, thanks for using Django.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Goo
s a bug or can I just not follow
> instructions?
Hi Dave,
I still haven't proofread the tutorial for the magic-removal version
but hope to get to that this evening. I apologize for the general
incompletion of it and any errors.
Could you copy-and-paste your urls.py file? That'd help us d
objects. Continuing Wilson's example, you may want to change
the ordering of choices for a given poll.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
ce I try to
> avoid doing custom SQL as much as possible for portability purpose.
Hi Cheng,
There's no cleaner way to get the same thing, but I think that would
be a fine addition. Maybe something like
Poll.objects.populate_related_aggregates('choice', 'count
Hi Tom,
You've put the tags in the right place, and Django's looking in the
correct place, but I suspect there's some sort of syntax or import
error in your template library. Try running "python automator.py" to
see if it spi
On 5/2/06, Eric Walstad <[EMAIL PROTECTED]> wrote:
> For those of us cast off to drift with the floating sargasso of
> 'pre-magic-removal', this way to the life raft:
Man, we *sooo* should've called that tag "floating-sargasso".
Adrian
--
Adrian Holo
ee with how I think this should work?
>
> (Of course I'd clean this up and move the import to the proper place in
> a patch)
Hey Adam,
That patch looks pretty decent -- go ahead and file a ticket!
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~-
image lives in the Django source tree:
django/contrib/admin/media/img/admin/icon_addlink.gif
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django u
d on the Web site within 15 minutes.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to djang
;." not in col_name and col_name not in [k for k in (self._select or
> ())]:
>
> for k[0] will be the first letter of the key in self._select, not the
> key itself. I'll submit a ticket for it.
That ticket's been committed. Thanks
ed'
> should be
> urlpatterns = patterns( 'django.views.generic.date_based' ,
All right, I've fixed 'em.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you
nts.get_list(semester__id__exact=1, category__id__exact=2)
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, se
On 5/3/06, Sean Perry <[EMAIL PROTECTED]> wrote:
> That get_FOO_filename should be save_FOO_filename.
Thanks, Sean! I've fixed it, along with another, similar, typo.
If you could, please file these sorts of things in the Web ticket
system -- things tend to get lost on the mailing
Nice! Thanks for this! I'm new too and this already looks like a great
resource.
On Sunday, October 3, 2021 at 5:01:41 AM UTC-7 bnmng wrote:
> I think you'll get a few opinions on this. My opinion is no. I feel the
> docs are very good but difficult to understand as a beginner. I like
> Moz
Hi Emily,
On 22 Jun 2012, at 15:46, Emily wrote:
> This is the class I created...
>
> import string
> import random
>
> class Helpers:
>
> def random_password():
Take random_password outside of the Helpers class and you should be OK. On the
import statement you need to refer to a 'top
On 25 Jun 2012, at 17:41, Soviet wrote:
> I'm new to this Django thing and I run into first problem :).
>
> Let's say I have two models and in each I have field with ForeignKey
> relating to field in other model (hope it's clear). Now that I want to
> run migrate with South, I'm getting "NameErr
On 25 Jun 2012, at 17:53, Soviet wrote:
> Thank you kind sir for your fast response, that worked brilliantly.
> Can I be cheeky and ask why does it work? :)
Magic! ;-)
Although seriously, Django obviously has some code in there to handle just the
situation you have come across. Sorry, I don't
901 - 1000 of 1037 matches
Mail list logo