So I need to display the data for a form field from the post or from
the instance if no post. This works but I am hoping there is a better
way:
{% if form.is_bound %}
{{ form.data.foo }}
{% else %}
{{ form.instance.foo }}
{% endif %}
Any suggestions?
--~--~-~--~~
I have a project where I add a message that shows up in the admin
interface:
user.message_set.create(message="Your message")
First you need to get the user using
http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser.
Hope this helps. Might be better in your case to use the custom
validat
I added a method to threadlocals.py that allows me to set the user so
I can run code in the shell that depends on get_current_user()
returning a user:
def set_current_user(user):
_thread_locals.user = user
This should work for you.
On Mar 6, 3:35 am, "Aidas Bendoraitis" <[EMAIL PROTECTED]
I have 2 domain names pointing to the same ip. I need to customize
some of the content depending on which domain is used. How do I know
in a view which one the user connected with?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the G
Has anyone used unique_together with a BooleanField? Does
unique_together only work for CharFields? Seems like the add
manipulator does not enforce the constraint and the change manipulator
raises a ProgrammingError exception:
ERROR: operator does not exist: boolean ~~* "unknown"
due to the sq
I thought this was created by Django, but on closer inspection it turns
out that you are right and it is custom SQL. Thanks for the help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
Here is the snippet of code where the exception is generated by
get_object(). This is in a module level function of a model.
sql = {
'manufacturer__iexact':post_data.get('manufacturer', None),
'model__iexact':post_data.get('model', None),
'wattage__exac
Using pre magic removal I got this error:
Exception Type: ProgrammingError
Exception Value:ERROR: unterminated quoted string at or near
"'F28T8/841 T8 4'' " at character 419 select count(a.id) from
uv2_applications as a inner join uv2_rebatableobjects as r on
a.ro_id=r.id inner jo
8 matches
Mail list logo