dation of
forms based on whether a given form is valid, sometimes passing a valid form
to the next in the sequence since at times information in them cannot be
duplicated.
Django doesn't seem to be designed for much of this conditional validation,
but it certainly can be done.
Mike
--
Michae
>
> Is list comprehensions the only way to go?
Assuming that full_name is a property in your model, then
q = User.objects.filter(full_name="John Test")
should work.
Mike
--
Michael P. Soulier
"Any intelligent fool can make things bigger and more complex... It takes a
touch
On 23/07/10 Santiago Perez said:
> If you're using MySQL then this should work:
>
> models.User.objects.extra(where=["concat(first_name, ' ', last_name)=%s"],
> params=["John Test"])
>
> Not sure how portable the concat function is or what alternatives are there
> in other backends but shouldn't
MEDIA_URL and/or MEDIA_ROOT ?
Your media config needs to correspond to apache config.
For example:
SetHandler default
Alias /media/admin /usr/lib/python2.6/django/contrib/admin/media
Alias /media /path/to/my/project/media
Mike
--
Michael P. Soulier
"Any intelligent fool can make things bi
On 23/07/10 john said:
> Hi all,
>
> I am following the django book. I am to the point of setting up my
> datebase. It instructs me to enter the command:
>
> python manage.py sqlall.
I thought that sqlall required an app name.
Make sure you've added apps with models, and that you've added th
On 30/07/10 tiemonster said:
> I cover some of the new changes in Django 1.2 in this article:
> http://www.tiemonster.info/a/24005/
>
> Most of this information comes straight from the changelist. Others
> were things that the core developers must have assumed were common
> sense, but that I didn
and would in all likelihood be a trigger
> for a new point release.
That is awesome, thanks. I can safely push the upgrade and I'll report any
issues found.
Mike
--
Michael P. Soulier
"Any intelligent fool can make things bigger and more complex... It takes a
touch of genius - and a
quot;/var/tmp/Django-1.1.1-root/usr/lib/python2.4/site-packages/django/templa
te/loader_tags.py", line 66, in get_parent
TemplateSyntaxError: Template u'base.html' cannot be extended, because it doesn'
t exist
So, should this work? Is it a fluke that it works in one project and not the
other
e object 'MeetingTalkInline' has no attribute 'date_hierarchy'
Am I doing something wrong here?
Thanks,
Mike
--
Michael P. Soulier
"Any intelligent fool can make things bigger and more complex... It takes a
touch of genius - and a lot of courage to move in the opposite direction."
--Albert Einstein
signature.asc
Description: Digital signature
at I can't login to the admin site due to a CSRF error.
I have not enabled CSRF yet, and I have not added custom admin templates.
I'm assuming that this is not expected.
Mike
--
Michael P. Soulier
"Any intelligent fool can make things bigger and more complex... It takes a
touch
On 08/08/10 Michael P. Soulier said:
> I've picked-up Django 1.2 locally in a virtualenv for testing, and I'm
> finding suddenly that I can't login to the admin site due to a CSRF error.
Ah, found it. Somehow some firefox add-on disabled my accepting of cookies.
The error
back to admin.site.root and it
works fine.
Mike
--
Michael P. Soulier
"Any intelligent fool can make things bigger and more complex... It takes a
touch of genius - and a lot of courage to move in the opposite direction."
--Albert Einstein
signature.asc
Description: Digital signature
On 10/08/10 Karen Tracey said:
> does not work properly. You also have to change the first element of the
> tuple:
>
> (r'^admin/', include(admin.site.urls)),
*sigh* Thanks, that was it.
Mike
--
Michael P. Soulier
"Any intelligent fool can make things bigger and
{%- if foo %} newline suppression
Likely someone has asked for this already so I'm curious about it.
Thanks,
Mike
--
Michael P. Soulier
"Any intelligent fool can make things bigger and more complex... It takes a
touch of genius - and a lot of courage to move in the opposite direction
; a newline.
>
> http://code.djangoproject.com/ticket/2594
Yeah, I'd be on board with that.
Cheers,
Mike
--
Michael P. Soulier
"Any intelligent fool can make things bigger and more complex... It takes a
touch of genius - and a lot of courage to move in the opposite direction."
--Albert Ei
query with mysql on different server(same django version) and it
> worked great.
Since you're talking about the sqlite backend, did you try this on the
sqlite command-line?
Mike
--
Michael P. Soulier <[EMAIL PROTECTED]>
"Any intelligent fool can make things bigger and more comple
MickaelC wrote:
> It is not really a problem
> It's for a multi user app. For each new users, i create a serie table
> or all data in the same table?
> If it's easy to create table on-the-fly when a new user registers, i
> prefere.
>
> but I do not see how
If you must, that is what raw SQL is for
s always desirable. Sometimes you just need more flexibility.
I suppose that piece of code could be a simple Python CGI, but having to
break out of the framework indicates a deficiency there.
I wonder if I could pull this off with a custom HttpResponse subclass.
Mike
--
Michael P. Soulier
do this beyond wrapping django-admin.py in a
shell script and post-processing the created files?
Thanks,
Mike
--
Michael P. Soulier <[EMAIL PROTECTED]>
"Any intelligent fool can make things bigger and more complex... It
takes a touch of genius - and a lot of courage to move in t
On 12/02/12 coded kid said:
> Below is the codes in my comments/form.html
> {% load comments i18n %}
> {% csrf_token
> %}
> {% if next %} value="{{ next }}" />{% endif %}
> {% for field in form %}
> {% if field.is_hidden %}
> {{ field }}
> {% else %}
> {% if field.errors %}
On 29/07/12 07:48 AM, Александър Ботев wrote:
> Hi,
> So I followed all the instructions from the django web source about how to
> configure it, but all it seems
> it gives me a problem - I always get an error 500.
> My main concern and I think problem is that when I run my fcgi script it
> give
Looking at the docs...
https://docs.djangoproject.com/en/1.4/topics/http/file-uploads/
under "Modifying upload handlers on the fly"
it states:
"Sometimes particular views require different upload behavior. In these cases,
you can override upload handlers on a per-request basis by modifying
requ
On 01/11/12 Tom Evans said:
> Please show the definition of MyForm. I assume you are certain that
> the form is valid, ie you have put breakpoints there (or print
> statements) and form.is_valid() is definitely returning true.
I used MyForm as an example, the actual class is
class McdLoad(models
On 02/11/12 Tom Evans said:
> Hmm, looks ok.. do you end up with two entries in the DB, one with the
> old primary key, and one with the new primary key?
No, and I expected to.
> Personally, I don't use natural primary keys with Django, I always let
> it create an 'id' primary key, and then add
On 10/11/11 Asif Jamadar said:
> Suppose I have choicefield in my django model which consist of several
> choices. Now in future if I changed the existing choice (option) with some
> other name (choice), then whether the existing records in model with that
> choice(option) will also change? Or In
On 04/03/13 Emiliano Dalla Verde Marcozzi said:
> method from my own class that subclass TemporaryFileUploadHandler and do
> something like:
Yeah, I'm doing that, but it seems odd to me that the handler leaves the file
around, when it's supposed to be temporary, no?
Mike
--
You received this m
Hi,
I have a Django UI with a daemon running in the background, both using the
Django models to update the postgres database. When the daemon in the
background gets very busy, I'm getting errors in the UI while trying to load
the page (simply reading the postgres db).
DatabaseError at /clients/mi
it be
possible in the future to pass the request object to the database router?
Thanks,
Mike
--
Michael P. Soulier
"Any intelligent fool can make things bigger and more complex... It takes a
touch of genius - and a lot of courage to move in the opposite direction."
--Alber
;t work for me :)]
The issue is a need to run a single UI over multiple virtual instance of an
application, each with its own database. So, based on which virtual instance
of the app is being managed, I want to route to a particular database
corresponding to that application.
Mike
--
Michael P
Hi,
We're enabling ipv6 on a server and finding that redirects in django are
broken. The host portion is being truncated.
Is this a known problem?
Thanks,
Mike
--
Michael P. Soulier
"Any intelligent fool can make things bigger and more complex... It takes a
touch of genius - an
On 28/12/10 Emmanuel Mayssat said:
> I have a classic database dump question
>
> I would like to migrate from sqlite to mysql.
> How can I dump and import the data?
See the manage.py dumpdata/loaddata commands.
Mike
signature.asc
Description: Digital signature
On 29/12/10 Torsten Bronger said:
> I don't recommend that. If the database exceeds a certain size (and
> "certain" is MBs, not GBs), this simply fails.
Is there a bug report for this issue? I find that very disappointing.
Mike
--
Michael P. Soulier
"Any intell
On 29/12/10 Emmanuel Mayssat said:
> I was looking at a possibility of using manage.py dumpscript and
> manage.py runscript
> from django-extensions. But it is not straight forward either.
dumpdata/loaddata is quite simple, I recently used it myself. Torsten
suggested that there's a problem using
On 29/12/10 Bill said:
> Hi there,
>
> I want to know is there any authentication module base on Linux passwd/
> shadow file for django?
You want pam authentication. Look for django and pam.
Mike
signature.asc
Description: Digital signature
On 13/12/10 Michael P. Soulier said:
> Hi,
>
> We're enabling ipv6 on a server and finding that redirects in django are
> broken. The host portion is being truncated.
>
> Is this a known problem?
So I found the issue. Apache is passing a bad value for the
X_HTTP_FORWAR
On 04/09/14 Tom Evans said:
> Is the update invariant? By using the ORM like this:
As I said, each update is unique and they cannot be batched.
> Are both Django and the sqlalchemy doing the same sort of update?
Yes. Identical.
Mike
--
You received this message because you are subscribed to
On 03/09/14 Tom Lockhart said:
> I haven't had to deal with this myself, but the speed difference smacks of
> transactional issues. If you can run your loop by wrapping all of it or
> pieces of it (say, 100 or 1000 chunks) in a single transaction you'll
> probably see some significant speedup.
Ye
On 04/09/14 Benjamin Scherrey said:
> The short answer to your question is no, the Django ORM is not inherently
> slower in that regard and it's very likely something you're doing. The
Given that it's basically
for obj in foo.objects.all():
obj.prop = new_value
obj.save()
I fail to see
38 matches
Mail list logo