Re: Django (cache?) make some mistake with formset generated class

2013-11-07 Thread Bastien Sevajol
You're right! I mistake with python object logic :/ Sorry ! Thank's ! Le jeudi 7 novembre 2013 14:45:45 UTC+1, Simone Federici a écrit : > > > On Thu, Nov 7, 2013 at 11:54 AM, Bastien Sevajol > > > wrote: > >> formsets = {} > > > this class vari

Django (cache?) make some mistake with formset generated class

2013-11-07 Thread Bastien Sevajol
Hello, i don't know if it's a django or python problem. But i correct a strange bug and would know why my code was bugging and if it was django, python, or me. The situation (and solution) is exposed here

Re: html templates and dynamic loading

2013-08-26 Thread Bastien Amiel
Le 24/08/2013 04:44, Mantas Zilinskis a écrit : this might help you http://stackoverflow.com/questions/1879872/django-update-div-with-ajax let me know if you need more help Thank you for this good pointer. On Fri, Aug 23, 2013 at 10:51 AM, Bastien Amiel <mailto:b.am...@evs.com>&

Re: html templates and dynamic loading

2013-08-23 Thread Bastien Amiel
Le 23/08/2013 17:01, Mantas Zilinskis a écrit : can you post all of chat.html On Fri, Aug 23, 2013 at 7:04 AM, Bastien Amiel <mailto:b.am...@evs.com>> wrote: Le 23/08/2013 11:26, Huu Da Tran a écrit : On Thursday, August 22, 2013 8:42:04 AM UTC-4, Bastien Amiel wrote:

Re: html templates and dynamic loading

2013-08-23 Thread Bastien Amiel
Le 23/08/2013 11:26, Huu Da Tran a écrit : On Thursday, August 22, 2013 8:42:04 AM UTC-4, Bastien Amiel wrote: I need to update the chat when an event come but : 1. If I update my chat sub page, inputs are reset (seems logic since html is recreated). You can always have

html templates and dynamic loading

2013-08-22 Thread Bastien Amiel
Hi list, I'm testing Django for a few days now and I have 2 questions. I created for my tests a simple chat integrated in a base page (one template for the main page, and one for the chat). I need to update the chat when an event come but : 1. If I update my chat sub page, inputs are reset (

Re: Is it secure to have IDs show up in URLs?

2012-03-23 Thread Bastien
2 PM UTC+1, Bastian Ballmann wrote: > > Hi Bastien, > > it's the task of the backend to manage the authorization including > users and permissions. > > If the view and permission system allows all users to see everything > and you dont want it that way than you have to

Is it secure to have IDs show up in URLs?

2012-03-23 Thread Bastien
I am concerned about seeing the IDs of objects appearing in the URL and in a totally predictable manner. It is very convenient and clean to do all sorts of things but can be abused very easily to retrieve all the content of the site, ie: photos... Is it a good idea to try to change this behavio

Re: apache + mod_python + svn

2009-07-14 Thread Bastien
ok my bad, I didn't realize that the structure of the project had changed within the directory now that it is controlled by subversion and of course at the root of the directory there is no settings file, instead I have to go to the ultimate revision. Thanks, Bastien On Jul 14, 11:

apache + mod_python + svn

2009-07-14 Thread Bastien
st thing the path of the project has changed but I updated it in the apache2/sites-available/default and restarted apache. Thank you, Bastien --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: How to custom render a checkbox list?

2009-07-08 Thread Bastien
Thank you Jashugan, that's the way I went too but I thought there was a cleaner method, right now it's working properly so I'll leave it alone but I'll have a look later to see if I can improve that. Bastien On Jul 8, 6:09 pm, Jashugan wrote: > On Jul 8, 5:26 am, Bastie

How to custom render a checkbox list?

2009-07-08 Thread Bastien
plate: {{ form.months_open }} it is rendered as: ... Do you think there is a way I can use something like {{ form.months_open.month1 }} ? thank you, Bastien --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users&

request.path or request.path_info?

2009-07-06 Thread Bastien
Hi, I could not find any valuable documentation about the differences between request.path and request.path_info. anybody knows a bit about them? Thanks, Bastien --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: best practice to have a list of mixed objects

2009-07-02 Thread Bastien
thanks I didn't know about that one, I'll give it a try! On Jul 2, 12:57 pm, Jarek Zgoda wrote: > Wiadomość napisana w dniu 2009-07-02, o godz. 12:45, przez Bastien: > > > I am trying to have a list of various types of objects, for example a > > list mixed with

