Need help figuring out why my { key:value } doesn't seem to be passed to my view by my javascript file.

2013-09-17 Thread 7equivalents
I have a javascript file that successfully request a Django view. However it seems as if it is not passing the key:value pairs. I have created an if else statement that test for the key, and it never see's it. Not sure how to proceed. Here is my django View and Javascript click function, in the

Re: Django unittest failure

2013-09-17 Thread Ryan Boggs
I reported it. #21118. Thanks for taking a look at this. Thanks, Ryan On Monday, September 16, 2013 7:16:25 PM UTC-7, WongoBongo wrote: > > You should probably open a bug on this issue. The test suite fails for me > on MacOS/Python 2.7 on the stable/1.5.x branch. This is the command that >

Re: How do I create a standalone python application that uses the django environment (e.g. the ORM etc...)?

2013-09-17 Thread Russell Keith-Magee
Hi, Django's own documentation contains a description of how to do this: https://docs.djangoproject.com/en/1.5/topics/settings/#using-settings-without-setting-django-settings-module James Bennett has also written a blog post that gives a good rundown on approaches you can take:

Exception Value: 'Decimal' object is not callable dont no where this is coming from, Any help will be kindly appreciated

2013-09-17 Thread MAurice
class Loan(models.Model): id = models.AutoField(primary_key=True,default=1) loan_type =models.CharField(max_length=20, choices=LTYPE,default=1) def number(): no =Account.objects.count() if no == None: return

iterating over a queryset?

2013-09-17 Thread Daniel Roseman
Without the get(), you get a queryset, which is an iterable of all elements that match the query - in effect, a list of dicts. Even though only one record matches, you still get a queryset containing a single dict. So in order to use that in your template, you'd have to add an outer loop

Re: django template string and int comparison behavior

2013-09-17 Thread Bill Freeman
Yes, this is the expected behavior. The GET parameter is a string, being something that is just parsed out of the query parameter portion of the URL (which is, itself, a string). There is nothing to inform the code that parses the query parameters which of the things that might look like numbers

iterating over a queryset?

2013-09-17 Thread Johan Bergkvist
Hi I'm quite new to both django and python, and OOP for that matter. I do have some embedded programming experience though. I have a question regarding querysets and dictionaries, I think. I was trying to build a model that provides an overview for subscribed customers over their services and

django template string and int comparison behavior

2013-09-17 Thread J Y
I am building a search form that provides a drop down list, and then on the search results, I am redisplaying the search form, but with the search parameters already pre-selected, so this is what I attempted to do: {% for item in object_list %} {{ item.name }}

Re: Any API for dojo/jquery in django template language ?? For dojo i need urgently , thanks

2013-09-17 Thread Nikolas Stevenson-Molnar
I'm not sure I understand your question. You can use jQuery and/or Dojo in your Django template the same as you would anywhere else. If you want nice integration between Django forms and Dojo dijits, you might be interested in Dojango: https://github.com/klipstein/dojango/ _Nik On 9/16/2013 11:06

Re: django template string and int comparison behavior

2013-09-17 Thread Rafael Durán Castañeda
Hi, I don´t think using requests objects into templates is a good idea, use request object in the view so you source the template context with whatever you need. HTH El 17/09/2013, a las 20:50, J Y escribió: > I am building a search form that provides a drop down list,

Re: Trouble with STATIC_URL in v1.5.2

2013-09-17 Thread Adam Stein
I'm not using RequestContext(). The behavior must have changed between v1.4 and v1.5 regarding this. On Tue, 2013-09-17 at 08:27 -0700, Kelvin Wong wrote: > If your software works then I guess it works, but I just ran this in > the shell on Django 1.5.4. > > > $ python manage.py shell > Python

Re: How do I create a standalone python application that uses the django environment (e.g. the ORM etc...)?

2013-09-17 Thread Brad Pitcher
To make my code work, you could set DJANGO_SETTINGS_MODULE to 'my_project.settings', and just put formdesigner.py directly under my_project. If you wanted to keep formdesigner.py where it is, you would want to change the sys.path.append line to this:

Re: m2m_changed signal not caught

2013-09-17 Thread Roberto López López
Thanks for your advice, but that dint't solve the issue :-/ @receiver(m2m_changed, sender=News.department.through) On 09/17/2013 05:02 PM, John DeRosa wrote: > From memory, I _think_ this catches the signal from the Department > model, not the News model. To catch it when you edit the

Re: Trouble with STATIC_URL in v1.5.2

2013-09-17 Thread Kelvin Wong
If your software works then I guess it works, but I just ran this in the shell on Django 1.5.4. $ python manage.py shell Python 2.7.3 (default, May 4 2012, 11:07:18) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin Type "help", "copyright", "credits" or "license" for more information.

Re: m2m_changed signal not caught

2013-09-17 Thread John DeRosa
>From memory, I _think_ this catches the signal from the Department model, not >the News model. To catch it when you edit the relationship from a *News* model >form, you need to hook it up ("sender=News.department.through"). On Sep 17, 2013, at 3:59 AM, Roberto López López

Re: Model inheritance problem

2013-09-17 Thread George Lund
Ah okay, well I've never used that, I thought you were implying this could be a general Django question. Maybe neo4django doesn't support model inheritance -- I took a look at their site briefly and couldn't see anything about it. Sorry not to be more help... On Tuesday, 17 September 2013

Re: Recommended dev environment for a Django project deployed to Linode

