Re: Django Troubleshooting

2012-10-19 Thread Avraham Serour
you should use pip to install, why are you installing from source? if you are worried about filling your python installation with lots of stuff you should use virtualenv On Fri, Oct 19, 2012 at 6:15 AM, Lachlan Musicman wrote: > On Fri, Oct 19, 2012 at 4:07 PM, Sun Simon wrote: > > https://www.

Re: ordering by generic foreign key

2012-10-19 Thread Bastian
I tried that: favorites = Photo.objects.filter(likes__user=user).order_by("-likes__id") and it seems to work well in all the tests. The only thing I don't understand is how it works. Because in this generic relation there are various 'likes' for each 'Photo' object and so the 'filter(likes__us

Stop executing template tag

2012-10-19 Thread Nikhil Verma
Hello people I need some suggestion in a problem. How can i stop django template engine not executing {{name}}. Meaning I do not want that {{}}, the value should be printed it should somehow pass into the browser as it is. If i writing {{name}} it should print {{name}} in html file/browser How

Re: Stop executing template tag

2012-10-19 Thread Martin J. Laubach
Just put something between the {{ so the templating engine will not be tempted to interpret it. {{ should do the trick, for example. -- 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.goog

Re: Stop executing template tag

2012-10-19 Thread Tomas Ehrlich
Hi Nikhil, you can't do that with django template system without additional "raw" tag. Here's a relevant article: http://www.holovaty.com/writing/django-two-phased-rendering/ Cheers, Tom Dne Fri, 19 Oct 2012 15:51:39 +0530 Nikhil Verma napsal(a): > Hello people > > I need some suggestion in

Re: Stop executing template tag

2012-10-19 Thread Tom Evans
On Fri, Oct 19, 2012 at 11:40 AM, Tomas Ehrlich wrote: > Hi Nikhil, > you can't do that with django template system without additional "raw" tag. > > Here's a relevant article: > http://www.holovaty.com/writing/django-two-phased-rendering/ > > Cheers, > Tom Oh really? {% templatetag openvariabl

Re: Stop executing template tag

2012-10-19 Thread Russell Keith-Magee
On Fri, Oct 19, 2012 at 6:21 PM, Nikhil Verma wrote: > Hello people > > I need some suggestion in a problem. > > How can i stop django template engine not executing {{name}}. Meaning I do > not want that {{}}, the value should be printed it should somehow pass into > the browser as it is. > If i

Re: "Error: unable to open database file" when trying out the Django tutorial

2012-10-19 Thread Hamed Tohidloo
I am getting the exact same error . did you find out what was wrong ? On Friday, 25 March 2011 21:51:24 UTC+11, kpk wrote: > > I was trying out the tutorial "Writing your first Django app, part 1" > at http://docs.djangoproject.com/en/1.3/intro/tutorial01/. > > The configuration is as follows: W

File Storage help

2012-10-19 Thread Christopher Meng
Hi all, I want to know who has an example for file sharing service written in Django... Recently I have to write a file sharing project for students sharing their files in order to improve the usability and experience... So can anyone help me? -- You received this message because you are su

Re: __unicode__() addition not working in basic poll application.

2012-10-19 Thread Sandi Andrian
Restart your interactive shell by *exit() *first then *python manage.py shell*. It's works for me -- 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/-/AYBiKDc7a

Re: Better feedback for admin users

2012-10-19 Thread Daniele Procida
On Thu, Oct 18, 2012, Marc Aymerich wrote: >On Wed, Oct 17, 2012 at 12:21 AM, Daniele Procida wrote: >> I am starting to customise the admin classes for my models so that I >can provide extra feedback to the user. >> >> For example I want to report - in the admin page - useful information >about

Calculated attributes of ModelAdmin classes

2012-10-19 Thread Daniele Procida
I have a ModelAdmin class. Sometimes, I want it to include a certain field in the fieldsets, and sometimes I don't (whether it does or not would be the result of a calculation on the instance that is being edited in the admin). How can I make the fieldsets attribute a calculated value, calcul

Re: Adding values in my database via a ManyToMany relationship represented in admin.py

2012-10-19 Thread smcoll
i'm not clear about your models: - the admin inline refers to a RunHasSample model that i don't see in your models.py - the Sample model has an FK to Sample, but looks like the run_has_sample table. Should i presume that's the RunHasSample intermediary model instead? - i don'

Re: loop user.get_profile displays none in a template

2012-10-19 Thread smcoll
i think you'd have to make a method on UserProfile that returns a dict of some of its attributes, and iterate over the result of that method in your template. That, or create a templatetag that adds it to the context. On Thursday, October 18, 2012 10:52:39 PM UTC-5, David Lee wrote: > > how ca

Re: Adding values in my database via a ManyToMany relationship represented in admin.py

2012-10-19 Thread Louise OTT
> > In [10]: run1= Run(project=Project.objects.get(pk=1), >> sequencing_type=SequencingType.objects.get(pk=1)) > > >> In [11]: run1.save() > > >> In [12]: Run.objects.all() > > Out[12]: [] > > >> In [13]: s1=RunHasSample(run=run1, sample=Sample.objects.get(pk=1), >> dna_quantification_ng_per_ul=

Re: Adding values in my database via a ManyToMany relationship represented in admin.py

2012-10-19 Thread smcoll
It's true: the Run model does not have a "lines" attribute; the RunHasSample model does. Also, `s1` is not a Line nor a Sample, it's an instance of the intermediary RunHasSample. So you're not going to be able to directly add a Line instance to a Run instance- you'll have to add it to the rel

Re: Unhandled exception during validation

2012-10-19 Thread Oyvind Idland
Sorry for the late reply ! Yes, you are correct. My point is, that something crashed somewhere, and there is no stack trace or anything that indicates what the problem is. -- Oyvind On Friday, October 12, 2012 6:00:22 PM UTC+2, Tom Evans wrote: > > On Fri, Oct 12, 2012 at 4:45 PM, Tomáš Ehrl

Re: Custom User class -> createsuperuser asks for Username twice

2012-10-19 Thread Chris Pagnutti
Right on. Thanks Russ. On Thursday, October 18, 2012 3:38:05 PM UTC-4, Chris Pagnutti wrote: > > Hi. I'm just trying out the new way to create a custom User class by > extending the AbstractBaseUser class. I essentially just copied the > AbstractUser and UserManager classes from auth.models a

Postgresql Index & expensive queries [n00bie alert]

2012-10-19 Thread Barry Morrison
I've got a pretty expensive query...Wondering if I can't speed things up in regards to Postgresql. Here is the model: [1] http://dpaste.org/JmEeQ/ Here is the sql statement: [2] http://dpaste.org/GbfAJ/ Here is the template: [3] http://dpaste.org/vxRs4/ Here is the 'guts' of the view: [4] h

Re: Postgresql Index & expensive queries [n00bie alert]

2012-10-19 Thread Sam Lai
On 20 October 2012 14:16, Barry Morrison wrote: > I've got a pretty expensive query...Wondering if I can't speed things up in > regards to Postgresql. > > Here is the model: [1] http://dpaste.org/JmEeQ/ > > Here is the sql statement: [2] http://dpaste.org/GbfAJ/ > > Here is the template: [3] http:

Re: Postgresql Index & expensive queries [n00bie alert]

2012-10-19 Thread Xavier Ordoquy
Hi, As Samuel said, the first step is to install Django Debug Toolbar to see what's going on with your queries. Then you'll probably be interested in https://docs.djangoproject.com/en/1.4/ref/models/querysets/#prefetch-related Regards, Xavier Ordoquy, Linovia. Le 20 oct. 2012 à 05:16, Barry Mo