best practice to have a list of mixed objects

2009-07-02 Thread Bastien
n I extend() the list in only one variable. I'm sure there's a better way to do that, if you have any idea you're welcome to share it! Thanks, Bastien --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups &quo

Re: How to convert a unicode string into something that can call an object?

2009-06-18 Thread Bastien
Thank you both, I think the dictionary is the safest method here but I'm glad to know the existence of eval too because I've been searching for it all day and sure will use it in the future. Bastien On Jun 18, 6:52 pm, Alex Gaynor wrote: > On Thu, Jun 18, 2009 at 11:50 AM, D

How to convert a unicode string into something that can call an object?

2009-06-18 Thread Bastien
te 'objects'. So how could I convert this request.POST to something usable in this case? thanks, Bastien --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post t

Re: reverse url fails on existing url

2009-06-16 Thread Bastien
thanks!! both works. Bastien On Jun 16, 11:10 am, Brian May wrote: > On Tue, Jun 16, 2009 at 02:07:01AM -0700, Bastien wrote: > > I don't understand how this works, on my url without arguments I can > > use the template tag {% url ... %} and it just works but as soon as I

reverse url fails on existing url

2009-06-16 Thread Bastien
ts'), and I call it via: {% url public_comments args=user.username %} then I get : Caught an exception while rendering: Reverse for public_comments' with arguments '()' and keyword arguments '{'args': u'

Re: get all the comments from a user

2009-06-15 Thread Bastien
I was searching in the included template tags but obviously doing a database search works very well: Comment.objects.filter(user_name='myname') thanks, Bastien On Jun 15, 3:09 pm, Bastien wrote: > Hi, > > with the django comments app how can I get all the comments

get all the comments from a user

2009-06-15 Thread Bastien
Hi, with the django comments app how can I get all the comments form a given user? thanks, Bastien --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

How to access a form subfield? form design?

2009-06-15 Thread Bastien
how this works? Thanks. Bastien --~--~-~--~~~---~--~~ 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

passing variables to other views / initial function executed before every views

2009-06-09 Thread Bastien
angoish. Does such a function exist? Doesn't catching a message on every page is javascripts' job? thanks for your light, Bastien --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Where should I do post form data processing?

2009-06-03 Thread Bastien
thanks that's brilliant! I'm going to re-read the doc anyway. Bastien On Jun 3, 6:36 pm, Jashugan wrote: > On Jun 3, 8:20 am, Bastien wrote: > > > Yes it seems to be the logical solution. And does this override the > > save() method? I guess yes so I'll have to

Re: Where should I do post form data processing?

2009-06-03 Thread Bastien
Yes it seems to be the logical solution. And does this override the save() method? I guess yes so I'll have to save the entire form by hand. I think I'm in for a good documentation reading... thanks for your guidance Jashugan. Bastien On Jun 3, 5:11 pm, Jashugan wrote: > On J

Where should I do post form data processing?

2009-06-03 Thread Bastien
ntered. If not, I get a 'local variable 'category' referenced before assignment'. May be it's better to use signals here? Thanks, Bastien --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups &q

Re: Migrating (importing) SQL dump for one model

2009-06-01 Thread Bastien
Thanks Kevin, it looks like it's not going to be easy. I think I will create the model by hand since it's not a lot of work and then I will load the data I have in the dump directly with the PostgreSQL tools and not doing it with Django. Bastien On Jun 1, 10:26 am, "K.Berkhout&quo

Migrating (importing) SQL dump for one model

2009-06-01 Thread Bastien
eates the model? Or is there a more complex way to do it? Thank you, Bastien --~--~-~--~~~---~--~~ 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@googlegroup

Re: prepopulate file fields in forms after validation errors

2009-05-26 Thread Bastien
Thank you Daniel, then the users will just re enter the files and feel secure :) On May 26, 1:42 pm, Daniel Roseman wrote: > On May 26, 12:30 pm, Bastien wrote: > > > Hi, > > > When I have some validation errors in my forms they automatically get > > reloaded aft

prepopulate file fields in forms after validation errors

2009-05-26 Thread Bastien
hanks, Bastien --~--~-~--~~~---~--~~ 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 django

Global date format in fields

2009-05-14 Thread Bastien
change the behavior of the DateFields or DateTimeFields of my forms. Thanks, Bastien --~--~-~--~~~---~--~~ 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

