ased on a lot of data and
> user interaction before getting the final end result, with the chance
> to back out and redo, etc.
Hey Fried Egg,
Check out the sessions documentation:
http://www.djangoproject.com/documentation/sessions/
We should have some other example apps (besides the p
s out the other database wrappers (Postgres and SQLite) don't mind
if you pass an integer value to autocommit(), so I've added that to
the code in revision 805. Thanks again for the heads-up on this!
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
me to do this.
>
> This doesn't seem to work though and the resulting object's attribute
> names are actually those of the database columns and not the field
> names I've specified in the class. Is this a bug?
Not a bug -- the object's attributes are mapped to the
UI is capable of this; if it is then what
> do i have to do to my model? if it isn't then does anyone have any ideas
> about where to start?
Hey Ranting Hippy,
The current admin UI isn't capable of this. The many-to-many has to be
either in one or the other.
Adrian
--
Adrian Holo
x27;server arrangements' wiki page?
> http://code.djangoproject.com/wiki/ServerArrangements
Great idea. I've added the link.
http://www.djangoproject.com/documentation/install/
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
he slippery slope of turning the
template language into a programming language. In your case, pass
ITEM_NAMES[item.type] to the template context.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
hout the Django code, we use
new-style classes only when there's a specific need to do so -- like
when we want to use properties.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
03293554cece
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
#x27;t
assume that the template doesn't already have a variable named
"content", and the double underscores are a bit crufty. Perhaps {%
get_block_value "content" %} ? That's kind of verbose...
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
many-to-many relationship. If there's a demonstrable need, we can
consider adding it, though.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
; spend lots of time in this pitfall.
I've updated the docs to point this out. Thanks for bringing it up!
http://www.djangoproject.com/documentation/django_admin/
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
to subclass "object" in class definitions?
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
On 10/19/05, tomass <[EMAIL PROTECTED]> wrote:
> TemplateSyntaxError: 'auth.log' is not a valid tag library
> [...]
> Should mention that I've just upgraded to the latest version.
Delete django/templatetags/*.pyc and django/templatetags/*.pyo, and
let us know if
On 10/20/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> great start. just two comments. why use mnemosyne as the example? why
> not something more generic like "myapp" ?
I had this same question: What's a mnemosyne? We should change it to "myapp".
Ad
#x27;d even go so far as to say we could include the above base.html and
base_generic.html in the Django distribution proper, to give people a
starting point when creating their templates.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
.append(str(getattr(self, piece)()))
>
> AttributeError: DateFormat instance has no attribute 'P'
Fixed as of revision 976.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
On 10/20/05, Laurent RAHUEL <[EMAIL PROTECTED]> wrote:
> THX, it was the problem. I guess this should be added to the documentation.
I've updated the docs at
http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges .
Adrian
--
Adrian Holovaty
holovaty.com | dja
e all excited about that. :)
Finally, if you just want to "redesign" the admin, feel free to create
your own admin/base.html and admin/base_site.html templates. Those
provide the look and feel, and CSS, for the entire admin site; i.e.,
that's not hard-coded.
Hope this answers your questions,
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
e django stuff (as it seems). Would you
> think the new-admin branch is mature enough to be used instead of the
> trunk?
I've never used the new-admin branch myself, so I can't vouch for its
stability or maturity. It's completely unofficial (and under heavy
development) at this point.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
s or whatever) is executed manually in a transaction.
As World Online deals with different versions of Django apps on
different servers, Jacob has been talking about creating a
"versioning" subframework for apps, which would manage things so that
they don't get out of sync.
Adri
s and changing a couple of import
statements.
I realize this doesn't give you a definitive answer, but I hope it
helps somehow. :)
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
On 10/22/05, Dan Lipsitt <[EMAIL PROTECTED]> wrote:
> TemplateSyntaxError: 'log' is not a valid tag library
> [...]
> I just upgraded to rev 992. I deleted the old egg first, and I also
> tried removing the .pyc files as Adrian described (there were no
> .p
rants.get_list(city__id__exact=n, categories__contain=category)
Hey Pistahh,
Try this:
restaurants.get_list(city__id__exact=n, categories__id__exact=3)
(Assuming you want category 3.)
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
ion, which doesn't yet
mention how messages work, is here:
http://www.djangoproject.com/documentation/authentication/
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
ot;django.contrib.admin" needs to be in INSTALLED_APPS.
* Your database needs to contain the admin table (i.e., you need to
have executed "django-admin.py install admin").
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
pt or process that adds correct site info in
the DB -- that's a manual thing at this point. That's definitely up
for discussion, though. The only reason sites aren't editable in the
admin is to save people from themselves -- so they don't inadvertently
delete a site, wh
the millisecond (or maybe even microsecond?)
level, whereas editing the date/time value via the form field is only
accurate to the second. So Django things the value has changed.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
go is full of surprises. ;-)
Yes, that's in the template. See Tutorial 2 for information on how to
change that:
http://www.djangoproject.com/documentation/tutorial2/#customize-the-admin-look-and-feel
It's the part that begins: "Clearly, having 'Django administration'
and &
;"
> 2. I need to resize the image and play with it with PIL. Is it possible
> to transfer the image to an image object without saving it and then
> giving it's full path to load it?
I haven't tested this, but PIL's Image.open() function takes any
file-like object, so you might be able to pass it a StringIO proxy.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
s that don't deserve their own
> actual file?
It's always better to put the content in the database rather than in
the template.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
work properly with these models. I
> either get errors or strange behavior.
It'd be a great help if you gave details about which errors and
strange behavior you got. Without that, we can't help much. :)
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
t field, but I
> want to add a constraint and a default value in this way:
> - default value should be "Unknown"
> - "Unknown" value has not to be accepted as a valid value for that
> field by the admin interface
If "Unknown" values are not allowed, it seem
from django.core import validators
def is_not_null(field_data, all_data):
if field_data in (None, ''):
raise validators.ValidationError, "This field is required."
# ...
meta.NullBooleanField(validator_list=[is_not_null])
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
7;s late in the
> night :)
Solution 1 avoids "" as a possible choice because the field
doesn't have "blank=True". By default, "blank" is set to False, which
means the field is required (i.e. cannot have a blank value). Hope
that clears it up for ya!
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
I'd be happy to help! Note that the World Online forum application
(e.g. http://www2.ljworld.com/forums/) is just a light wrapper around
the django.contrib.comments framework, which ships with Django.
Writing a basic forum app is easy. The hard part will be integrating
*all* the various features
On 11/1/05, James Bennett <[EMAIL PROTECTED]> wrote:
> On 11/1/05, Emanuele <[EMAIL PROTECTED]> wrote:
> > Now I see. So "" means blank value. I missed it in the docs. Thank
> > you again!!
>
> No, the example Adrian provided had the tuple ('
rdinate items prior to being saved to database (well, it's
> called pre_save, right?) in order to do some simple calculations before
> the items get saved.
>
> Does anyone know how this could be done?
A model's _pre_save() method doesn't have access to any re
ger transaction, and no
knowledge of related objects.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
ulates validation and form display.) See the docs here:
http://www.djangoproject.com/documentation/forms/#custom-forms-and-manipulators
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
is
"state", so here's what you'd want:
items.get_list(state__state__in=['Open'])
The first "state" refers to the "state" field in Item. The second
refers to the "state" field in State.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
lso work is that removing "primary_key = True" in the State model
implicitly creates an "id" field. In that case, state__id__in would be
a valid lookup parameter.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
it!
See http://code.djangoproject.com/ticket/251 for the probable replacement.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
child objects?
Yes, if you use the .delete() method on model objects, child objects
are deleted recursively.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
little unnerving.
Yup, it's the same error. I'm not sure why it started happening...It
didn't *use* to do this, up until a couple of weeks ago. Anybody have
any ideas?
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
g
> them to the db?
There's no way to do this in the default (automatic) Manipulators, but
doing it on your own, with a custom manipulator, should be easy. Check
out the docs:
http://www.djangoproject.com/documentation/forms/#custom-forms-and-manipulators
Adrian
--
Adrian Holovaty
holova
min change-list page after you've
applied a filter or done a search. The query parameters are,
essentially, the same as keyword arguments that can be passed to
get_list().
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
urse. If you're concerned
with efficiency, you can write the SQL manually. See the example here:
http://www.djangoproject.com/documentation/models/custom_methods/
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
t_list().
> >
> Ok, I get that. But, can I load those applied parameters in my code or
> in my models?
Yes, just use those keyword arguments to get_list() in your own code.
I'm not sure I understand what you mean...Hope this answers your
question.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
On 11/4/05, limodou <[EMAIL PROTECTED]> wrote:
> I found that the zh_CN translation option should be "Simplified
> Chinese", but not "Traditional Chinese" in the global_settings.py in
> conf directory。
Fixed!
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
Feel free to add the CHECK to your SQL manually.
django-admin.py sqlall myapp > myapp.sql
vim myapp.sql # add the CHECK
cat myapp.sql | sqlite # pipe the SQL into SQLite, however that's done
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
x27;s "COPY" statement. If you're not worried
about efficiency, just use the API to insert one record at a time.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
d found something about
> including .sql files in a sql folder in the project directory. I guess
> the alter table statement could be included here. I am assuming the
> sql from the install gets loaded after the tables are created.
Yes, the SQL from the install gets loaded after the tab
cept of Web applications.
As of now, there's no way to specify that the currently logged-in user
should be stored in a field in the admin interface.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
n next to select boxes (for foreign-key
fields), which lets you add a foreign-key object. This appears on the
add and change forms.
The catch is that the foreign-key object needs to have "admin" set in
its model, and the currently-logged-in admin user needs to have
permission to add
select_related=True to its query
on the "change list" page if the list_display includes a ForeignKey
field. As you noted, though, using a custom method
("get_owner_fullname") doesn't tell Django that you're using a
ForeignKey.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
fference. Any
> suggestions?
Django isn't finding your settings.py file. It's falling back to
"postgresql" because that's the default fallback (according to the
file django/conf/global_settings.py).
Make sure your "myproject" directory is on the PYTHONPATH. You should
be able to switch to another, unrelated directory -- such as "/temp/"
-- start the Python interactive interpreter and type "import
myproject.settings".
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
quot; of
edit_inline is supported. It's not possible for edit_inline to span
more than one level.
However, this should be changing soon, with the new-admin code branch,
which is currently being developed.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
On 11/8/05, wrb <[EMAIL PROTECTED]> wrote:
> Does (or should) the edit_inline functionality for related class also
> support collapse option?
No, objects that are edited inline don't support the "collapse" option.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
and
HAVING. In your case, I'd suggest writing custom SQL, which is very
easy in Django. Check out this example:
http://www.djangoproject.com/documentation/models/custom_methods/
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
i = 0
> %}, but that gave me an "invalid block tag" error.
Check out {{ forloop.counter }} or {{ forloop.counter0 }}
(zero-based). Those variables are automatically available to you
within any {% for %} loop.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
value in dictionary.items()
That should work, exactly as stated.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
nd to this thread if you have any questions!
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
On 11/11/05, Maniac <[EMAIL PROTECTED]> wrote:
> Looks like there are no links to these docs from the documentation index
> (http://www.djangoproject.com/documentation/).
>
> I would look for them in the 'Available subframeworks' section.
Thanks, Maniac. I
be done?
Hi stava,
I've written documentation for you. Check it out here:
http://www.djangoproject.com/documentation/outputting_csv/
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
On 11/11/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Doesn't your template based approach require the model to do some
> formatting of the output before passing to the template to get the
> quotes in the right place?
No...I'm not quite sure what you mean.
A
On 11/10/05, Pablo Pernot <[EMAIL PROTECTED]> wrote:
> somebody knows a good (and cheap) django hosting provider ?
Check out http://code.djangoproject.com/wiki/DjangoFriendlyWebHosts .
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
smael, hugo, eric moritz and garthk for various
patches and ideas. Enjoy!
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
7;ve changed the example to use "member" instead of "user," to
underscore the fact that it's some random concept of "member" -- not
the "users" from the authentication system.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
-generic-views
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
dation functions, but if you want to do things like
checking for uniqueness, you'll have to write the validator function
yourself.
Hope this answers your question.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
lumn names
in its queries. Basically that means they're case-sensitive now.
You can fix your problem by either doing an ALTER TABLE in your
database to rename the column to "DMI_id" (note capitalization), or
changing your Python code to be "dmi_id".
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
te" probably won't delete the directory
"django/conf/app_template/views" in your Django distribution. You'll
need to delete this file manually. Otherwise, "startproject" will
create both a views.py and a "views" directory, which will confuse
Python.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
n the admin, then
you'll want to create a "page" model, which has foreign keys to the
types of content it's displaying, a field for the URL, and fields
representing the order.
This is a bit hard to explain, but I hope this has helped.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
his on my to-do list for this week. You're right -- it
should be a high-priority fix.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
at stuff, and we'll be able to help
you!
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
On 11/16/05, Bryan Murdock <[EMAIL PROTECTED]> wrote:
> I did an svn up last night and now the admin interface doesn't work.
> Here is the error I'm getting:
Hey Bryan,
Are you using the new-admin branch? I can't recreate this error using trunk.
Adrian
--
A
e
runs under) needs permission to read your templates.
> Are my MEDIA_whatevers pointing at the correct places?
MEDIA_ROOT and MEDIA_URL are mainly used by FileFields, so Django
knows where to put uploaded files. They're not relevant in this
particular problem.
Hope this helps!
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
classes have no knowledge of model objects.
All they know about is the basics for displaying a form. If you want
to pass the verbose_name of a model object, you'll need to create some
sort of custom data structure and pass it to your template.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
real applications.
Yes, this is by design. Models have no knowledge of whether they're
being used in a Web context, or in a shell script, or in a desktop GUI
app. Coupling models to Web requests would be convenient in some cases
but a bad design decision overall.
Adrian
--
Adria
questions, etc. It should be really fun.
Full information is here:
http://snakesandrubies.com/event/
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
this will eat up memory like a zombie.
Because sessions are stored in the database, this won't eat up much
memory. It's an interesting idea, and I'd encourage you to explore it
more and report back to the list with how it's working.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
-- so you'll need to use
another server, such as Apache, to serve the CSS file. Alternatively,
check out the django.views.static.serve, which is for development
purposes only and isn't yet documented (but will be soon).
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
t on the Web if you get a chance -- I'm
sure some people could find use in it.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
gt; reproducible on specific views though.
Hey Afternoon,
I'm not sure how much we can help unless you show us the view and
template code for the case in which it doesn't work. Post that, and
we'll be able to help you much better. :)
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
s" package isn't really a big
deal.
You can always split models across other *apps*, rather than creating
subdirectories within "models".
Hope this helps! Let me know if any of it wasn't clear.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
documents so that they mention this explicitly.
http://www.djangoproject.com/documentation/url_dispatch/
http://www.djangoproject.com/documentation/tutorial3/
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
generating PDFs, which should be very similar, but
> I wanted to see if others have had any success or issues.
Hey Warren,
This should be easy to do; just generate the appropriate output and
give it the appropriate mime_type.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
ne has done this before then I'll do it myself and submit a patch.
Nobody has brought this up before, and it sounds like it's just a case
of changing the MySQLdb call. Check out
django/core/db/backends/mysql.py.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
ledge. It would be possible --
and relatively easy -- to do if there were a DB-API-compliant ZODB
library. Is there one? I know nothing about ZODB, other than the fact
that it's associated with Zope. I think.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
I've fixed the longstanding OneToOneField bug. If you're using
OneToOneFields, update your trunk code and let me know whether things
work for you!
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
Passwords section of the authentication docs for full information:
http://www.djangoproject.com/documentation/authentication/#passwords
Finally, note that this change applies only to the Django development
version. If you're using Django 0.90, you won't see this change until
the next
d create it on the server side via
XMLHttpRequest and populate the field.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
racter is allowed in a
password.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
seen anything where
> you have to encrypt the password yourself first. Take out the message
> and nobody would even think about it.
If we assume it's always plaintext, that would mean you'd have to
enter the password for an individual user each time you changed that
user.
27;s in the development version.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
framework:
http://www.djangoproject.com/documentation/sessions/
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
or all apps,
> i´m not quite sure how to do this.
Hey Patrick,
Feel free to create a separate settings file for separate
installations. Just point to the appropriate settings file in your
server arrangement.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
On 11/21/05, patrick k <[EMAIL PROTECTED]> wrote:
> when trying to login to the admin-interface i get the following error:
> "Unknown column 'auth_users.password' in 'field list'"
Hey Patrick,
Check this out:
http://www.djangoproject.com/weblog/2005
cts
Example:
Python code:
items = request.POST.getlist('item')
No ugly "[0]" and "[1]" are needed. :-D
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
gt; days). Is there any such functionality in there, or should I just add
> a 'comments_allowed' method in my model which would handle this?
The latter. Models are responsible for providing their own logic for
opening/closing comments.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
601 - 700 of 1037 matches
Mail list logo