Django job opportunity in Bordeaux, France

2016-01-12 Thread bruno desthuilliers
We're looking for a Python / Django dev : http://emploi.alsacreations.com/offre-565470-Developpeur-django-python.html -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an ema

Re: Insert variable into RequestContext?

2013-05-06 Thread bruno desthuilliers
Looks like you want a context_processor : https://docs.djangoproject.com/en/1.5/ref/templates/api/#subclassing-context-requestcontext -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from

Re: configure url

2012-11-15 Thread bruno desthuilliers
On Thursday, November 15, 2012 7:25:28 AM UTC+1, rh wrote: > > All the tutorials I looked at didn't explain (?P\w+) and it seems > that the > tutorials say things like "it's a regular expression, go read python docs > for more". > Maybe regexs are consider ugly plumbing stuff unsuitable for tut

Re: Django mod-wsgi multiple instances of One Class object

2012-11-06 Thread bruno desthuilliers
On Monday, November 5, 2012 7:07:23 PM UTC+1, drunksaint wrote: > This model was running perfectly in the DEV deployement. When I moved to > PROD in apache, this broke (as in there are multiple instances of scObj > being created, so a score update from player-1's move on player-2 is not > ref

Re: Design decision

2012-11-06 Thread bruno desthuilliers
On Tuesday, November 6, 2012 3:13:40 PM UTC+1, rdollinger wrote: > > Hi, > > I'm starting a new project, that is composed with various modules > (application). This project will sold to costumers (ca. 100) with different > configurations (modules, language, ...). My intention is to have models,

Re: Django Admin doesn't show all fields from model when registered.

2012-08-18 Thread bruno desthuilliers
Le jeudi 16 août 2012 21:00:56 UTC+2, Tundebabzy a écrit : > > Ok I fixed it and in case someone else falls into such a trap, here's > how I fixed it. > > My Answer model had a field with name 'is_correct' and had a method > with name 'is_correct'. > Everything in Python is an object, includ

Re: Django TypeError

2012-07-23 Thread bruno desthuilliers
On Tuesday, July 17, 2012 8:00:39 AM UTC+2, sandy wrote: > > I want to have different views for my application for different types > of users. For this I have this code for my views.py file : > > def index1(request): > u = User.objects.all() > This has been solved. > if u.is

Re: Problem to complète the xml template

2012-07-05 Thread bruno desthuilliers
On Wednesday, July 4, 2012 8:12:50 PM UTC+2, nef wrote: > > Hello, > Bonjour > I want to cry a function allowing me to complete a template *. Xml. May I > have a problem with the passage of the object render_to_response. In short > here is my code. In fact, I do not know how to return an obj

Re: have an object available in every templates

2012-06-29 Thread bruno desthuilliers
On Thursday, June 28, 2012 5:53:46 PM UTC+2, Bastian wrote: > > Well, I was curious to see if it worked with a context processor so I > tried and indeed it works. After all it's only returning an object or list > of objects in a dictionary. Now I don't know which method is the most > efficient

Re: interpretting urls

2012-06-28 Thread bruno desthuilliers
On Wednesday, June 27, 2012 11:53:56 PM UTC+2, Sam007 wrote: > > > Going thru the doc link you gave, I did not understand the term middleware > request processing? > > but if the incoming HttpRequest object has an attribute called urlconf (set > by middleware *request > processing*

Re: interpretting urls

2012-06-27 Thread bruno desthuilliers
On Tuesday, June 26, 2012 6:52:06 PM UTC+2, Sam007 wrote: > > Hi, > > I am bit confused about what exactly do these urls imply in the url.py > > This is all documented here : https://docs.djangoproject.com/en/dev/topics/http/urls/ -- You received this message because you are subscribed to the

Re: ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.

2012-06-26 Thread bruno desthuilliers
Désolé, je ne parle pas espagnol... On Monday, June 25, 2012 7:49:01 AM UTC+2, totechess wrote: > > Tengo el siguiente problema. Con la última actualización de django 1.5 > supongamos estoy en un directorio x y al hacer django-admin > startproject miProyecto me genera la carpeta miProyecto con l

Re: am new to the django ,facing problem in searching the database with primary key(student id)

2012-06-26 Thread bruno desthuilliers
On Tuesday, June 26, 2012 8:47:27 AM UTC+2, rick wrote: > > Reverse for 'add_record.views.search' with arguments '( Student_login object>,)' and keyword arguments '{}' not found. > > Your problem is with reverse url resolving, not with "searching the database". -- You received this message

Re: Hey

2012-06-25 Thread bruno desthuilliers
On Monday, June 25, 2012 8:05:13 AM UTC+2, Pervez Mulla wrote: > > HI, > > How can I extract data from DB so that I can take that data n send it to > templates to display graphs according to DataBase values . > How can I write view function for that? > Everything you need to know is here : https

Re: Render time

2012-06-25 Thread bruno desthuilliers
On Monday, June 25, 2012 1:34:08 PM UTC+2, larry@gmail.com wrote: > > Now they want me to add to that how long > the browser takes to render the page > How would server code ever know this ? -- You received this message because you are subscribed to the Google Groups "Django users" group

runserver cache my template files

2012-06-22 Thread bruno desthuilliers
I assume you did check your browser cache ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/vcMDF4DurtYJ. To post to this group, send email to django-users

Re: Custom Tags and Includes, invalid block !

2012-06-19 Thread bruno desthuilliers
On Tuesday, June 19, 2012 12:37:29 AM UTC+2, upmauro wrote: > > Hello, sorry my english ! > > I have one question, i create one custom tag and this works fine. > > But i have a situation : > > *site.html* > * > * > {% include "header.html" %} > > Django looks the best framework for web ! > > {% i

Re: trailing slash defeats get_absolute_url

2012-06-15 Thread bruno desthuilliers
On Friday, June 15, 2012 9:42:33 AM UTC+2, Mike Dewhirst wrote: > > On 15/06/2012 5:11pm, bruno desthuilliers wrote: > > You have to end your url patterns with a slash, ie r'^search/'. > > Ok. I added a trailing slash to the get_absolute_url method like so ... &g

trailing slash defeats get_absolute_url

2012-06-15 Thread bruno desthuilliers
You have to end your url patterns with a slash, ie r'^search/'. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/JAbME4x4ZusJ. To post to this group, send e

trailing slash defeats get_absolute_url

2012-06-15 Thread bruno desthuilliers
You have to end your url patterns with a slash, ie r'^search/'. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/iks8SsEo2v4J. To post to this group, send e

Re: 'ascii' codec can't encode character u'\xe4'

2012-06-14 Thread bruno desthuilliers
On Thursday, June 14, 2012 1:58:28 PM UTC+2, lawgon wrote: > > On Thu, 2012-06-14 at 04:19 -0700, bruno desthuilliers wrote: > > > I have an application which runs on a webfaction hosting. > > > > > > > > How is it deployed exactly ? > > apach

Re: 'ascii' codec can't encode character u'\xe4'

2012-06-14 Thread bruno desthuilliers
On Thursday, June 14, 2012 12:35:40 PM UTC+2, lawgon wrote: > > hi, > > I have an application which runs on a webfaction hosting. How is it deployed exactly ? (sorry never used webfaction hosting for django - nor for anything else FWIW) > I also have > the same app running on my devel m

Re: more than 1 level of belongsTo

2012-06-08 Thread bruno desthuilliers
What about posting your CakePHP questions to a CakePHP related group ? On Jun 8, 2:56 pm, rahajiyev wrote: > Hi, I have a model Foo belongsTo Bar, which in turn belongsTo Xyzzy. > When I do $this->Foo->find('all'); > > sql dump shows that the SQL join is performed only for Foo->Bar, but > Xyzzy i

Re: RSS Feed

2012-06-08 Thread bruno desthuilliers
On Jun 8, 1:53 pm, armagan wrote: > Hi, > > I'm trying to implemente an rss to my project. I have done a simple > example in django doc. Which one ? url, please. > But I have an error in urls.py. > > from 'blogum.feeds import LatestEntriesFeed' ==> I've imported this, I > have an error  'No modu

Re: url_dir

2012-06-06 Thread bruno desthuilliers
On Jun 6, 12:50 pm, Satvir Toor wrote: > I read the linkhttps://docs.djangoproject.com/en/1.3/topics/http/urls/ > > above unable to understand what is regular expression in url pattern > e.g r'^pyrheology/plot/tensile/(?P\d+).png$' Do you mean "I don't understand where's the regular expression pa

Re: url_dir

2012-06-06 Thread bruno desthuilliers
On Jun 6, 12:32 pm, Satvir Toor wrote: > Please explain me the following code that exists in urls.py file of > the project. > url(r'^pyrheology/plot/str/(?P\d+).png$',\ >         'pyrheology.views.str_tmc_plot_img',\ >         name='pyrheology-str-tmc-plot-img'), https://docs.djangoproject.com/

Re: Accessing current URI from template tag

2012-06-06 Thread bruno desthuilliers
On Jun 6, 10:27 am, Swaroop Shankar V wrote: > Hello All, > > Well my question is on how to get the current URI in a template tag. You'll have to use a RequestContext in the views rendering the templates where you use this templatetag, and activate the django.core.context_processors.request conte

Re: . delete() don't work

2012-06-06 Thread bruno desthuilliers
On Jun 5, 7:22 pm, Lucas Aride Moulin wrote: > The syncdb worked. Isso didn't know that the delete() need a table. > Thanks, It doesn't, of course. The problem you report is surprising to say the least... -- You received this message because you are subscribed to the Google Groups "Django user

Re: How to perform a simple search ignoring characters with accents (á, é, í, ó, ú)

2012-06-05 Thread bruno desthuilliers
Since no one seemed to mention it so far: what about using a real fulltext search engine ? (hint : django-haystack provides a django-ish, unified API over quite a few known search engines). -- You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Retrieve datas from database

2012-06-04 Thread bruno desthuilliers
On Jun 4, 2:23 pm, by-neron wrote: > however, > > in mysite/template/index.html > >  {% for post in latestPosts %} >      {{ post.id }} >     {% endfor %} > prints nothing because it could not send data here. How can i send it ? You pass them as a Context object to the render() method of the tem

Re: Using the django.contrib.auth User in my model - database error

2012-06-04 Thread bruno desthuilliers
On Jun 4, 11:01 am, xTalisman wrote: > Solved : > I dropped all the database tables (including the contib.auth ones) and ran > syncdb, suddenly everything was fine. odd , but is working now . Well, nice to know it works now, but yes this _is_ odd. -- You received this message because you are su

Re: Understanding Django for PHP developer

2012-06-04 Thread bruno desthuilliers
On Jun 3, 12:18 pm, mikegolf wrote: > Hi, > I've started to learn Django recently, however for last 5+ years I've > been developing using PHP (especially Yii) and thus asking if there's > any tutorial / documentation on significant differences in > *thinking*. > What I mean is for example objects'

Re: Using the django.contrib.auth User in my model - database error

2012-06-04 Thread bruno desthuilliers
On Jun 4, 9:49 am, xTalisman wrote: > I ran syncdb without a problem ,  then when I used the admin interface I > get the following error : > > Exception Type: DatabaseError at /admin/coordination/project/ > Exception Value: no such column: coordination_project.manager_id > syncdb only creates the

Re: Problem with Django Project

2012-06-01 Thread bruno desthuilliers
On Jun 1, 10:47 am, cmac0tt wrote: > Learning Django/Python by converting a warped >0.96 project to a 1.4 > project with python 2.7.3 > > So this is my github to make it easier. Can anyone tell me what it is > thats causing me to keep chasing errors around? Just a suggestion : "failure to follow

Re: Adding values to formdata of ModelForm before saving

2012-05-31 Thread bruno desthuilliers
On 31 mai, 20:09, Schmidtchen Schleicher wrote: > Thank you for your quick answer, but it doesn't really work. It raises the > exception "can't assign to operator" > My view now looks like this: > > @login_required > > def create_termin(request, calid, year=None, month=None, day=None): > >     kal

Re: sqlall fails silently

2012-05-31 Thread bruno desthuilliers
On May 31, 8:24 am, vijay shanker wrote: > hi > i defined three models and put them in /appname/models/ a.py, b.py, > c.py. and a __init__.py in which i import all classes defined inside > a.py/b.py/c.py. > > when i try to do a ./manage.py sqll appname at prompt , it simply > passes of without any

Re: image files do not get deleted on deleting an object

2012-05-31 Thread bruno desthuilliers
On May 31, 9:14 am, kenneth gonsalves wrote: > hi, > > I have just noticed that on deleting an object, the images and files > stored on disk for this object do not get deleted. Is this a bug or a > feature? https://docs.djangoproject.com/en/1.3/releases/1.3/#deleting-a-model-doesn-t-delete-associ

Re: derived fields and getattr

2012-05-25 Thread bruno desthuilliers
On May 25, 2:32 pm, Larry Martell wrote: > On Fri, May 25, 2012 at 2:24 AM, bruno desthuilliers > > >> I couldn't use the display name or the getattr failed. > > > ??? > > When I first did: > > extra(select={"Delta" : self.field_name}) > >

Re: track change

2012-05-25 Thread bruno desthuilliers
On May 24, 11:00 pm, Carsten Jantzen wrote: > > Not sure what you mean by detecting skill change using properties, I > havn't looked into that. > Could you point to some documentation about it. Python has a strong support for computed attributes[1], and offers a builtin "property" type for the mo

Re: derived fields and getattr

2012-05-25 Thread bruno desthuilliers
On May 24, 11:50 pm, Larry Martell wrote: > I got this to work by adding the derived field to the drill down query > with queryset.extra, and then it was available with getattr. The only > issue I had was they wanted the derived field displayed with a name > (not col1-col2). In the first query I

Re: loop over model ids ? possible ?

2012-05-25 Thread bruno desthuilliers
On May 25, 8:19 am, doniyor wrote: > hey guys, > i need to loop over the number of ids of objects in my db table and create > accordingly the same number of html fields. how can i do it.. my effort is > this: >  numberOfIds = Produkt.objects.count() >         i = 1; >         for i in range(0,numb

Re: derived fields and getattr

2012-05-24 Thread bruno desthuilliers
On May 24, 3:44 pm, Larry Martell wrote: > On Thu, May 24, 2012 at 2:27 AM, bruno desthuilliers > > wrote: > > On May 23, 10:39 pm, Larry Martell wrote: > >> I was asked to make a mod to a large django app that I didn't write. > >> They wanted me to add a

Re: django-crequest - New app announcement

2012-05-24 Thread bruno desthuilliers
On May 24, 2:57 pm, Alireza Savand wrote: > On Thursday, May 24, 2012 4:46:34 PM UTC+4, bruno desthuilliers wrote: > > > > Uhu... What if I'm running my code from the shell or a command ? > > By the way, there is also *set_request*(*request*) for that situation. Yes. I

Re: track change

2012-05-24 Thread bruno desthuilliers
On May 23, 10:45 pm, Carsten Jantzen wrote: > When I load the player I would like to see his latest stats. > If I goto the players page I would like to be able to view when and > what skill changed. > > I am looking for a good way to implement it. > I was thinking to make the skill it's own objec

Re: How to call RegexValidator explicitly?

2012-05-24 Thread bruno desthuilliers
On May 24, 4:30 am, forthfan wrote: > > from django import forms > from django.core.validators import * > > class IdentForm(forms.Form): >   ident = forms.CharField() >   ident_type = forms.ChoiceField(choices=( >       ('EIN','Employer ID'), >       ('SSN','Social Security Number'), >   )) > >  

Re: django-crequest - New app announcement

2012-05-24 Thread bruno desthuilliers
On May 24, 12:35 pm, Alireza Savand wrote: > Hi > Yesterday i released an app for django. > *Basically it's just a middleware to access current request of your django > application from anywhere in your code.* Uhu... What if I'm running my code from the shell or a command ? >From experience with

Re: derived fields and getattr

2012-05-24 Thread bruno desthuilliers
On May 23, 10:39 pm, Larry Martell wrote: > I was asked to make a mod to a large django app that I didn't write. > They wanted me to add a derived field to a query, e.g. select > col1-col2 from table ... I assume you're talking about using queryset.extra ? > I did that and it works, but in some

Re: Registering and authenticating via iPhone/Android app

2012-05-24 Thread bruno desthuilliers
On May 23, 3:12 pm, Roarster wrote: > Thanks Bruno.  I've had a bit more of a look into this and everyone seems > to be using OAuth, as you mention.  I did try to get this working with the > Tastypie API but I couldn't really find any documentation and found it a > bit of a struggle.  I guess I'll

Re: Is there a custom forms component of python-web?

2012-05-24 Thread bruno desthuilliers
plonk. On May 24, 9:58 am, kevon wang wrote: > I want to find a plugin of django what it can custom fields in the form. > The functions include custom fields in web page and create the fields in > database. > plug's flow like these: >      1.we can define fields in web page > --> 2.create the tab

Re: Registering and authenticating via iPhone/Android app

2012-05-23 Thread bruno desthuilliers
On May 23, 1:12 pm, Roarster wrote: > I'm developing a site using Django using the built in user authentication > module.  This is all working fine and users can register, login, etc. on > the web site with no problems.  The plan is to also have companion > iPhone/Android apps where users can regi

Re: Is there a custom forms component of python-web?

2012-05-23 Thread bruno desthuilliers
On May 23, 12:27 pm, kevon wang wrote: > Is there a component as above Yes. > thanks! You're welcome. hint #1: google is your friend. Took me about 15 seconds to get the answer, so way less than the time you spent posting your question. hint #2: what you're looking for is usally named a form

Re: ordering m2m query based on through table

2012-05-23 Thread bruno desthuilliers
On May 23, 11:43 am, akaariai wrote: > I would guess you would get duplicate objects returned. We programmers are usually very bad at guessing. So when in doubt, check, don't guess ;) > I think the > query works as follows: >   - Fetch all Blook's categories >   - For those categories you fetch

Re: DB joining 3 tables in django admin, while searching on the primary table

2012-05-23 Thread bruno desthuilliers
On May 20, 9:42 am, Aditya Sriram M wrote: > I tried this but it failed? Can you pls correct me? yes : "it failed" is the worst possible way to describe a problem if you expect to get some help. If you get an exception and traceback, please read them carefully, and eventually post them. Else a

Re: ordering m2m query based on through table

2012-05-23 Thread bruno desthuilliers
On May 22, 4:34 pm, akaariai wrote: > So, you would want to do collection.songs.all() and have that ordered > by the sequence defined in the m2m table? I agree - this seems to be > somewhat hard currently. I currently have a similar scheme in one of our projects, works fine as far as I can tell

Re: Django site updater

2012-05-23 Thread bruno desthuilliers
git (or whatever versioning system you're using) + South for schema migrations + virtualenv / pip for depencies + a simple shell script on the server to update the whole damn thing and restart services (Apache, whatever). You can even have the script run by a cron job so the server is updated every

Re: ModelForms and CreateView Help

2012-05-22 Thread bruno desthuilliers
On May 22, 10:34 am, wchildsuk wrote: > Hi, > > I'm trying to use generic class based views to edit a specific > queryset but I can't see to get my code working. I've defined queryset Nope, cf Xavier's answer on this. > and relevant form but when the form renders it doesn't contain the > queryse

Re: user.set_password('new password')

2012-05-21 Thread bruno desthuilliers
On May 19, 5:49 pm, Timothy Makobu wrote: > user.save returns the function object, actually it evals to a method object ;) -- 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. T

Re: My context variables don't show in templates

2012-05-21 Thread bruno desthuilliers
On May 20, 12:29 am, Mohamed Turki wrote: > > def home(request): >     var = "" >     n = None Better to use readable names. >     if request.method == u'GET': >         GET = request.GET >         if GET.has_key(u'name'): >             n = GET[u'name'] >             try: >                 user

Re: Trying to Edit Existing Post; Can't Get Form to Display

2012-05-21 Thread bruno desthuilliers
On May 19, 5:41 pm, Jonathan Baker wrote: Just a note about best practises: > > # views.py (snip) >             return HttpResponseRedirect("/report/all/") Better to use named urls and django.core.urlresolvers.reverse, this avoids quite a lot of pain and trouble when you have to change your u

Re: django forms - overriding constructor for changing field type depending by input

2012-05-21 Thread bruno desthuilliers
On May 20, 5:28 pm, luke lukes wrote: > thanks Paul and DR, your solution worked. anyway now i have a problem with > the validation of that form (her's the view): (snip) Sorry, your code's indentation get messed up so it's hard to tell where the problem ise exactly. Please post a link to dpas

Re: How to get the Exception Type

2012-05-15 Thread bruno desthuilliers
On May 15, 1:29 am, LJ wrote: > I am trying to add exception handling to my application. > I have been reading the documentation on Django > Exceptions:https://docs.djangoproject.com/en/dev/ref/exceptions/ > I also found the list of Exceptions (both Django and Python). > But for testing purposes,

Re: How to get the Exception Type

2012-05-15 Thread bruno desthuilliers
On May 15, 2:31 am, Nikolas Stevenson-Molnar wrote: > You could also log the whole stack trace using the traceback > module:http://docs.python.org/library/traceback.html Or just use logging.exception, that takes care of all the gory details in a single and simple call: try: foo = bar.baaz()

Re: Error: 'module' object is not callable

2012-04-27 Thread bruno desthuilliers
On Apr 27, 2:30 pm, Tom Evans wrote: > > The datetime class lives inside the datetime module. So far so good but! > You must have > "import datetime" in that code, perhaps as well as "from datetime > import datetime". The first statement will import the datetime module and bind it to the na

Re: Custom commands for manage.py

2012-04-27 Thread bruno desthuilliers
On Apr 26, 11:50 pm, "." wrote: > Hello, > > I have several questions connected with custom commands. > > 1. How to delete anything from this dict? Is there a specific method > for this? [1] > > >>> Poll.objects.all() > > [] This is not a dict, it's a QuerySet containing one single Poll instance

Re: ModelForms

2012-04-27 Thread bruno desthuilliers
On Mar 23, 12:46 am, hack wrote: > I think I shot myself in the foot using ModelForms to generate all of my > html forms.  Is there any way to use a stylesheet when your forms are > generated from ModelForms? Yes of course, why ? > I've tried everything and cannot get it to work.  I've tried dir

Re: Can't find module

2012-04-27 Thread bruno desthuilliers
On Apr 27, 3:56 am, Gerald Klein wrote: > Hi, I am having a strange problem, I have a search module named 'search' > but Django states ;No module named search full traceback please ? > here is my url > > url(r'^search/$', 'cms.search.views.search'), is the cms.search app in your settings.INSTAL

Re: keep models simple ? where to put the business logic ?

2012-04-27 Thread bruno desthuilliers
On Apr 23, 3:45 pm, Javier Guerra Giraldez wrote: > On Mon, Apr 23, 2012 at 6:47 AM, bruno desthuilliers > > wrote: > > Models - like any other module - should indeed be "as simple as > > possible", _but not simpler_. If you concern is about your models.py >

Re: keep models simple ? where to put the business logic ?

2012-04-27 Thread bruno desthuilliers
On Apr 24, 1:32 pm, Michael Palumbo wrote: > Hi guys, > > Thanks for your answers, it helps. > > - Anemic domain model : I didn’t know about this before, it is good to know. > - Daniel : if I split my models and import all of them in my __ini__.py > file, why do I still need to use the app_label m

Re: Ways to handle long-running server-side processing in Django

2012-04-23 Thread bruno desthuilliers
On Apr 21, 11:34 pm, David Markey wrote: > Sounds like the API should return a UUID that can then be used to poll, > while celery or similar does the heavy lifting in the background? +1 -- You received this message because you are subscribed to the Google Groups "Django users" group. To post t

Re: keep models simple ? where to put the business logic ?

2012-04-23 Thread bruno desthuilliers
On Apr 22, 7:51 pm, Michael Palumbo wrote: > Hi, > > I know this has already been discussed several times, I found several posts > about it through Google but I'm still interested in getting your opinion on > an example. > > I'm wondering that because my models file is getting big. That makes me >

Re: apache2 privileges

2012-04-19 Thread bruno desthuilliers
On Apr 18, 5:12 pm, "Daniel Sokolowski" wrote: > Hi Bruno, > > Can you expand on that, each of your sites has a user account created? Yes? Depends on the concrete use-case but mostly, yes, each django site will have a dedicated user account. If it's a dedicated hosting for one customer having 2 o

Re: cannot import name current_datetime

2012-04-19 Thread bruno desthuilliers
On Apr 18, 8:47 pm, asherakhet06 wrote: > H all! > > I am fairly new to programming (went over LPTHW) and now going through the > Djangobook on the internet.  Quick beginners question:  In Chapter 3, where > I am looking at a dynamic webpage in the 2nd example Could you please post a link to this

Re: question about celery

2012-04-19 Thread bruno desthuilliers
On Apr 19, 11:05 am, Mike wrote: (...) > Now I want to > move the processing off to a different machine so I'm looking into Celery. >  What I'm not sure about is what are the requirements of the workers.  Do > they need to have the code they are going to run already installed Yes. But you can us

Re: apache2 privileges

2012-04-18 Thread bruno desthuilliers
On Mar 9, 6:43 pm, "j...@jsdey.com" wrote: > My apache2 server on linux is running as www-data.  My project is in a > standard user account.  apache2 can't access files on the user account Using mod_wsgi in daemon mode let you run the django processes as another user/group, and this is definitly

Re: row level permissions - why?

2012-04-17 Thread bruno desthuilliers
On Apr 17, 8:07 am, Mike wrote: > In my app I need a way to associate objects with a specific user.  Users > should not have access to other users objects. I'm implementing this in my > model by setting a ForeignKey to the user that owns the object: > > owner = models.ForeignKey(User) > > Is this

Re: Where/how to load global static data?

2012-04-05 Thread bruno desthuilliers
On Apr 5, 3:11 pm, Tom Evans wrote: > > OP: I have a couple of solutions. One of the first things the server > does is import your settings, so if you load and parse your static > data at that point, then you will have access to it from that point > onwards. Please dont. Settings are, well, setti

Re: templates couple apps to a site; how do you separate them?

2012-03-14 Thread bruno desthuilliers
On Mar 14, 2:31 am, Ken wrote: > I'm struggling with how I should go about writing "pluggable" apps.  I > haven't found a satisfactory way of decoupling apps from a site and > the primary sticking point is templates.  I've combed through some > discussions but have not found any that have helped.

Re: Django deployment practices -- do people use setup.py?

2012-03-14 Thread bruno desthuilliers
On Mar 12, 11:55 pm, Tom Eastman wrote: > Hey guys, > > I'm looking for deployment best practices for Django projects. Google > searches seem to show countless numbers of them, many of them somewhat > contradictory :-) > > So as a simple discussion point: I'm curious to know if lots of people > us

Re: Can i specify a different set of global context processors for admin?

2012-03-09 Thread bruno desthuilliers
On Mar 9, 9:58 am, Paul wrote: > Nearly all views of an application i'm working on have the same > sidebars with dynamic contents. So i generate these in a custom global > context processor so it is available to any view without having to > specify the custom processor each time. This is better

Re: Exception handling in templates

2012-03-06 Thread bruno desthuilliers
On Mar 6, 7:07 am, Aryeh Leib Taurog wrote: > Let's say I have the following code: > > class MyClass: >     def my_title(self): >         if 'some string' not in self.get_another_object().x: >             return 'Specific Title' > > Then I have a template: > > {% with instance_of_myclass as obj %

Re: load settings on database

2012-02-16 Thread bruno desthuilliers
On Feb 16, 4:55 am, Anderson Borges wrote: > Hey guys > I am learning django and I have a question > I have a table in my database call SettingsUser so how can I load this table > to all views on my application? I just don't understand what "loading a table" is supposed to mean. If you want to

Re: connection.cursor()

2012-02-16 Thread bruno desthuilliers
On Feb 16, 10:29 am, MikeKJ wrote: > I got these imported tables from an external source so I need to > access the data using connection. Not necessarily - if there's no compound primary key, you can build django models from the tables using manage.py inspectdb (be sure to add the managed=False a

Re: Logging from multiple processes

2012-02-15 Thread bruno desthuilliers
On Feb 14, 6:23 pm, JC wrote: > Hey guys, > > Does Django 1.3.1 handle logging from multiple processes or I have to > have some special consideration? Not really a django-specific problem - the problem exists as soon as you have concurrent write access on a same file. The solution is of course to

Re: Django runserver 504 on static assets with IE only

2012-02-15 Thread bruno desthuilliers
On Feb 14, 8:56 pm, JC wrote: > On IE8 however, > my fiddler trace shows that random static assets (css, js, img) aren't > loading most (2/3) of the time.  The server trace doesn't seem to see > or log the request at all. Then it might be that for some reason IE8 just doesn't request the assets

Re: how to make a small change for apps installed under /site-packages dir

2012-02-09 Thread bruno desthuilliers
On Feb 8, 7:01 pm, Tom Lesters wrote: > > Generally speaking, using virtualenv (no-site-packages) + pip (with a > > requirement file you keep in your project) is a GoodPractice(tm) when > > it comes to dependencies. > > I'm actually using virtuallenv + pip now, thanks for advice anyways! GoodBoy(

Re: Can anyone please explain the following settings?

2012-02-09 Thread bruno desthuilliers
On Feb 9, 3:39 am, John Yeukhon Wong wrote: (snip code) > I just don't understand what each of the options above mean Can > someone please explain them?  Thanks. https://docs.djangoproject.com/en/1.3/ref/settings/ -- You received this message because you are subscribed to the Google Group

Re: Django code patterns

2012-02-09 Thread bruno desthuilliers
On Feb 9, 9:41 am, Rune Kaagaard wrote: > Dear django-users > > I keep doing patterns like: > >         has_changed = False >         if resource.user.email != request.POST['email']: >             resource.user.email = request.POST['email'] >             has_changed = True >         if resource.us

Re: how to make a small change for apps installed under /site-packages dir

2012-02-06 Thread bruno desthuilliers
On Feb 5, 6:16 pm, Tom Lesters wrote: > hi all, > > I installed an app called idios into python2.6/site-packages/idios dir, Which is possibly not a great idea... as you now know . Generally speaking, using virtualenv (no-site-packages) + pip (with a requirement file you keep in your project) is

Re: Rooting my application at the base (/) of the URL

2012-02-03 Thread bruno desthuilliers
On Feb 2, 9:14 pm, Johan wrote: > Hi > >   I have deployed my application on Apache using WSGI, using > WSGIScriptAlias / /var/www/site/django.wsgi. Everything looks very > good. My actual application lives at http:///application. So > with the setup above when I browse to http:// django 404 page.

Re: Newbie django/python with C++ background wants enums

2012-02-02 Thread bruno desthuilliers
On Feb 1, 10:45 pm, NENAD CIKIC wrote: > Hello, the subject expresses my discomfort with certain python > characteristics, given my background, and my lack of python knowledge. > Specifically lets say that I have a model with a Text field and char field. > The char field is length 1 and says "use

Re: model for uploading a file - not working??

2012-01-25 Thread bruno desthuilliers
On Jan 25, 4:54 pm, Krondaj wrote: (snip) > I get: > >   File "/home/chrissmith/Dcode/rrws/rrs/models.py", line 36 >     upload_doc = models.FileField(upload_to 'documents') > > ^ > SyntaxError: invalid syntax > > any idea's what's up? Please re-read carefully the error message and the line it po

Re: Deverifying a URLField

2012-01-25 Thread bruno desthuilliers
On Jan 25, 12:30 am, Rich Jones wrote: > Hello, all! (snip - Mike already answered) > Will I need to do a database migration > to do this? Or can I just add a 'verified=False' and run syncdb? URL Validation is done in django, not in the database, so there's no need for a migration here. Also no

Re: Why can't erase this model object? "AssertionError: Question object can't be deleted because its id attribute is set to None."

2012-01-23 Thread bruno desthuilliers
On Jan 22, 12:39 am, Chris Seberino wrote: > On Jan 21, 2:43 pm, JohnA wrote: > > > How are you finding these objects?  That might point to the answer. > > > Probably the likeliest explanation is that you are creating the > > objects but not saving them. > > In the Django shell I do > > quests =

Re: Why can't erase this model object? "AssertionError: Question object can't be deleted because its id attribute is set to None."

2012-01-23 Thread bruno desthuilliers
On Jan 22, 1:34 pm, akaariai wrote: > There is still the possibility that you really have a row where the PK > is somehow null. Very unlikely given the model definition, but well, sh*t happens. -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Why can't erase this model object? "AssertionError: Question object can't be deleted because its id attribute is set to None."

2012-01-23 Thread bruno desthuilliers
On Jan 21, 6:31 pm, Chris Seberino wrote: > On Jan 21, 6:44 am, Tom Evans wrote: > > > Models are representations of rows in a database. > > Deleting a model instance implies removing a row from a database. > > Model instances have an id attribute which denotes their row in the > > database. > >

Re: Joining tables

2012-01-16 Thread bruno desthuilliers
On Jan 16, 8:04 am, Arun P wrote: > Does this work? > > info = > ExtraInformation.objects.filter(user__is_active=1,user__is_staff=0,user__is_superuser=0).order_by("popularity").select_related("user") > > users = map(lambda i: i.user, info) That was for the "uselessly complicated and memory-hungr

Re: change min_length in form __init__?

2012-01-13 Thread bruno desthuilliers
On Jan 11, 12:15 pm, galgal wrote: > Is there any way, to change the field's *min_length* argument inside form > constructor? That doesn't work: > > def __init__(self, *args, **kwargs): >     super(CreateTeamForm, self).__init__(*args, **kwargs) >     self.fields['primary_color'].min_length = 4 A

Re: change min_length in form __init__?

2012-01-13 Thread bruno desthuilliers
On Jan 13, 7:02 am, Wen 温业逵Yekui wrote: > why you use the "*" in your function argument? > Because it's the sensible thing to do here - cf http://docs.python.org/release/2.6.7/tutorial/controlflow.html#more-on-defining-functions -- You received this message because you are subscribed to the Goo

Re: Session value persistence between views

2011-09-07 Thread bruno desthuilliers
On Sep 6, 10:42 am, alaric wrote: > Hi: > I am very new to Django but I am trying to authenticate using Django's > session framework. > Problem is: I need the raw password to ssh as that user to retrieve > data on another machine. I haven't gotten it to work however. > > I have a login view that l

Re: Pagination of more than one field

2011-09-07 Thread bruno desthuilliers
On Sep 6, 4:41 pm, Yaşar Arabacı wrote: > I think your question can be solved with javascript and ajax, rather than > with django. How is your knowledge in that area? This can definitly be resolved with Django, and it's always better to have something working without js / ajax when possible (you

  1   2   3   4   5   6   7   8   9   10   >