i18n of words that switch place in a sentence

2009-05-11 Thread Bastien
Hi, I'm sure this is in the doc but I can't find it. Is there a way to change a word's place in a sentence according to the language setting? What I need is to translate the term 'ago' from english to a few other languages that place it in front of the time, an example will explain it better: e

Re: autofilling select boxes

2009-05-11 Thread Bastien
ing the id of 0 or more other blog entries that might be related and have been selected by the user. I hope it's understandable and helps, Bastien On May 11, 8:18 am, jai wrote: > You can use Dojo or jquerry. > > On May 11, 10:44 am, newbie wrote: > > > > > Hi, >

Re: restrict choice of recursive many to many relation

2009-05-06 Thread Bastien
Thank you George the 'limit_choices_to' param is exactly what I was looking for. I had never used or seen it before. Bastien On May 5, 10:45 pm, George Song wrote: > On 5/5/2009 12:29 PM, Bastien wrote: > > > This is quite new to me, I have done a recursive (self) man

restrict choice of recursive many to many relation

2009-05-05 Thread Bastien
blog entry but I would like to see only the blog entries that belong to a given category. Can I refine the query? That's what I have for now: related_entries = models.ManyToManyField('self', blank=True, symmetrical=False, related_name='original_entrie

Re: count the number of times an object / class has been instantiated

2009-04-30 Thread Bastien
Sorry if my question is a bit off topic, sometimes my mind tends to forget that python has not been created just for django... and thanks for the answer Andy. Bastien On Apr 30, 1:40 pm, Andy Mikhailenko wrote: > Hi, your question does not seem to be related to Django. Anyway: > >

count the number of times an object / class has been instantiated

2009-04-30 Thread Bastien
Hi, Just for curiosity, anyone knows about a way to count how many times an object or a class has been instantiated? I could add a simple counter as a method of the class but what would trigger it? thanks, Bastien --~--~-~--~~~---~--~~ You received this message

Re: Login redirect url truncated

2009-04-29 Thread Bastien
Thanks Malcolm, That was very informative. I tried the percent encoding trick with no success. Now I'll try the second part and post here if I am successful. Thanks, Bastien On Apr 29, 6:50 pm, Malcolm Tredinnick wrote: > On Wed, 2009-04-29 at 07:43 -0700, Bastien wrote: > >

Login redirect url truncated

2009-04-29 Thread Bastien
e this: http://mysite.com/accounts/login/?next=/content/#comment_form but the url returned by the login is a stripped down version that doesn't contain the trailing part with the '#comment_form'. Any idea on what I missed? thanks, Bastien --~--~-~--~~~---

Re: How to get request.user inside a model method?

2009-04-23 Thread Bastien
Karen, thanks, I think I will follow the way of the custom template tag. Bastien On Apr 22, 4:32 pm, Karen Tracey wrote: > On Wed, Apr 22, 2009 at 5:13 AM, Bastien wrote: > > > The last thread about that is quite old, I was wondering if there is > > any new way to do that?

How to get request.user inside a model method?

2009-04-22 Thread Bastien
The last thread about that is quite old, I was wondering if there is any new way to do that? I wrote a method in a model that requires the current user and I use this method in a template so I guess I can't pass any argument, can I? thanks, Ba

Re: Models Aliases

