Re: 3-legged-OAuth Logout

2011-07-26 Thread Lior Sion
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

Re: Doubt : Redirect after registration

2011-07-26 Thread Lior Sion
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

FormMixin missing method

2011-07-09 Thread Lior Sion
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?

Re: How to choose a license for an app or a project?

2011-05-13 Thread Lior Sion
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

Django form's widget input format

2011-03-23 Thread Lior Sion
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

Re: About using Django Auth with my app, Auto saving the User

2011-03-21 Thread Lior Sion
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

Re: how to get csrf cookie in ajax app

2011-03-21 Thread Lior Sion
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

Determining Django model instance types after a query on a base class

2011-03-15 Thread Lior Sion
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=

Re: Extending admin index.html

2011-03-12 Thread Lior Sion
lated to this is very interesting. > Please post a reply to this thread. > > Regards, > Thomas > > > > > > > > > > On Sat, Mar 12, 2011 at 4:14 PM, Lior Sion <lior.s...@gmail.com> wrote: > > Hi, > > > Is there an easy way I'm missing to EXT

Extending admin index.html

2011-03-12 Thread Lior Sion
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

Re: testing foo_set existence for each object in a queryset

2011-02-19 Thread Lior Sion
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?

unique_together validation passes on model forms that exclude unique fields

2011-02-16 Thread Lior Sion
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

Re: csrf cookie security

2011-02-10 Thread Lior Sion
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,