Re: MySQL queries-connection to django

2015-10-28 Thread Mike Dewhirst
On 29/10/2015 7:00 AM, Sid wrote: I am new to DJANGO... You can connect to your database using Django but first Django needs to have a model of each table in your database so it knows what to look for. https://docs.djangoproject.com/en/1.8/howto/legacy-databases/ There is a management comma

MySQL queries-connection to django

2015-10-28 Thread Sid
I am new to DJANGO... so i have installed django,python and using Visual studio as interface, so my question is I have database name :*siddharth* in sql server: *63-W7-MJ021R04\ALMDATA* i want to connect my database(siddharth) to django using settings.py, But i am not understanding how to do it

Re: Locking / serializing access to one element in database

2015-10-28 Thread Carsten Fuchs
Hi Collin, hi all, Am 27.10.2015 um 19:56 schrieb Collin Anderson: Yes, an exception will be raised. Thinking further about this, all we need is a method that gives us an exception if we accidentally create a second object when in fact only one is wanted. Your suggestion with manually dealin

Running a live Django site

2015-10-28 Thread JJ Zolper
All, In an effort to continue to push the Django community towards a point where we provide our developers with more information on how to run a live Django site, I would like to again share the High Performance Django Videos Kickstarter: https://www.kickstarter.com/projects/1704706557/high-pe

Re: Django Models Joining and Normalising

2015-10-28 Thread Collin Anderson
Hello, I'd personally keep it all in one model for as long as possible. It will really simplify queries and it should make your code a lot cleaner. Wait til you have some actual performance problems before splitting the models up. Collin On Wednesday, October 14, 2015 at 12:11:55 PM UTC-4, Yu

Re: Flakey tests and django.db.utils.InterfaceError: connection already closed

2015-10-28 Thread Collin Anderson
Hello, Here are some questions that might help debugging this: Do other tests that use the database run ok? If you run _only_ this test, is it still a problem? Are you using threads at all? Is there an exception that's being silenced somewhere else? Collin On Tuesday, October 27, 2015 at 9:

Re: Polymorphic class and geomodels?

2015-10-28 Thread Collin Anderson
Hello, Are you trying to combine multiple models into one, like this? class PolyModel(pdmpunto, pdmtransetto, pdmarea): pass You could also try asking on the geodjango list: http://groups.google.com/group/geodjango Collin On Monday, October 26, 2015 at 7:18:24 AM UTC-4, Luca Moiana wrote:

Re: Running migrations on the non-default database fails

2015-10-28 Thread Tim Graham
I think this bit from the Django 1.8 release notes might help: * The migration operations RunPython and RunSQL

Re: Wherenode?

2015-10-28 Thread Tim Graham
GitHub has a nice feature that allows you to search a repository: https://github.com/django/django/search?utf8=%E2%9C%93&q=WhereNode On Wednesday, October 28, 2015 at 1:32:40 PM UTC-4, varun naganathan wrote: > > Can anybody please explain what a django WhereNode is? Also provide any > possible

Wherenode?

2015-10-28 Thread varun naganathan
Can anybody please explain what a django WhereNode is? Also provide any possible references/docs if available including its implementation in the source code! Thanks. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this gro

Running migrations on the non-default database fails

2015-10-28 Thread Gergely Polonkai
Hello, I have an application which, due to low usage, used SQLite in production. Now the demand has risen for the app, and SQLite can't really keep up with with all the new users. We decided to move to PostgreSQL. The DB is now up and running, but to cause as short downtime as possible, I added a

Re: include template which extends something else

2015-10-28 Thread Sven Wanner
Oh man sorry, there was something wrong with finding the template but many thanks for your advices. It helped me a lot even if the problem was blindness. But anyway, I am happy now. Best regards to you 2015-10-28 17:25 GMT+01:00 Sven Wanner : > Yes, sorry I was confused... No I don't get what yo

Re: include template which extends something else

2015-10-28 Thread Carl Meyer
On 10/28/2015 10:25 AM, Sven Wanner wrote: > Yes, sorry I was confused... No I don't get what you mean. I think thats > exactly what I tried to do. > > I have kind of a main.html doing that: > > {% block my-wall %} > > > {% for obj in objects %} > > {% include 'wall_item.h

Re: include template which extends something else

2015-10-28 Thread Sven Wanner
Yes, sorry I was confused... No I don't get what you mean. I think thats exactly what I tried to do. I have kind of a main.html doing that: {% block my-wall %} {% for obj in objects %} {% include 'wall_item.html' with object=obj %}

Re: include template which extends something else

2015-10-28 Thread Carl Meyer
On 10/28/2015 10:11 AM, Sven Wanner wrote: > Ok, it's a pitty, but you're totally right. Using if in my template > should be also fine. Not of that elegance I planned ;) , but will > definitely work, too. I'm not sure what you mean. I thought I just explained how you can use `extends` in an inclu