2009-04-20 Thread Bastien
Thanks Alex, I didn't know this function, that's what I needed! Bastien On Apr 20, 1:40 pm, Alex Koshelev wrote: > Hi, Bastien. > > I think the simple solution with property may be the best aproach if > you cannot change dependent code: > > user = property(lambda s

Re: Models Aliases

2009-04-20 Thread Bastien
Dougal Matthews wrote: > why don't you just access entry.author rather than entry.user? > I think perhaps I'm not quite following your question. > > Dougal > > --- > Dougal Matthews - @d0ugalhttp://www.dougalmatthews.com/ > > 2009/4/20 Bastien > > > > >

Models Aliases

2009-04-20 Thread Bastien
Hi, I searched the doc but couldn't find anything about this: I have a model for a blog entry that contains a foreign key to user and is named author. But that would be really convenient for me if the object would respond to the keyword 'user' as well: entry.user doesn't exist in the model but I

Re: timesince template tag filter format

2009-04-20 Thread Bastien
I end up using a custom template tag by 'realmac' found here: http://www.djangosnippets.org/snippets/557/ that calculate the age from the birthdate and only returns the years. On Apr 18, 11:06 pm, Bastien wrote: > Hi, > > I'm using the timesince filter in a template

Re: How to display the recent comments

2009-04-18 Thread Bastien
Thanks Alex, I didn't think about it that way, so far I've just used the template tags for the comment system but I'll start using it like that. On Apr 19, 12:42 am, Alex Gaynor wrote: > On Sat, Apr 18, 2009 at 6:40 PM, Bastien wrote: > > > Hi, > > >

Re: Query to retrieve users from a given group

2009-04-18 Thread Bastien
Matthias your point is interesting and your code works just as well so thanks! On Apr 17, 3:51 pm, Matthias Kestenholz wrote: > On Fri, Apr 17, 2009 at 3:18 PM, Daniel Roseman > > > > > > wrote: > > > On Apr 17, 1:23 pm, Bastien wrote: > >> Hi, > &

How to display the recent comments

2009-04-18 Thread Bastien
Hi, I try to find the way to display the recent comments for a given site, regardless of app / model but the doc doesn't show much, anybody has it already? thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Djan

timesince template tag filter format

2009-04-18 Thread Bastien
Hi, I'm using the timesince filter in a template where I print a list of users along with some info about these users. Among this info I print the user's age which I get from the user's birthdate and I return the result of {{ user.get_profile.birthdate|timesince }} to get the age. Everything work

Re: Query to retrieve users from a given group

2009-04-17 Thread Bastien
Thanks Daniel, it works! On Apr 17, 3:18 pm, Daniel Roseman wrote: > On Apr 17, 1:23 pm, Bastien wrote: > > > > > > > Hi, > > > I'm trying to retrieve a list of users belonging  to a given group but > > don't understand how to do it. It must be

Query to retrieve users from a given group

2009-04-17 Thread Bastien
Hi, I'm trying to retrieve a list of users belonging to a given group but don't understand how to do it. It must be a sort of many to many query but I can't get it to work. I would like to do something like this: basic_users_list = User.objects.filter(groups__in=Group.objects.get (name='basic'

Re: Process multiple html forms in the same view

2009-04-14 Thread Bastien
Thank you Karen, that's exactly what I need "To give each Form its own namespace". On Apr 13, 10:57 pm, Karen Tracey wrote: > On Mon, Apr 13, 2009 at 2:11 PM, Bastien wrote: > > ... So my question is how could the > > view know which POST data belongs to which fo

Process multiple html forms in the same view

2009-04-13 Thread Bastien
I have a classic user profile page where the user fills a form with various field about her profile (name, address, about me...). On the same page I have another form that is very similar to a blog post entry (title, body...) that represents a message that the user can optionaly fill if she wants

Re: Django-Registration help

2009-03-13 Thread Bastien
Thank you very much James, I couldn't get a better answer. I will try this right away and hopefully get back on the right path! On Mar 13, 8:29 pm, James Bennett wrote: > On Fri, Mar 13, 2009 at 5:02 AM, Bastien wrote: > > I will answer my own question since I found the answer,

Re: Django-Registration help

2009-03-13 Thread Bastien
template registration_form you can now use the {{ form.tos }} It's only a matter of form subclassing and is explained here (somewhere down the page): http://docs.djangoproject.com/en/dev/ref/forms/api/#ref-forms-api On Mar 12, 5:56 pm, Bastien wrote: > Hi, > > I'd like t

Django-Registration help

2009-03-12 Thread Bastien
Hi, I'd like to use the available functionality "terms of service" in Django-Registration but have no clue about how I do that. I already have the basic thing running on my project. thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Localize URLs

2009-03-12 Thread Bastien
Dougal > > --- > Dougal Matthews - @d0ugalhttp://www.dougalmatthews.com/ > > 2009/3/12 Bastien > > > > > > > Thanks Dougal, I think you're right about django-cms supporting this > > feature, I'm going to dive in their code. > > > Bastien >

Re: Localize URLs

2009-03-12 Thread Bastien
Thanks Dougal, I think you're right about django-cms supporting this feature, I'm going to dive in their code. Bastien On Mar 12, 2:40 pm, Dougal Matthews wrote: > You may want to consider trying django-cms. They support these feature > I believe. Of nothing else you could

Localize URLs

2009-03-12 Thread Bastien
Hello Django users, I've been scratching my head trying to find a solution to have URLs translated in various languages. So the typical 'about' would be translated in 'a propos' in french and whatever other languages, like all the static content. I also need to provide the user a way to write fla