Please do not re-post your question - you already submitted this 7
hours before you posted this one, so you should just wait for replies
to that :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
You can use tabs, but you have to /always/ use tabs if you do so - you
can't mix tabs and spaces, or you hit issues like this :)
Especially if your editor is showing tabs as four spaces, since python
would use eight.
--~--~-~--~~~---~--~~
You received this message
Yes, an empty form field would be an empty string, not None, by
design.
Adding a null would be odd, but possible with custom clean behavior on
a form :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
You forgot to use person in front of the values of course, since
they're still attributes of that dict :)
So instead of pnr which is just printing static text "pnr",
you need to do {{ person.pnr }} just like every other
variable access :)
--~--~-~--~~~---~--~~
You
You must use RequestContext in every view for context processors to be
active - they won't somehow add the data to the base template
automatically without RequestContext being used :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
Don't suppose you called your project or app 'twitter' also? Or any
other file on pythonpath?
--~--~-~--~~~---~--~~
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@goo
On Jan 17, 6:28 am, "Lic. José M. Rodriguez Bacallao"
<[EMAIL PROTECTED]> wrote:
> Hi folks, I need to know how can I search, explore for codes
> inhttp://dpaste.com/
> I really can't figure out how.
You can't - it is not a database of snippets like djangosnippets.org,
but instead a pastebin - p
On Jan 17, 4:01 pm, LRP <[EMAIL PROTECTED]> wrote:
> Hmmm, I'm wondering... I'd have little to contribute beyond my
> personal blunders, but I'd be delighted to work with any folks who'd
> like to prepare a Debian-specific addendum to the on-line Django
> tutorial.
Personally, I don't think the t
On Jan 16, 3:49 am, Serxio <[EMAIL PROTECTED]> wrote:
> Overriding the admin/change_form.html template, and wiping out the
> line {% submit_row %} may do the trick.
If that only hides the HTML, it won't be safe at all.
--~--~-~--~~~---~--~~
You received this messag
On Jan 16, 11:22 am, code_berzerker <[EMAIL PROTECTED]> wrote:
> I put my templates somewhere in /var/www/ just beside project code and
> media files.
If /var/www is a web root, your project code should *not* be there.
Don't ever put django code in a web-readable directory if you can help
it :)
-
Make sure you did not name an app or project 'csv' as that will
conflict with the default csv module.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-u
He did add it - 'test2.test'
Did you restart the webserver handling this? Even the dev server needs
to be restarted for some things, and template tags are often one of
them :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
It doesn't have to be a callable, you just need to use the FORM's
initial arg, as Malcolm was initially referring to, not the field's
initial argument.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" gr
Of course it's listing the same clients, you looked up the full list,
instead of, say, using the relations to category to get only those
clients which belong to that category :)
If a client has an fkey to category, then you need to be doing
something like {% for client in category.client_set.all
On Jan 6, 1:36 pm, Darthmahon <[EMAIL PROTECTED]> wrote:
> When I used request.user, it outputs the username of the currently
> logged in user. When I try and use this as part of the entry into the
> table, it won't let me as it's expecting an integer.
You are mistaken. When /printing/ the user o
As zodman is getting at, django does not map your media for you - you
have to do that.
http://www.djangoproject.com/documentation/modpython/#serving-media-files
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django
It depends a lot on the use case.
Does the function operate on a single model? Will it be run when you
already have the instance of the model?
If so, it may be a good case for a model function, since it will
already have access to the object it's a part of. General purpose
helpers can go in view
Er, no, I don't own any IRC channel on freenode :)
#django still isn't registered, we need one of the devs to do that
before anyone can get op status and actually do anything
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google G
You've misunderstood - you need blank=True /and/ null=True.
blank=True will tell admin to let you pick nothing for it, and
null=True will then allow the NULL value to be entered.
NULL is what you use to signify "unset" on a ForeignKey
--~--~-~--~~~---~--~~
You r
What exactly is your use case here? This should all be handled
automatically when you do {{ form.fieldname }}, depending on if it's
bound or not :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" grou
You're going about it the wrong way - you should be combining all the
Q objects into one, then just filter with that - it'll do all the
queries at once, and give you one queryset back :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
There is no such thing as blank, especially on a ForeignKey.
blank=True has absolutely nothing to do with the database, as the
documentation for it clearly states :)
It merely makes it so you can give it no value in form validation,
like in admin.
--~--~-~--~~~---~-
Do you actually have any Abbreviation objects?
If you don't tell the view to allow empty results, it'll 404 if it has
nothing to show :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
You can't use a form button - just use a link
--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group,
1) The newforms documentation shows you how to pass request.POST into
the form (see the view example):
http://www.djangoproject.com/documentation/newforms/
2) You don't need to put the user in your form in order to do initial
data. Just pass the form an initial dict when you make an instance of
While I believe you were the one asking this in IRC, I will answer
here for anyone else stumbling across this :)
ManyToManyField entries are just two IDs - one for each object.
As such, it's impossible to add an m2m link until the object is saved
- this means that admin's code can't possibly set
Another option is to use template tags. Different apps can provide
template tags that can be embedded in other pages.
Specifically, inclusion tags basically render a stub template with
their own context, so something like a polls app, for example, could
render a poll form wherever you do {% show_
For the record, you cannot subclass django models yet :)
--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from t
If it's complaining about mxDateTime, you need to install that
separately - I do not think it is included in most python
distributions.
This isn't anything against python itself though - every piece of
software has pre-requisites, and you have to install them to use the
software :)
--~--~--
You can also just fix the imports to reference things properly,
including the site name :)
--~--~-~--~~~---~--~~
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@goog
I don't believe that is possible.
--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send email t
You don't need a custom 404 handler in order to use RequestContext -
the default handler already does.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to djang
You need to write a validator and use validator_list in the field
attributes to do custom validation in admin.
http://www.djangoproject.com/documentation/model-api/#validator-list
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the G
You are likely going to have to write that sort of app yourself.
--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscrib
The same question applies though :)
You didn't import the "forms" bit, you imported the field directly, so
you should just be using it as UKPostcodeField :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django u
That probably isn't what you want, though it will work (technically
speaking)
The way you're doing it, that's going to chain the filters with AND,
not OR, so only things that match the title and description for all
words will show up.
You probably want to build a Q object with | for an OR lookup
You're importing UKPostcodeField - so why are you trying to use
models.UKPostcodeField ? :)
--~--~-~--~~~---~--~~
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@goo
Make template tags for your various apps, and use them on the index
page :)
--~--~-~--~~~---~--~~
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@googlegroups.com
To
question.choice.all is wrong :)
The default reverse relation name is FOO_set where FOO is the lower-
case name of your model.
So in your case, it would be question.choice_set.all
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the G
The change is just that this:
form = MyForm(request.POST)
changes to this:
form = MyForm(request.POST, request.FILES)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, s
On Aug 14, 8:39 am, "Rob Hudson" <[EMAIL PROTECTED]> wrote:
> Is it odd that I don't see an error? Just the admin page without the
> models I'm looking for?
Nope.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"D
You've pretty much summed up your only choices that I can see :)
If you like 4 the best, go with that :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to dj
Author.objects.filter(book__publisher__id=1).distinct() doesn't work?
--~--~-~--~~~---~--~~
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@googlegroups.com
To unsub
Regroup generates a list of dicts with two keys - grouper (the value
of the field you're grouping by) and list (the list of objects that
match that)
So in this case, you get entries like {'grouper': ,
'list': [, , ...]} :)
--~--~-~--~~~---~--~~
You received this
Your problem is completely unrelated to INSTALLED_APPS, if your django/
contrib/admin/templates dir is missing.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email
view:
poems =
Poem.objects.filter(approved=True).select_related().order_by('auth_user.username')
template:
{% regroup poems by user as grouped %}
{% for group in grouped %}
{{ group.grouper }}
{% for poem in group.list %}
{{ poem.title }}
{% endfor %}
{% endfor %}
Perhaps something like that?
Copying the code out will not work. Nothing in django will be looking
in your new location, so your changes will be ignored.
If you absolutely must change the User model itself, you are stuck
with editing the django source directly.
--~--~-~--~~~---~--~~
You rece
Do you have "django.contrib.admin" in INSTALLED_APPS?
Are the templates actually present in django/contrib/admin/
templates/ ?
Are the permissions on that directory and every directory above it
such that the webserver can read them?
--~--~-~--~~~---~--~~
You rec
> >>> users = User.objects.filter(groups__contains="Staff") ?
This line doesn't work because "groups" is a ManyToManyField, not a
CharField, so __contains="Staff" doesn't make any sense.
Something like users = User.objects.filter(groups__name="Staff")
should work a little better :)
--~--~-
As the documentation for object_list says, it will append _list to
template_object_name, so you should actually be checking
"products_list" based on your line there :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
http://www.djangoproject.com/documentation/syndication_feeds/#a-complex-example
The example here is pretty much what you want, you just need to change
how you lookup the objects for the feed.
--~--~-~--~~~---~--~~
You received this message because you are subscri
You cannot. Django does not do aggregates like GROUP BY yet. You will
have to use manual sql to get those values.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send ema
Model subclassing does not work.
--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send email to
You can't access the old value once you've sent in a new one, unless
you query the database again for the old record before you save the
new.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
There is no model-level validation. The "blank" option in fields
applies /only/ to the forms handlers, like the forms in Admin.
It will not stop you from saving an object manually with nothing in it.
--~--~-~--~~~---~--~~
You received this message because you are
When a cookie expires, the browser gets rid of it. Your site will
never see it, and the user will be no longer logged in, since they
will have no link to the session :)
As such, it's impossible to tell if a user with no cookie has never
had one or simply had one but it expired.
--~--~-~
Do you need validation that ties between fields in both models?
If not, just pass each form into the template individually.
A newforms form will only pay attention to POST keys that match its
own fields, so the others will just be ignored, and everything just
works :)
--~--~-~--~~-
http://code.djangoproject.com/ticket/4604
--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send
One method is to include a hidden input somewhere that indicates the
number of forms present. Then you can just use a for loop from 1 to
that number in the view to build the right number of forms again.
--~--~-~--~~~---~--~~
You received this message because you a
To fkey to User, you should be importing it, not typing out a full
path like that (unless you're doing "import django" but that's a bit
unwieldy)
You cannot set the fkey to the current user in save(), as request is
not available.
You also can't do it in admin because of that. It's very easy in a
Yes, you can do something like form.fields['fieldname'].widget =
forms.TextInput() or whatever
--~--~-~--~~~---~--~~
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@
About the only way to do that is just grab (.*) from the url, and
parse it in your view, looking up slugs as needed
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send e
Yes, just edit the fields in form.fields :)
--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, se
cron is definitely the proper way to do this (or the scheduled tasks
if you're stuck on windows)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-user
Makes the most sense to me :)
--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send email to [E
No, this will not work well at all.
Django's dev server is single-threaded, and as such, nobody else could
use it while it's serving a request - if even 2 people were browsing
around at any speed, you'd start running into delays.
Apache is easy. Use it :)
--~--~-~--~~~-
What do you mean by "get the history" ?
--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send e
Reverse the field order in the form, otherwise not that I'm aware of.
--~--~-~--~~~---~--~~
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@googlegroups.com
To unsub
The clean_foo functions are run in order.
So in your situation, clean_annotationtype will only have access to
the annotationtype value, but clean_annotationvalue will be able to
see both, since clean_annotationtype has already been run.
--~--~-~--~~~---~--~~
You
{% if item|in_cart:request %}
--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send email to [E
Yes, a tag file is a tag library, it does not represent a single tag :)
--~--~-~--~~~---~--~~
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@googlegroups.com
To uns
Add an __init__ function to your form that you can pass request to.
def __init__(self, request=None, *args, **kwargs):
self.request = request
super(MyForm, self).__init__(*args, **kwargs)
Something like that should work to add request to the form, and you
can then use it in t
Why did you add _id to your model definition for levelID ? The column
does not have that.
--~--~-~--~~~---~--~~
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@googl
You cannot do that from save() - you need to add a validator for the
admin forms to use, using the validator_list attribute for a field.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
Is price a ForeignKey? If so, the issue is you're trying to lookup an
object by a number.
You'll need something like y.filter(price__price=149) or such
(whatever the field in price is that stores the value)
--~--~-~--~~~---~--~~
You received this message because
Yes, the generics use RequestContext because it will call all enabled
context processors.
Normal Context does not do so.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
No, it's impossible to use values from the URL or request right there
in the url dispatcher. You would need a small wrapper view.
See
http://www.b-list.org/weblog/2006/11/16/django-tips-get-most-out-generic-views
:)
--~--~-~--~~~---~--~~
You received this messag
Because you have an infinite loop there.
Why are you linking both directions? There's a reverse relation
available to get from EmployeeAssignment and EmployeeContract back to
the Employee model, you don't need to explicitly define it.
--~--~-~--~~~---~--~~
You re
Your filter would work fine, you just need to stop trying to add
quotes and {{}} to it ;)
{{ obj1|get_attr_by_name:obj2.foo }}
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this g
Why are you doing request['price'] ?
Do you perhaps mean request.POST['price'] or request.GET['price'] ? :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
Only if you edit the django source :)
--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send ema
This is not a backend issue at all - the problem is you're assigning a
string to the DateField, which is not what it needs.
DateField/TimeField/DateTimeField need the python objects for them,
not strings.
They convert it to a string internally before save, so that the
database gets the right val
There is no solution, really - the links can't be added until the
model is saved, so they will not be available in save()
The only way you could work with m2m data is in a custom view, since
then you can connect them and do whatever.
--~--~-~--~~~---~--~~
You rec
Nope. You have to change that manually.
--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send e
What version of django are you using? I seem to remember the single
line comments being added after 0.96, though I could be mistaken.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to
I feel silly for not trying this earlier, but it appears to work :)
>>> B.objects.filter(a__isnull=False)
[, ]
Models used for this test: http://dpaste.com/15931/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"D
Neither of those is correct.
He wants every B that has an A fkeyed to it.
In other words, every instance of B where b.a_set.count() > 0
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
apps are portable if you don't make them in a project directory - as
for copying them to another server, nothing stops you from making a
"3rd_party" or some such folder in there that you add to pythonpath,
so that they don't have to be referenced by project.app
Or maybe make an "apps" directory t
If you're using 0.96, you must follow the 0.96 tutorial instead, at
http://djangoproject.com/documentation/0.96/tutorial04/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group
Don't set a FileField or ImageField as core=True, it won't work as
expected.
Maybe make the alt text core=True instead, or require a name for the
model?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users
> Hi all.Django auto loaded onto my computer from( I believe) a Harry
> Potter web site.I want to remove it,as it is messing up one of the web
> sites that I frequent.The site shows a 404 error.
That's impossible.
--~--~-~--~~~---~--~~
You received this message b
> Oh, it's not creating the ID, my question was whether I can safely
> assume that I will always get an IntegrityError (and nothing else) and
> whether just inserting stuff and catching errors is the recommended
> Pythonic way.
IntegrityError is what you will get on a unique conflict, yes.
Howev
They all use RequestContext already.
--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send emai
You'll need two files.
--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PR
If there's a problem, it will raise an exception, so you won't just
slide past invisibly.
--~--~-~--~~~---~--~~
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@googl
The key here is that django does not automatically map your media -
you have to do it manually.
--~--~-~--~~~---~--~~
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
Check your DATABASE_HOST setting in settings.py - if you have it set
to a path you can't write to, that would explain the error.
Also, you should be using "manage.py syncdb" not "django-admin.py
syncdb"
--~--~-~--~~~---~--~~
You received this message because you
If you don't use "manage.py shell" you must set your environment
properly - set the DJANGO_SETTINGS_MODULE and PYTHONPATH properly,
similar to how the modpython docs show you to set them for that to
work.
--~--~-~--~~~---~--~~
You received this message because you
'svn info'
--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For
I like this method: http://code.google.com/p/i18ndynamic/
--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from
1 - 100 of 122 matches
Mail list logo