2013-09-17 Thread Vernon D. Cole
Answering the other half of your question: The choice of IDE is not nearly as important as its ease of integration with your dvcs. If you are already familiar with a good one, don't change. On my present project, my boss and I are both using PyCharm, and my other co-worker is using Eclipse,

Re: Model inheritance problem

2013-09-17 Thread Antonio Mignolli
Hmm, no, it does not work even without indexed=True, my mistake. So the "issue" remains. Il giorno martedì 17 settembre 2013 16:17:04 UTC+2, Antonio Mignolli ha scritto: > > Thanks, George, but as I said in the beginning, I'm using neo4django, > which surely has StringProperty, otherwise I

Re: Model inheritance problem

2013-09-17 Thread Antonio Mignolli
Thanks, George, but as I said in the beginning, I'm using neo4django, which surely has StringProperty, otherwise I would have an AttributeError on StringProperty, which I don't have. I should have written: from neo4django.db import models and ... name = models.StringProperty(indexed=True)

Re: Recommended dev environment for a Django project deployed to Linode

2013-09-17 Thread Vernon D. Cole
I installed a client for my favourite distributed version control system on my Linode instance. I have a private repository on a public IP. (github, bitbucket, or launchpad will work, depending on your dvcs of choice -- I have used all three, and other times I have used a private dvcs host,

Re: How do I create a standalone python application that uses the django environment (e.g. the ORM etc...)?

2013-09-17 Thread DJ-Tom
I need to use the ORM and more specifcally I want to use the models I defined inside my Django application. I want to avoid using a different ORM like Alchemy because then I would have to duplicate the work I already put into my Django models - i hate duplicating work... Apart from that, I

Re: Trouble with STATIC_URL in v1.5.2

2013-09-17 Thread Adam Stein
Turns out that I had to use the new {% static %} template tag. It seems that STATIC_URL is only set in the context for template use when in DEBUG mode (didn't look in the code, but it appears that way). {% static %} works for both development and production environments. It was pretty simple

Re: Model inheritance problem

2013-09-17 Thread George Lund
> class MyBaseModel(models.NodeModel): >name=StringProperty() >class Meta: >abstract = True > > In Django you would need CharField or similar. StringProperty is a Google App Engine thing? Cf

Hosting multiple sites on a single application

2013-09-17 Thread James Zildjian
Hi I am trying to run around 50 mini sites which share about 90% of their code. Each site simply queries and API and returns the results, and will be on it's own domain, and have a different style.css and config.py. The userbase (and the database generally) will be shared across the board.

m2m_changed signal not caught

2013-09-17 Thread Roberto López López
Hi, I need to use the m2m_changed signal to assign permissions over an object. But somehow, I cannot make it work. To summarise, my models.py is as follows: from cmsplugin_news.models import News from django.contrib.auth.models import Group from django.db import models from

Re: Paginattion: How do I pass current page number around views, forms and templates?

2013-09-17 Thread Marcin Szamotulski
You can also pass it around as a GET argument. Best regards, Marcin On 02:10 Mon 16 Sep , DJ-Tom wrote: > > I think I could use the views name as the key to the current page - that > way the system "remembers" the page number for each view. > > Am Dienstag, 10. September 2013 18:59:19

Help with directory structure of the project

2013-09-17 Thread Ladislav Prokopny
Hi, I have quite big problems with having the directory structure with correct hierarchy and I decided to stop the development unless I will have it good. I have order, customers, users . So what I have is: myproj |-myproj |-web_app |---orders (with views.py, ajax.py)

Re: Trouble with STATIC_URL in v1.5.2

2013-09-17 Thread Kelvin Wong
Check that your STATIC_URL setting in your template is outputting the same string as settings.STATIC_URL. Make sure that any included local_settings.py files are not wiping out those settings. You can check it using the Django shell: $ python manage.py shell >>> from django.conf import

Re: Image Maps + Django

2013-09-17 Thread Nigel Legg
Read the documentation on GeoDjango, it's all there Cheers, Nigel 07914 740972 On 17 September 2013 09:54, +Emmanuel wrote: > I am intending to implement something similar to this: > https://opendata.go.ke/facet/counties > That has been developed in Ruby on Rails. How

Re: How to raise exception in model?

2013-09-17 Thread Ladislav Prokopny
Thanks, that solves my problem. On Mon, Sep 16, 2013 at 4:38 PM, C. Kirby wrote: > If you successfully get to render_to_response (or similar) the template > renderer will silently swallow errors. > If you want the error to stop rendering and either print an error or a 500 >

Image Maps + Django

2013-09-17 Thread +Emmanuel
I am intending to implement something similar to this: https://opendata.go.ke/facet/counties That has been developed in Ruby on Rails. How does Django handle image maps? Are there any additional Python/ Django libraries I will require? Is there a specific approach (best practices) way of

Re: How do I create a standalone python application that uses the django environment (e.g. the ORM etc...)?

2013-09-17 Thread DJ-Tom
Hi, I'm also not sure if the python file is at the correct location. This is how the directory structure looks: my_project \my_project\ settings.py \my_app\ # this is where my models are defined models.py formdesigner.py Where should my formdesigner.py be

Re: Trouble with STATIC_URL in v1.5.2

2013-09-17 Thread Mike Dewhirst
On 17/09/2013 3:49pm, Jacky Tian wrote: I think the standard way of including static files in templates in 1.5+ is through the staticfiles app . In particular, look at the documentation on the {% static %} template tag. Depending

Any API for dojo/jquery in django template language ?? For dojo i need urgently , thanks

2013-09-17 Thread bab mis
-- 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 email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com.