Hi all guys.
I tried to look for around a way to set a datetime field with the
CURRENT_TIMESTAMP value. I found nothing useful. Did I miss anything?
Imagine some processes running on parallel servers: what when one
process has to set a datetime field to "now" where "now" MUST BE set
using the db
sorry , the correct code is below . I change the login.py into
forms.py
> --
> settings.py
>
> # Django settings for Test project.
>
> DEBUG = True
> TEMPLATE_DEBUG = DEBUG
>
> ADMINS = (
> # ('Your Name', 'your_em...@domain.com'),
> )
>
> MANAGERS = ADMINS
>
>
Now,I have designed a Demo . It contains username ,password, and
language . But ,when I submit , it can't work . what's wrong ?
--
settings.py
# Django settings for Test project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_em...@doma
Hallöchen!
Torsten Bronger writes:
> I'd like to ensure that people only upload PDF files, so the file
> must start with "%PDF". If the file starts with something else,
> the form must not validate.
>
> How do I do that? I though about a clean_... method which reads
> the start of the file and
On Mon, 2009-03-30 at 12:50 +1100, Joshua Partogi wrote:
> Hi all,
>
> I tried saving the password data with this function
>
> import hashlib
> hashlib.md5( new_member.password ).hexdigest()
>
> but when I log in again with that password it doesnt work.
A number of problems here. Firstly, Djan
I've never really understood why the context processor list wasn't
part of the default settings.py. But I've always just copied and
pasted the complete list into settings.
On Sun, Mar 29, 2009 at 7:40 PM, IanR wrote:
>
> So I see that I can easily create a context_processor to do this stuff
>
On Sun, Mar 29, 2009 at 9:50 PM, Joshua Partogi wrote:
>
> I thought we're to use hexdigest ?
>
> Did I miss something here?
You need to salt it:
http://code.djangoproject.com/browser/django/trunk/django/contrib/auth/models.py#L20
-- dz
--~--~-~--~~~---~--~~
Yo
Hi all,
I tried saving the password data with this function
import hashlib
hashlib.md5( new_member.password ).hexdigest()
but when I log in again with that password it doesnt work.
I thought we're to use hexdigest ?
Did I miss something here?
Thank you very much in advance
--
If you can't
class ContactAdmin(Admin):
form = EditContactForm
EditContactForm has a save method that is never called by the Admin
but its clean() function does get called
60 def clean(self):
61 import pdb; pdb.set_trace()
my confusion is that due to the snakey admin code the fo
Hi,
I have the model described at
http://docs.djangoproject.com/en/dev/topics/db/models/#intermediary-manytomany
on which I have multiple rows in Membership with the same Person and
Group (say they're a bit flaky, and leave and rejoin a few times ;) ). I
wanted to print out a paginated list o
On Sun, 2009-03-29 at 18:01 -0400, Vitaly Babiy wrote:
> Maybe I should have said why I ask.
>
> I have a formset that the formset can not submit more than certain
> number of forms. I was not sure if max_num handles this or do I need
> to do this with some custom validation?
What happened when
Sorry, but I really am relatively new to Django, and although I've
been poking around for quite a while, I still just can't get that
package to work.
When I tried to install it inside of the contrib folder, and then add
it to the 'installed applications' in the settings.py file, i kept on
getting
So I see that I can easily create a context_processor to do this stuff
for me.
It says that these are the default context_processors. I can not find
them in the settings.py, where is this located? (I grepped my whole
project so it must be somewhere else)
TEMPLATE_CONTEXT_PROCESSORS
("django.co
On Mon, Mar 30, 2009 at 1:42 AM, Rob Hudson wrote:
>
> Wow, that was a tricky one to track down...
...
> I take it that gets interpreted as a single value tuple. D'oh! That
It does, operator precedence notwithstanding (for example, a lambda
expression returning a tuple that is being used as an
On Sun, Mar 29, 2009 at 7:14 PM, IanR wrote:
> I'm trying to stay a close to the suggested Django conventions as
> possible. I have a few variables that I need to render any page.
Check out context processors:
http://docs.djangoproject.com/en/dev/ref/templates/api/#writing-your-own-context-pro
I'm currently converting my website from PHP to Django. I've always
loved python and all my backend code is in python. I figured that it
might as well make the jump. So far so good, as everything has been
very strait forward and a joy. It's definitely making web development
fun again.
I'm try
For others running into this problem, pulling from the django trunk
and running with the most recent version fixed this problem for me.
Thanks!
-a.
On Mar 19, 8:31 pm, coffeepunk wrote:
> > This has been reported as ticket #10556 earlier today. It will be fixed
> > in the next few hours, I susp
Maybe I should have said why I ask.
I have a formset that the formset can not submit more than certain number of
forms. I was not sure if max_num handles this or do I need to do this with
some custom validation?
Vitaly Babiy
On Sun, Mar 29, 2009 at 5:57 PM, Vitaly Babiy wrote:
> If the count
Jack Orenstein wrote:
> On Mar 29, 2009, at 9:35 AM, Matthew Somerville wrote:
>> For more information, see
>> http://docs.djangoproject.com/en/dev/ref/forms/validation/
>
> Thanks, that's really useful to know about. This works for most of
> the additional validation I need to do, but doesn't
If the count of forms submit goes over the max_num shouldn't it raise and
validation error?
Thanks,
Vitaly Babiy
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email
On Mar 23, 9:39 am, Malcolm Tredinnick
wrote:
> On Mon, 2009-03-23 at 00:18 -0700, Yaniv Haber wrote:
> > On Mar 23, 1:41 am, Malcolm Tredinnick
> > wrote:
> > > On Sun, 2009-03-22 at 05:39 -0700, nivhab wrote:
> > > > Hi,
>
> > > > I have the following model:
>
> > > > class product(models
Wow, that was a tricky one to track down...
After putting debug output in django/template/loaders/filesystem.py I
saw that filepath was set to:
'/Users/rob/git/anglers/anglers/templates/('book/
search_form.html',)'
I back tracked that and found that I had a trailing comma in my view
code:
On Sun, Mar 29, 2009 at 8:28 AM, Karen Tracey wrote:
> That generally means the permissions don't allow the code to access the
> file. You don't mention if this happens with the dev server (which would
> surprise me, since you can load the template from the shell) or only with a
> real web serve
On Sun, Mar 29, 2009 at 9:49 PM, Kariem wrote:
>
> I tried using the serialization as documented in
> http://docs.djangoproject.com/en/dev/topics/serialization/ and do
> something along the lines of
>
> json = serializers.get_serializer('json')()
> json.serialize(o, ensure_ascii=Fal
On Sun, Mar 29, 2009 at 11:18 AM, Rob Hudson wrote:
>
> This is a stumper...
>
> I have a very simple view that is a wrapper around the generic view
> direct_to_template. The loader finds the template as indicated in the
> output "(File exists)", but yet I still get a TemplateDoesNotExist
> erro
This is a stumper...
I have a very simple view that is a wrapper around the generic view
direct_to_template. The loader finds the template as indicated in the
output "(File exists)", but yet I still get a TemplateDoesNotExist
error. Any ideas?
I can go to the Django shell and load it just fine
On Mar 29, 2009, at 9:35 AM, Matthew Somerville wrote:
>
> Jack Orenstein wrote:
>> On Mar 28, 2009, at 12:26 PM, Daniel Roseman wrote:
>>
>>> On Mar 28, 4:14 pm, Jack Orenstein wrote:
My application needs to validate data from a from beyond the
validation of Fields done by django. So
You're passing your template variable `classcolors` to the template
filter `random`. Looking at the code for random.py:
File "/usr/lib/python2.5/random.py", line 248, in choice
return seq[int(self.random() * len(seq))] # raises IndexError if
seq is empty
IndexError: string index out of range
You're POSTing the form instance, rather than the postedData.
So:
response = self.client.post('/myApp/post', form)
should be:
response = self.client.post('/myApp/post/', postedData)
More info here:
http://docs.djangoproject.com/en/dev/topics/testing/#making-requests
On Mar 28, 9:14 pm, tsme
I tried using the serialization as documented in
http://docs.djangoproject.com/en/dev/topics/serialization/ and do
something along the lines of
json = serializers.get_serializer('json')()
json.serialize(o, ensure_ascii=False, fields=fields)
"o" is a list of models that contain a
Jack Orenstein wrote:
> On Mar 28, 2009, at 12:26 PM, Daniel Roseman wrote:
>
>> On Mar 28, 4:14 pm, Jack Orenstein wrote:
>>> My application needs to validate data from a from beyond the
>>> validation of Fields done by django. So in my form handler, I check
>>> Form.is_valid, and if that retur
Joshua Partogi wrote:
> Yes you're right. In my template I only have username, first_name,
> last_name, email and password. I also print out the errors too.
Nowhere are you printing out non-field specific errors - please read
about non_field_errors at
http://docs.djangoproject.com/en/dev/ref/fo
Hallöchen!
P M writes:
> yes you can, because signature of pdf is in the starting of 1st
> chunk of stream... rest of the things are of hardly interest for
> libmagic identification...
Again, this is not the point. The point is whether I can safely
read the first bytes and put them back into t
sorry about re-beginning this thread but googlegroups decided to
"close" responses. i accidentally replied privately to adam as a
result, and will endeavour to reproduce what i wrote.
as mentioned previously here on django-users, here is the beginnings
of achieving exactly what adam is referring
Karen you're always a big help for me on django. Thank you so much!
I was imaging the same thing you explained about problems with the
objects pointing to the key i want to change.
So I was thinking to create a new counter primary key for that model
and turn the current primary key into a simple u
On 27 Feb, 01:56, Jamie Richard Wilson wrote:
> I've extended the User model with a UserPofile model and have inline
> editing working. Setup is something like this:
>
> class UserProfile(models.Model):
> user = models.ForeignKey(
> User,
> unique=True,
> )
> posit
36 matches
Mail list logo