Re: Missing default callable breaks migration

2015-10-28 Thread Simon Charette
I would add that since migration files are normal Python modules you can simply replace the previously imported callable in the referencing migrations by inlining it. Simon Le mercredi 28 octobre 2015 11:33:28 UTC-4, Tim Graham a écrit : > > Please read > https://docs.djangoproject.com/en/stab

Re: include template which extends something else

2015-10-28 Thread Sven Wanner
Ok, it's a pitty, but you're totally right. Using if in my template should be also fine. Not of that elegance I planned ;) , but will definitely work, too. Thank you 2015-10-28 17:04 GMT+01:00 Carl Meyer : > Hi Sven, > > On 10/28/2015 09:50 AM, Sven Wanner wrote: > > Thanks for your quick reply

Re: include template which extends something else

2015-10-28 Thread Carl Meyer
Hi Sven, On 10/28/2015 09:50 AM, Sven Wanner wrote: > Thanks for your quick reply. Yes, this is also what I found, so I was > quite shure that my code will never work. What I try to do is to render > a list of database objects. But not only on one page but on different > pages and with slightly di

Re: include template which extends something else

2015-10-28 Thread Tim Graham
I don't think you can structure your templates that way. Maybe using {% if %} tags in your included template would be enough (instead of using {% extends %}). On Wednesday, October 28, 2015 at 11:51:12 AM UTC-4, svewa wrote: > > Thanks for your quick reply. Yes, this is also what I found, so I w

Re: include template which extends something else

2015-10-28 Thread Sven Wanner
Thanks for your quick reply. Yes, this is also what I found, so I was quite shure that my code will never work. What I try to do is to render a list of database objects. But not only on one page but on different pages and with slightly different designs in each of the lists. So my plan was, to avoi

Re: How to create a global management command?

2015-10-28 Thread Scot Hacker
Right - even though a management command must live inside of an app, all of them work "globally" across the project. I often include an app called "base" in my projects for just this purpose - it includes management commands and utility functions that don't belong logically to any other app.

Re: Missing default callable breaks migration

2015-10-28 Thread Tim Graham
Please read https://docs.djangoproject.com/en/stable/topics/migrations/#historical-models In particular, "References to functions in field options such as upload_to and limit_choices_to and model manager declarations with managers having use_in_migrations = True are serialized in migrations, so

Re: include template which extends something else

2015-10-28 Thread Tim Graham
I think that's a limitation described in the {% include %} docs: https://docs.djangoproject.com/en/1.8/ref/templates/builtins/#include. See the "Note" box where it says: The include tag should be considere

include template which extends something else

2015-10-28 Thread svewa
Hi all, sorry if it might be a stupid question for pro's but it seems I still miss a deeper knowledge of some design aspects. What I try to do is the following: {% for obj in objects %} {% include 'item.html' with object=obj %} {% endfor %} this I need to to in

Missing default callable breaks migration

2015-10-28 Thread Richard Buck
If I try to change the default on a model field from one callable to another, the migration will fail if the old callable is no longer available. It appears this is because the migration system tries to call the old callable to determine if it returns a different value from the new. I don't th

Re: IntComma without RequestContext

2015-10-28 Thread Michael Newman
Thank you. Knew I was missing something easy. On Tuesday, October 27, 2015 at 8:54:08 PM UTC-4, foobar wrote: > > Your language string is backwards: > > >>> activate("en-us") > >>> intcomma(1000) > '1,000' > > >>> activate("en") > >>> intcomma(1000) > '1,000' > > > use_l10n=False in a tem

Re: Test problems after upgrading to 1.8

2015-10-28 Thread o_r
I removed the table auth_message from my database, I tried to run it once more, and then I got a new similar message, so I removed that table too, and now it works again. I still don't understand why I suddenly got this error, but it's working again, so I'm happy :) onsdag 28. oktober 2015 09.1

Re: [django_tables2] Expected table or queryset, not 'str'.

2015-10-28 Thread Leutrim Osmani
Can you please tell me how did you fixed this error ? On Monday, April 29, 2013 at 9:21:29 AM UTC+2, binith a k wrote: > > You were correct, it was indeed a version problem. > I was using latest django-tables2 in my new python virtual env and I had > an older version (of django-tables2) installed

Re: Test problems after upgrading to 1.8

2015-10-28 Thread Tim Graham
It seems a bit difficult to debug from what you provided so far. One idea: do you have migrations for all your apps? If you could put together a minimal project that reproduces the problem that would be useful. On Wednesday, October 28, 2015 at 4:19:25 AM UTC-4, o_r wrote: > > I've recently upg

Test problems after upgrading to 1.8

2015-10-28 Thread o_r
I've recently upgraded from 1.3 to 1.8. I have a rather large testsuite, and by the end of the upgrade all the tests passed. Now I've added some new models, and made the new migration, and it seemed to work as expected, but when I try to run my tests again now, I get an error message like this: