ve(the_filename, content, save=True)
content.close()
myimagefile.close()
If I understand correctly, preview.save() writes content to a
supposedly new file, which is problematic as I already have it.
Is there a way to tell Django that I just want my 'preview' field to
point
my code works
perfectly on Django 1.0.2.
Lior
On Mar 25, 5:13 pm, tom wrote:
> thanks for the update. So it seems, that save(commit=False) does not
> work here. What I try to do is:
>
> create a track object without saving, because I need two more objects
> (Artist, Album). These
w. Is that possible?
The only solution, so far would be to create a new view (and in that
view do all what the generic view do, that is testing form fields,
etc.), and set my attribute from the request.user variable. But I
don't see how to keep the generic view usage in url.py.
Any other way
w? Is that possible?
The only solution, so far would be to create a new view (and in that
view do all what the generic view do, that is testing form fields,
etc.), and set my attribute from the request.user variable. But I
don't see how to keep the generic view usage in url.py.
Any other way
Wouldn't this be a *huge* security hole? Sure I can pass the user info
in the extra_context, but that means that someone could build a new
page (client-side) with any arbitrary value set in that hidden
variable.
I just found a question on stackoverflow (http://stackoverflow.com/
questions/639792/
I just remembered once seeing a license generator at Binpress, maybe
that can be the quick easy solution:
http://www.binpress.com/license/generator
On May 13, 8:06 pm, Boštjan Mejak wrote:
> This is getting way out of hand. I was hoping for a simple yes/no answer.
> And what I got? A bunch of ya
Hi,
Wanted to run this by you before I raise the suggestion in django-
development: the core generic class FormMixin has some methods that
allow to set a form: get_initial, get_form_kwargs and so on. However,
it's missing a method to set up the instance (which has some uses) -
should it be added?
Are you using anything not defaulted, like django-registration? In the
database - is the user created and the active flag is true?
On Jul 24, 2:16 pm, vaibhav agarwal wrote:
> Hi,
>
> I am using Django 1.3. I have started building my first site in django
> and it seems real fun . I am learning a
That depends a lot on the ui. Facebook, for example, logs out on both
sites, while Twitter doesn't. If you're worried about a security
issue, have you "log out" button say something like "Log out of XXX"
where xxx is your site name.
Another option I've seen (when relying completely on a 3rd party
It's been a while since I dealt with those things, but what about this
scenario:
The attacker detects the CSRF code using an attack resembling the
scenario here:
http://wiki.developerforce.com/index.php/Secure_Coding_Secure_Communications#Secure_Communications_and_Cookies
[to save some time, thi
Hi,
I have a model with a unique_together field set. I also have a form
for that model that excludes one field - but I still need the
uniqueness to stay.
Example:
class A(models.Model):
name = models.CharField(max_length=30)
friend = models.ForeignKey(Friend)
and the form:
class AForm
Dan,
If I understand your question correctly, you are struggling with
creating the filtering you wrote in your message on the queryset level
(without going to the db for each object), right?
Hard to say without actually seeing your code and testing, but would
this be the same?
MyModel.objects.fi
Hi,
Is there an easy way I'm missing to EXTEND the admin site's index.html
without copying the file and altering it, which kinda sounds like the
wrong solution?
Basically, I live with the current template well enough and want to
get updates with new versions of django, but I would like, for
examp
g.
> Please post a reply to this thread.
>
> Regards,
> Thomas
>
>
>
>
>
>
>
>
>
> On Sat, Mar 12, 2011 at 4:14 PM, Lior Sion wrote:
> > Hi,
>
> > Is there an easy way I'm missing to EXTEND the admin site's index.html
> > wit
I'm having the same issue described in some places around the web and
also here:
http://stackoverflow.com/questions/5225556/determining-django-model-instance-types-after-a-query-on-a-base-class
In essence, I have these definitions:
class Animal(models.Model):
name= models.CharField(max_lengt
If your file is completely static (even coming from a cache server)
then there's no way of getting the csrf, since the whole point of the
csrf is that it's dynamic (otherwise it can be copied).
You can do a one time "warmup" if the cookie is not present on your
client to "get_data" from the server
If instead of printing "not valid" you'll print the form itself with
the errors (as described here for example:
http://docs.djangoproject.com/en/dev/topics/forms/#customizing-the-form-template)
you would see what the errors are. Alternatively, read about form
validation (http://docs.djangoproject.c
Some form widgets, namely DateInput and DateTimeInput, check data
change using a pre-set format to know if the data on the field was
change.
Today many front end developers dynamically change the format for
those types of input (and other localizations) on the client side
after the form is rendere
I am very new to Django, but have been using Python since the beginning of
the year. I am having trouble opening and reading a text file, and when I
use the shell to see what is going on, it prints:
<_io.TextIOWrapper name='edt.txt' mode='r' encoding='UTF-8'>
Here is my code:
from __future__
19 matches
Mail list logo