Re: Trouble with Django Tutorial Part 2

2015-12-09 Thread Mario Gudelj
Did you mix up https://docs.djangoproject.com/en/1.8/intro/tutorial01/ and
https://docs.djangoproject.com/en/1.9/intro/tutorial01/? 1.9 has apps.py
inside polls directory and 1.8 tutorial doesn't. So, I think you have
INSTALLED_APPS setting from 1.9 tutorial inside 1.8.7 project...

On Thu, 10 Dec 2015 at 15:04 Ana Ng  wrote:

> I'm new to programming in general and am learning Django 1.8.7 for a new
> job. The polls tutorial on the official site was recommended, and
> everything goes smoothly until I attempt to migrate the new classes created
> in part 1.
>
> When asked to migrate the classes with *python manage.py makemigrations
> polls*, I get "ImportError: No module named polls.apps".
>
> I am fairly certain that I am following the tutorial properly, has anyone
> else had this issue?
>
> --
> 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.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6670d9c2-76ec-4163-b180-fa977a985834%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHqTbjmdTbq-ofq41dQi8AnpVuWJkAnZHM2Jx-cAeTE7xCo0Tw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Trouble with Django Tutorial Part 2

2015-12-09 Thread Ana Ng
I'm new to programming in general and am learning Django 1.8.7 for a new 
job. The polls tutorial on the official site was recommended, and 
everything goes smoothly until I attempt to migrate the new classes created 
in part 1.

When asked to migrate the classes with *python manage.py makemigrations 
polls*, I get "ImportError: No module named polls.apps".

I am fairly certain that I am following the tutorial properly, has anyone 
else had this issue?

-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6670d9c2-76ec-4163-b180-fa977a985834%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: i just tried django with microsft visual studio

2015-12-09 Thread Dheerendra Rathor
Pass view in url as url(r'^$', app.views.home, name='home'), URL with
string view has been deprecated.

On Thu, 10 Dec 2015 at 03:31 Emmanuel Olodun 
wrote:

> hello
> i just tried django with visual studio, on performing migration i got this
> error report can some please help out? dont know how to get around it..
>
> "c:\users\lenovo\documents\visual studio
> 2015\Projects\databasefun\databasefun>py
> thon manage.py makemigrations --name initia app
> c:\users\lenovo\documents\visual studio
> 2015\Projects\databasefun\databasefun\da
> tabasefun\urls.py:16: RemovedInDjango110Warning: Support for string view
> argumen
> ts to url() is deprecated and will be removed in Django 1.10 (got
> app.views.home
> ). Pass the callable instead.
>   url(r'^$', 'app.views.home', name='home'),"
>
> --
> 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.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/01c6b1bc-d1fa-4f9b-9542-d96414b8affb%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAByqUgiQLZpV9KzQzrMMLa1xMvSwTL%3Dxr_20u1%3D5AG%3Db_EYytQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: What am I supposed to do if I want a Wizard?

2015-12-09 Thread Kristofer Pettijohn
If you just want something simple, stick with Form Wizard. If it doesn't do 
something you need, see if you can extend it by creating a new class and 
overriding methods that you need to change. Otherwise if you need more 
functionality, I would roll your own. 


From: "Martín Torre Castro"  
To: django-users@googlegroups.com 
Sent: Wednesday, December 9, 2015 4:30:08 PM 
Subject: Re: What am I supposed to do if I want a Wizard? 



Thank you, Kristofer. It's interesting. I'm looking right now. 

It seems complex, but I will investigate, although I would prefer a more 
generic way of doing this, because I suspect I will be using many wizards soon. 

Any other suggestions? 
El 9 dic. 2015 10:56 p. m., "Kristofer Pettijohn" < kristo...@cybernetik.net > 
escribió: 



I sdid my own form wizard for a project I worked on. For a good example, you 
can look at Oscar Ecommerce in github, and look at their checkout app within 
the code. That may inspire you with some ideas on how to implement such a 
behavior. 


From: "Martin Torre Castro" < mad...@gmail.com > 
To: "Django users" < django-users@googlegroups.com > 
Sent: Wednesday, December 9, 2015 5:10:14 AM 
Subject: What am I supposed to do if I want a Wizard? 

Hello, 
I was investigating about form wizards in Django, but I have seen that recently 
this has changed in the deprecation timeline doc: 

" The form wizard has been refactored to use class-based views with pluggable 
backends in 1.4. The previous implementation will be removed. " 

I understand that the old form wizard is now part of the form-tools package and 
I must install it if I want to use it. 

My question is if I should do it or maybe I should "use class based-views with 
pluggable backends", which I'm not sure of what means and sounds like doing all 
the classes and boilerplate for doing wizards all again on my own. 


Please, could someone give me some advice. If I go with class based views, 
could someone pass me a link where I can find some example with a form wizard 
made in such way. 


Thank you very much in advanced. 


-- 
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 . 
Visit this group at http://groups.google.com/group/django-users . 
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ac8fecc6-baed-4b40-8f71-bfdc17a69ee7%40googlegroups.com
 . 
For more options, visit https://groups.google.com/d/optout . 


-- 
You received this message because you are subscribed to a topic in the Google 
Groups "Django users" group. 
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/django-users/_8_lqJsiqkc/unsubscribe . 
To unsubscribe from this group and all its topics, send an email to 
django-users+unsubscr...@googlegroups.com . 
To post to this group, send email to django-users@googlegroups.com . 
Visit this group at http://groups.google.com/group/django-users . 
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2461989.1453939.1449698183679.JavaMail.zimbra%40cybernetik.net
 . 
For more options, visit https://groups.google.com/d/optout . 





-- 
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 . 
Visit this group at http://groups.google.com/group/django-users . 
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKijOkywv9kv7nwbV8WQbL54%3Dv26ZYvEagwL78VRt62Wyn%2BztQ%40mail.gmail.com
 . 
For more options, visit https://groups.google.com/d/optout . 

-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/492204851.1488973.1449712361553.JavaMail.zimbra%40cybernetik.net.
For more options, visit https://groups.google.com/d/optout.


Re: What will be the replacement for .extra()?

2015-12-09 Thread Russell Keith-Magee
Hi Luis,

On Thu, Dec 10, 2015 at 7:10 AM, Luis Masuelli 
wrote:

> When I see the docs (
> https://docs.djangoproject.com/en/1.8/ref/models/querysets/#extra), I
> notice .extra will be deprecated and removed. Is there a plan for the
> replacement? As I see it, limiting ourselves to using Manager.raw() is not
> a good idea, since you cannot work anymore on a RawQueryset object (as you
> can work on any Queryset object you called .extra). So my question is: Is
> there a good replacement for .extra being planned?
>

Yes - the Query Expression API.

https://docs.djangoproject.com/en/1.9/ref/models/expressions/

Yours,
Russ Magee %-)

-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJxq848Ursc-kig_d3V6pT47612d%2B%2B9APB1e%3DRYf%3DSf4-JFT1w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


What will be the replacement for .extra()?

2015-12-09 Thread Luis Masuelli
When I see the docs 
(https://docs.djangoproject.com/en/1.8/ref/models/querysets/#extra), I 
notice .extra will be deprecated and removed. Is there a plan for the 
replacement? As I see it, limiting ourselves to using Manager.raw() is not 
a good idea, since you cannot work anymore on a RawQueryset object (as you 
can work on any Queryset object you called .extra). So my question is: Is 
there a good replacement for .extra being planned?


-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1dcefbb5-8c8d-492f-a057-aa47a9469a18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple databases in Django 1.7

2015-12-09 Thread Łukasz Pauszek
Hey,
thank you for fast response.
Yes, I'm aware that allow_migrate format from the one mentioned in link you 
provided because (as is mentioned in title) I'm using 
Django 1.7 and the code I provided is almost copy/paste of what you can 
find under the same link but for v. 1.7
Things I changed in code are data base name and _meta.app_label

W dniu środa, 9 grudnia 2015 22:35:58 UTC+1 użytkownik learn django napisał:
>
> Hi LP.
>
> Your allow_migrate function differs in the format from what is mentioned 
> in the link below.
>
> https://docs.djangoproject.com/en/dev/topics/db/multi-db/#topics-db-multi-db-routing
>
> I have tried this last week and it works fine.
>
> On Wednesday, December 9, 2015 at 2:47:42 AM UTC-8, Łukasz Pauszek wrote:
>>
>> Hello,
>> I'm trying to configure project in Django 1.7 to use multiple databases, 
>> for now I'm following official documentation to configure 2 dbs. 
>> Problem is that when I run: ./manage.py makemigrations myapp only changes 
>> in default database are detected. And ./manage.py migrate 
>> --database=main_db doesn't see model which should be created in it. 
>> What should I do to update second database?
>> Below I'm pasting code which I think may be relevant:
>>
>> project/settings.py
>> DATABASES = {
>> 'default': {
>> 'ENGINE': 'django.db.backends.sqlite3',
>> 'NAME': os.path.join(BASE_DIR, 'default.sqlite3'),
>> },
>> 'main_db': {
>> 'ENGINE': 'django.db.backends.sqlite3',
>> 'NAME': os.path.join(BASE_DIR, 'main_db.sqlite3')
>> }
>> }
>>
>> DATABASE_ROUTERS = ['myapp.routers.SelectDatabaseRouter']
>>
>> myapp/models.py
>> class TestingDefaultDatabase(models.Model):
>>
>> class Meta:
>> verbose_name = "TestingDefaultDatabase"
>> verbose_name_plural = "TestingDefaultDatabases"
>>
>> name = models.CharField(max_length=50)
>> surname = models.CharField(max_length=50)
>>
>>
>> class TestingMainDatabase(models.Model):
>>
>> class Meta:
>> verbose_name = "TestingMainDatabase"
>> verbose_name_plural = "TestingMainDatabases"
>> app_label = 'main'
>>
>> name = models.CharField(max_length=50)
>> surname = models.CharField(max_length=50)
>>
>> myapp/routers.py
>> class SelectDatabaseRouter(object):
>> def db_for_read(self, model, **hints):
>> if model._meta.app_label == 'main':
>> return 'main_db'
>> return None
>>
>> def db_for_write(self, model, **hints):
>> if model._meta.app_label == 'main':
>> return 'main_db'
>> return None
>>
>> def allow_relation(self, obj1, obj2, **hints):
>> if obj1._meta.app_label == 'main' or \
>> obj2._meta.app_label == 'main':
>> return True
>> return None
>>
>> def allow_migrate(self, db, model):
>> if db == 'main_db':
>> return model._meta.app_label == 'main'
>> elif model._meta.app_label == 'main':
>> return False
>> return None
>>
>> Am I missing or incorrectly configured something? Or perhaps I'm not 
>> using appropriate commands?
>> Thank you for help.
>> ŁP
>>
>

-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a57a9b99-e185-4751-9f73-910198473caa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: What am I supposed to do if I want a Wizard?

2015-12-09 Thread Martín Torre Castro
Thank you, Kristofer. It's interesting. I'm looking right now.

It seems complex, but I will investigate, although I would prefer a more
generic way of doing this, because I suspect I will be using many wizards
soon.

Any other suggestions?
El 9 dic. 2015 10:56 p. m., "Kristofer Pettijohn" 
escribió:

> I sdid my own form wizard for a project I worked on.  For a good example,
> you can look at Oscar Ecommerce in github, and look at their checkout app
> within the code.  That may inspire you with some ideas on how to implement
> such a behavior.
>
> --
> *From: *"Martin Torre Castro" 
> *To: *"Django users" 
> *Sent: *Wednesday, December 9, 2015 5:10:14 AM
> *Subject: *What am I supposed to do if I want a Wizard?
>
> Hello,
> I was investigating about form wizards in Django, but I have seen that
> recently this has changed in the deprecation timeline doc:
>
> "The form wizard has been refactored to use class-based views with
> pluggable backends in 1.4. The previous implementation will be removed."
>
> I understand that the old form wizard is now part of the form-tools
> package and I must install it if I want to use it.
>
> My question is if I should do it or maybe I should "use class based-views
> with pluggable backends", which I'm not sure of what means and sounds like
> doing all the classes and boilerplate for doing wizards all again on my own.
>
>
> Please, could someone give me some advice. If I go with class based views,
> could someone pass me a link where I can find some example with a form
> wizard made in such way.
>
>
> Thank you very much in advanced.
>
> --
> 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.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/ac8fecc6-baed-4b40-8f71-bfdc17a69ee7%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/_8_lqJsiqkc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2461989.1453939.1449698183679.JavaMail.zimbra%40cybernetik.net
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKijOkywv9kv7nwbV8WQbL54%3Dv26ZYvEagwL78VRt62Wyn%2BztQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


i just tried django with microsft visual studio

2015-12-09 Thread Emmanuel Olodun
hello 
i just tried django with visual studio, on performing migration i got this 
error report can some please help out? dont know how to get around it..

"c:\users\lenovo\documents\visual studio 
2015\Projects\databasefun\databasefun>py
thon manage.py makemigrations --name initia app
c:\users\lenovo\documents\visual studio 
2015\Projects\databasefun\databasefun\da
tabasefun\urls.py:16: RemovedInDjango110Warning: Support for string view 
argumen
ts to url() is deprecated and will be removed in Django 1.10 (got 
app.views.home
). Pass the callable instead.
  url(r'^$', 'app.views.home', name='home')," 

-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/01c6b1bc-d1fa-4f9b-9542-d96414b8affb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: What am I supposed to do if I want a Wizard?

2015-12-09 Thread Kristofer Pettijohn
I sdid my own form wizard for a project I worked on. For a good example, you 
can look at Oscar Ecommerce in github, and look at their checkout app within 
the code. That may inspire you with some ideas on how to implement such a 
behavior. 


From: "Martin Torre Castro"  
To: "Django users"  
Sent: Wednesday, December 9, 2015 5:10:14 AM 
Subject: What am I supposed to do if I want a Wizard? 

Hello, 
I was investigating about form wizards in Django, but I have seen that recently 
this has changed in the deprecation timeline doc: 

" The form wizard has been refactored to use class-based views with pluggable 
backends in 1.4. The previous implementation will be removed. " 

I understand that the old form wizard is now part of the form-tools package and 
I must install it if I want to use it. 

My question is if I should do it or maybe I should "use class based-views with 
pluggable backends", which I'm not sure of what means and sounds like doing all 
the classes and boilerplate for doing wizards all again on my own. 


Please, could someone give me some advice. If I go with class based views, 
could someone pass me a link where I can find some example with a form wizard 
made in such way. 


Thank you very much in advanced. 


-- 
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 . 
Visit this group at http://groups.google.com/group/django-users . 
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ac8fecc6-baed-4b40-8f71-bfdc17a69ee7%40googlegroups.com
 . 
For more options, visit https://groups.google.com/d/optout . 

-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2461989.1453939.1449698183679.JavaMail.zimbra%40cybernetik.net.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple databases in Django 1.7

2015-12-09 Thread learn django
Hi LP.

Your allow_migrate function differs in the format from what is mentioned in 
the link below.
https://docs.djangoproject.com/en/dev/topics/db/multi-db/#topics-db-multi-db-routing

I have tried this last week and it works fine.

On Wednesday, December 9, 2015 at 2:47:42 AM UTC-8, Łukasz Pauszek wrote:
>
> Hello,
> I'm trying to configure project in Django 1.7 to use multiple databases, 
> for now I'm following official documentation to configure 2 dbs. 
> Problem is that when I run: ./manage.py makemigrations myapp only changes 
> in default database are detected. And ./manage.py migrate 
> --database=main_db doesn't see model which should be created in it. 
> What should I do to update second database?
> Below I'm pasting code which I think may be relevant:
>
> project/settings.py
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.sqlite3',
> 'NAME': os.path.join(BASE_DIR, 'default.sqlite3'),
> },
> 'main_db': {
> 'ENGINE': 'django.db.backends.sqlite3',
> 'NAME': os.path.join(BASE_DIR, 'main_db.sqlite3')
> }
> }
>
> DATABASE_ROUTERS = ['myapp.routers.SelectDatabaseRouter']
>
> myapp/models.py
> class TestingDefaultDatabase(models.Model):
>
> class Meta:
> verbose_name = "TestingDefaultDatabase"
> verbose_name_plural = "TestingDefaultDatabases"
>
> name = models.CharField(max_length=50)
> surname = models.CharField(max_length=50)
>
>
> class TestingMainDatabase(models.Model):
>
> class Meta:
> verbose_name = "TestingMainDatabase"
> verbose_name_plural = "TestingMainDatabases"
> app_label = 'main'
>
> name = models.CharField(max_length=50)
> surname = models.CharField(max_length=50)
>
> myapp/routers.py
> class SelectDatabaseRouter(object):
> def db_for_read(self, model, **hints):
> if model._meta.app_label == 'main':
> return 'main_db'
> return None
>
> def db_for_write(self, model, **hints):
> if model._meta.app_label == 'main':
> return 'main_db'
> return None
>
> def allow_relation(self, obj1, obj2, **hints):
> if obj1._meta.app_label == 'main' or \
> obj2._meta.app_label == 'main':
> return True
> return None
>
> def allow_migrate(self, db, model):
> if db == 'main_db':
> return model._meta.app_label == 'main'
> elif model._meta.app_label == 'main':
> return False
> return None
>
> Am I missing or incorrectly configured something? Or perhaps I'm not using 
> appropriate commands?
> Thank you for help.
> ŁP
>

-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a89f9477-2241-4fd4-8506-283602693953%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use Django for data scrapping

2015-12-09 Thread Ezequiel Bertti
You already try Scrapy?

http://doc.scrapy.org/

They have some integration with django models to help.

http://doc.scrapy.org/en/0.24/topics/djangoitem.html

On Wed, Dec 9, 2015 at 5:16 PM, Algo Basket  wrote:

> I want some script to scrap  via Django
>
> --
> 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.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/abf8e30b-ef19-4a9e-adf9-646033fa7068%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Ezequiel Bertti
E-Mail: eber...@gmail.com
Cel: (21) 99188-4860

-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACrQMYoZqtC0rcS2cNDVdfNL9sjZGS78v-DCrxWaj5EvnQD9UA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tests not passing in suite but pass individually

2015-12-09 Thread learn django
After making following change & pointing router to 'default' database test 
case is passing.

'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': 'postgres',
'NAME': '*mydb*',
'PASSWORD':'0212',
'HOST':'localhost',
'PORT':'',
'TEST': {
   'NAME': '*mytestdb*',
},
},

However if I make router to point to app specific db which is defined as 
follows,
the test case still fails. I think its better not to keep on modifying the 
router.

Is there anything wrong with the app database definition below.

'orca': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': '*orcadb*',
'USER':'postgres',
'PASSWORD':'0212',
'HOST':'localhost',
'PORT':'',
'TEST': {
   'NAME': '*orcatestdb*',
},
}


On Wednesday, December 9, 2015 at 4:44:14 AM UTC-8, Tim Graham wrote:
>
> It seems a bit suspicious that you're using the same database name for 
> ['default']['NAME'] and ['default']['TEST']['NAME'] -- is that intentional?
>
> On Tuesday, December 8, 2015 at 8:30:05 PM UTC-5, learn django wrote:
>>
>> Hi Tim,
>>
>> My test case was working with new app in new project which was
>> using default database.
>>
>> DATABASES = {
>> 'default': {
>> 'ENGINE': 'django.db.backends.sqlite3',
>> 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
>> }
>> }
>>
>> So I went back to my old app and debugged a bit.
>> If I make following changes in Database dictionary (commenting the bolded 
>> test) and
>> make my router for this app to point to default database the tests pass.
>> Is it because am using postgres that this issue is seen ?
>>
>> DATABASES = {
>> 'default': {
>>   *  'ENGINE': 'django.db.backends.sqlite3',*
>> *'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),*
>> *#'ENGINE': 'django.db.backends.postgresql_psycopg2',*
>> *#'USER': 'postgres',*
>> *#'NAME': 'testdb',*
>> *# 'PASSWORD':'v1ptela0212',*
>> *# 'HOST':'localhost',*
>> *# 'PORT':'',*
>> *#'TEST': {*
>> *#'NAME': 'testdb',*
>> *#},*
>> },
>> 'sztp': {
>> 'ENGINE': 'django.db.backends.postgresql_psycopg2',
>> 'NAME': 'sztpdb',
>> 'USER':'postgres',
>> },
>> 'orca': {
>> 'ENGINE': 'django.db.backends.postgresql_psycopg2',
>> 'NAME': 'orcadb',
>> 'USER':'postgres',
>> }
>> }
>>
>>
>> On Wednesday, December 2, 2015 at 4:18:25 PM UTC-8, learn django wrote:
>>>
>>> Will try to send minimal project by end of the day.
>>> Hopefully I can discover the reason during this exercise.
>>>
>>> On Wednesday, December 2, 2015 at 3:33:30 PM UTC-8, Tim Graham wrote:

 It looks correct. I'd like a minimal project I could download to 
 reproduce the issue. In putting that together, you might discover the 
 reason for the failure.

 On Wednesday, December 2, 2015 at 6:29:07 PM UTC-5, learn django wrote:
>
> Below is the test file & logs.
> No matter in which order (using --reverse) I run the suite it fails.
> The database backend is postgres. Is that an issue ?
>
> File:-
> ===
> import datetime
> import pdb
>
> from rest_framework import status
> from rest_framework.test import APIClient
>
> from django.http import HttpRequest
> from django.contrib.auth.models import User
> from django.utils import timezone
> from django.test import TestCase
>
> from orca.models import *
>
> import orca.handlers.customer_handler as ch
>
> # Create your tests here.
> class OrcaTestCase(TestCase):
>
> def test_customer_create_modify_delete(self):
> '''Test customer object create, modify and delete operations 
> in  DB.'''
> # Create.
> CustomerDb.objects.create(c_name='Zoo', c_role='Admin',
>   c_date_created=timezone.now(),
>   c_date_updated=timezone.now())
> customer_list = CustomerDb.objects.all()
> self.assertEqual(len(customer_list), 1)
>
> def test_launch(self):
> '''Test launch.'''
> CustomerDb.objects.create(c_name='Foo', c_role='Admin',
>   c_date_created=timezone.now(),
>   c_date_updated=timezone.now())
> customer_list = CustomerDb.objects.all()
> self.assertEqual(len(customer_list), 1)
>
>
> Logs:-
> 
> ==
> FAIL: test_customer_create_modify_delete (orca.tests.tmp.OrcaTestCase)
> Test customer object create, modify and delete operations in  DB.

How to use Django for data scrapping

2015-12-09 Thread Algo Basket
I want some script to scrap  via Django

-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/abf8e30b-ef19-4a9e-adf9-646033fa7068%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add myself as a developer for hire in the wiki?

2015-12-09 Thread Larry Martell
On Wed, Dec 9, 2015 at 7:41 AM, Tim Graham  wrote:
> You can login using a Trac or GitHub account, then click "Edit this page" at
> the bottom of the page.
>
> On Wednesday, December 9, 2015 at 5:47:42 AM UTC-5, James Lin wrote:

A lot of links on that page are bad, and give a 404.

-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACwCsY6ytZtg%2BTvbBsikFF1ipPK48qD%2BGsBY_vdg9trByCXiig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django for Data Tables to group by when coloumn hidden

2015-12-09 Thread Sid
 

*Question:* I have a Data table displaying on django , but now I like to 
group by when ever I will hide the column.


*column1 column2 column3*

AAACAD25

AAAUSD12

BBBCAD13

BBBUSD16

CCCCAD11

CCCUSD18


The above table will be displayed on web page using Django, now when ever I 
hide *column2* It should group by and display like below table.


*column1* *column3*

AAA  37

BBB  29

CCC  39


when ever I unhide it again it should display same as first table again.

*can anyone tell me there is any possible way to do it.*


Thanks in advance.

-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a72d7fc7-457b-44e6-853f-921f16cd8f5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: get all current active connected users

2015-12-09 Thread Jon Ribbens
On Wednesday, 9 December 2015 12:55:22 UTC, Jani Tiainen wrote:
>
> This is really problematic domain since as you know, Django works on HTTP 
> request-response cycle. After cycle is finished there is absolutely no way 
> to know "who is logged on".
>
> So first you have to determine factors that make up "currently active 
> user". Then you have to track that information somehow and after that it's 
> possible to gather a list of active/inactive users.
>

Users have a last_login field so you could easily say "users who have 
logged in in the last 24 hours" or whatever. 

-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7c5f0620-c094-4667-b474-82a23f432fa1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: get all current active connected users

2015-12-09 Thread Jani Tiainen

Hi,

This is really problematic domain since as you know, Django works on 
HTTP request-response cycle. After cycle is finished there is absolutely 
no way to know "who is logged on".


So first you have to determine factors that make up "currently active 
user". Then you have to track that information somehow and after that 
it's possible to gather a list of active/inactive users.


On 09.12.2015 14:43, Fabio C. Barrionuevo da Luz wrote:

hello,
Django provide any API for get all users who are currently connected?

I need to run some scheduled tasks for users who are not connected and 
did not understand how I can get the users with active login via Session





--
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5668248D.2070501%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tests not passing in suite but pass individually

2015-12-09 Thread Tim Graham
It seems a bit suspicious that you're using the same database name for 
['default']['NAME'] and ['default']['TEST']['NAME'] -- is that intentional?

On Tuesday, December 8, 2015 at 8:30:05 PM UTC-5, learn django wrote:
>
> Hi Tim,
>
> My test case was working with new app in new project which was
> using default database.
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.sqlite3',
> 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
> }
> }
>
> So I went back to my old app and debugged a bit.
> If I make following changes in Database dictionary (commenting the bolded 
> test) and
> make my router for this app to point to default database the tests pass.
> Is it because am using postgres that this issue is seen ?
>
> DATABASES = {
> 'default': {
>   *  'ENGINE': 'django.db.backends.sqlite3',*
> *'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),*
> *#'ENGINE': 'django.db.backends.postgresql_psycopg2',*
> *#'USER': 'postgres',*
> *#'NAME': 'testdb',*
> *# 'PASSWORD':'v1ptela0212',*
> *# 'HOST':'localhost',*
> *# 'PORT':'',*
> *#'TEST': {*
> *#'NAME': 'testdb',*
> *#},*
> },
> 'sztp': {
> 'ENGINE': 'django.db.backends.postgresql_psycopg2',
> 'NAME': 'sztpdb',
> 'USER':'postgres',
> },
> 'orca': {
> 'ENGINE': 'django.db.backends.postgresql_psycopg2',
> 'NAME': 'orcadb',
> 'USER':'postgres',
> }
> }
>
>
> On Wednesday, December 2, 2015 at 4:18:25 PM UTC-8, learn django wrote:
>>
>> Will try to send minimal project by end of the day.
>> Hopefully I can discover the reason during this exercise.
>>
>> On Wednesday, December 2, 2015 at 3:33:30 PM UTC-8, Tim Graham wrote:
>>>
>>> It looks correct. I'd like a minimal project I could download to 
>>> reproduce the issue. In putting that together, you might discover the 
>>> reason for the failure.
>>>
>>> On Wednesday, December 2, 2015 at 6:29:07 PM UTC-5, learn django wrote:

 Below is the test file & logs.
 No matter in which order (using --reverse) I run the suite it fails.
 The database backend is postgres. Is that an issue ?

 File:-
 ===
 import datetime
 import pdb

 from rest_framework import status
 from rest_framework.test import APIClient

 from django.http import HttpRequest
 from django.contrib.auth.models import User
 from django.utils import timezone
 from django.test import TestCase

 from orca.models import *

 import orca.handlers.customer_handler as ch

 # Create your tests here.
 class OrcaTestCase(TestCase):

 def test_customer_create_modify_delete(self):
 '''Test customer object create, modify and delete operations in 
  DB.'''
 # Create.
 CustomerDb.objects.create(c_name='Zoo', c_role='Admin',
   c_date_created=timezone.now(),
   c_date_updated=timezone.now())
 customer_list = CustomerDb.objects.all()
 self.assertEqual(len(customer_list), 1)

 def test_launch(self):
 '''Test launch.'''
 CustomerDb.objects.create(c_name='Foo', c_role='Admin',
   c_date_created=timezone.now(),
   c_date_updated=timezone.now())
 customer_list = CustomerDb.objects.all()
 self.assertEqual(len(customer_list), 1)


 Logs:-
 
 ==
 FAIL: test_customer_create_modify_delete (orca.tests.tmp.OrcaTestCase)
 Test customer object create, modify and delete operations in  DB.
 --
 Traceback (most recent call last):
   File "/home/sidhesh/workspace/sztp/orca/tests/tmp.py", line 26, in 
 test_customer_create_modify_delete
 self.assertEqual(len(customer_list), 1)
 AssertionError: 2 != 1

 --
 Ran 2 tests in 0.014s

 FAILED (failures=1)



 On Wednesday, December 2, 2015 at 9:14:54 AM UTC-8, Tim Graham wrote:
>
> How does the test fail? Please show the entire test file including 
> imports.
>
> On Wednesday, December 2, 2015 at 11:20:27 AM UTC-5, learn django 
> wrote:
>>
>> Hi Tim,
>>
>> Below is what am trying to achieve.
>>
>> class OrcaTestCase(TestCase):
>>
>> def test_customer_create_modify_delete(self):
>> '''Test customer object create, modify and delete operations 
>> in  DB.'''
>> # Create.
>> CustomerDb.objects.create(c_name='Pnc', c_role='ADFS-Admin',
>>   c_date_created=timezone.now(),

get all current active connected users

2015-12-09 Thread Fabio C. Barrionuevo da Luz
hello,
Django provide any API for get all users who are currently connected?

I need to run some scheduled tasks for users who are not connected and did
not understand how I can get the users with active login via Session

-- 
Fábio C. Barrionuevo da Luz
Palmas - Tocantins - Brasil - América do Sul

http://pythonclub.com.br/

Blog colaborativo sobre Python e tecnologias Relacionadas, mantido
totalmente no https://github.com/pythonclub/pythonclub.github.io .

Todos são livres para publicar. É só fazer fork, escrever sua postagem e
mandar o pull-request. Leia mais sobre como publicar em README.md e
contributing.md.
Regra básica de postagem:
"Você" acha interessante? É útil para "você"? Pode ser utilizado com Python
ou é útil para quem usa Python? Está esperando o que? Publica logo, que
estou louco para ler...

-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPVjvMbRXkFEi95jL0is%3DNePz%3DSiAaHusSK1oJRei%3D-U%2B_jfGw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add myself as a developer for hire in the wiki?

2015-12-09 Thread Tim Graham
You can login using a Trac or GitHub account, then click "Edit this page" 
at the bottom of the page.

On Wednesday, December 9, 2015 at 5:47:42 AM UTC-5, James Lin wrote:
>
> https://code.djangoproject.com/wiki/DevelopersForHire
>
> Cheers.
>

-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bf9ada2b-a49e-4a52-af97-e56f87cc56e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: SyntaxError: invalid syntax when installing Django from pip

2015-12-09 Thread knbk
This is an issue with setuptools 5.5.x. It is safe to ignore, or you can 
upgrade setuptools by upgrading pip: pip install -U pip

On Wednesday, December 9, 2015 at 11:47:42 AM UTC+1, Chethan Kumar R wrote:
>
> Hi, all
>
> Im new to django, just now installed django through pip and got below 
> syntax error, so can anyone tell me is that fine or need to correct that. 
>
> Thanks in advance.
>
> sudo pip install Django
> Downloading/unpacking Django
>   Downloading Django-1.9-py2.py3-none-any.whl (6.6MB): 6.6MB downloaded
> Installing collected packages: Django
> Compiling /tmp/pip_build_root/Django/django/conf/app_template/apps.py ...
>   File "/tmp/pip_build_root/Django/django/conf/app_template/apps.py", 
> line 4
> class {{ camel_case_app_name }}Config(AppConfig):
>   ^
> SyntaxError: invalid syntax
>
> Compiling /tmp/pip_build_root/Django/django/conf/app_template/models.py ...
>   File "/tmp/pip_build_root/Django/django/conf/app_template/models.py", 
> line 1
> {{ unicode_literals }}from django.db import models
>  ^
> SyntaxError: invalid syntax
>
> Successfully installed Django
> Cleaning up...
>
>
>
>
>
>

-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0f7f1fc6-a7fd-45a1-b221-a08b4b34cd8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


What am I supposed to do if I want a Wizard?

2015-12-09 Thread Martin Torre Castro
Hello,

I was investigating about form wizards in Django, but I have seen that 
recently this has changed in the deprecation timeline doc:

"The form wizard has been refactored to use class-based views with 
pluggable backends in 1.4. The previous implementation will be removed."

I understand that the old form wizard is now part of the form-tools package 
and I must install it if I want to use it.

My question is if I should do it or maybe I should "use class based-views 
with pluggable backends", which I'm not sure of what means and sounds like 
doing all the classes and boilerplate for doing wizards all again on my own.


Please, could someone give me some advice. If I go with class based views, 
could someone pass me a link where I can find some example with a form 
wizard made in such way.


Thank you very much in advanced.

-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ac8fecc6-baed-4b40-8f71-bfdc17a69ee7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


SyntaxError: invalid syntax when installing Django from pip

2015-12-09 Thread Chethan Kumar R
Hi, all

Im new to django, just now installed django through pip and got below 
syntax error, so can anyone tell me is that fine or need to correct that. 

Thanks in advance.

sudo pip install Django
Downloading/unpacking Django
  Downloading Django-1.9-py2.py3-none-any.whl (6.6MB): 6.6MB downloaded
Installing collected packages: Django
Compiling /tmp/pip_build_root/Django/django/conf/app_template/apps.py ...
  File "/tmp/pip_build_root/Django/django/conf/app_template/apps.py", line 4
class {{ camel_case_app_name }}Config(AppConfig):
  ^
SyntaxError: invalid syntax

Compiling /tmp/pip_build_root/Django/django/conf/app_template/models.py ...
  File "/tmp/pip_build_root/Django/django/conf/app_template/models.py", 
line 1
{{ unicode_literals }}from django.db import models
 ^
SyntaxError: invalid syntax

Successfully installed Django
Cleaning up...





-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/94c3ae7a-1a32-499b-89fa-a0d573f10cf3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Multiple databases in Django 1.7

2015-12-09 Thread Łukasz Pauszek
Hello,
I'm trying to configure project in Django 1.7 to use multiple databases, 
for now I'm following official documentation to configure 2 dbs. 
Problem is that when I run: ./manage.py makemigrations myapp only changes 
in default database are detected. And ./manage.py migrate 
--database=main_db doesn't see model which should be created in it. 
What should I do to update second database?
Below I'm pasting code which I think may be relevant:

project/settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'default.sqlite3'),
},
'main_db': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'main_db.sqlite3')
}
}

DATABASE_ROUTERS = ['myapp.routers.SelectDatabaseRouter']

myapp/models.py
class TestingDefaultDatabase(models.Model):

class Meta:
verbose_name = "TestingDefaultDatabase"
verbose_name_plural = "TestingDefaultDatabases"

name = models.CharField(max_length=50)
surname = models.CharField(max_length=50)


class TestingMainDatabase(models.Model):

class Meta:
verbose_name = "TestingMainDatabase"
verbose_name_plural = "TestingMainDatabases"
app_label = 'main'

name = models.CharField(max_length=50)
surname = models.CharField(max_length=50)

myapp/routers.py
class SelectDatabaseRouter(object):
def db_for_read(self, model, **hints):
if model._meta.app_label == 'main':
return 'main_db'
return None

def db_for_write(self, model, **hints):
if model._meta.app_label == 'main':
return 'main_db'
return None

def allow_relation(self, obj1, obj2, **hints):
if obj1._meta.app_label == 'main' or \
obj2._meta.app_label == 'main':
return True
return None

def allow_migrate(self, db, model):
if db == 'main_db':
return model._meta.app_label == 'main'
elif model._meta.app_label == 'main':
return False
return None

Am I missing or incorrectly configured something? Or perhaps I'm not using 
appropriate commands?
Thank you for help.
ŁP

-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3033c961-efa9-4e3a-9dcf-e212b09fd222%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to add myself as a developer for hire in the wiki?

2015-12-09 Thread James Lin
https://code.djangoproject.com/wiki/DevelopersForHire

Cheers.

-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/59d56e3a-bc57-4393-a5dc-c887d0e2c34a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Model Meta option default_related_name not setting related_query_name

2015-12-09 Thread Simon Charette
Hi Alejandro,

Did you get the reply to your previous similar question[1]?

Simon

[1] https://groups.google.com/d/topic/django-users/OGavpqJrw6g/discussion

Le mercredi 9 décembre 2015 03:13:46 UTC-5, Alejandro Do Nascimento a 
écrit :
>
> Hello, 
>
> I have a doubt, In a model I'm using the Meta option * 
> default_related_name*, this sets the related manager but it doesn't set 
> the *related_query_name* as using related_name in a field would do, is 
> this a bug or the intended functionality? 
>
> Neither the new feature ticket 
>  nor the django docs 
> 
>  
> say anything about it.
>
> Thx
>
>
> -- 
> AD.N
>

-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d6aa1c7c-cb02-407f-9f57-4a44e04422b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Regarding Forms : "ModelMultipleChoiceField"

2015-12-09 Thread Kishan Mehta
Hi All,

I am generating admin interface form.

I want to add search functionality and paginate my following
"ModelMultipleChoiceField" field of django form. Is is possible to achieve
this ?


Because it contains around 5000 results.

Here is my forms.py









*class ScheduledTestForm(forms.ModelForm):tags =
forms.ModelMultipleChoiceField(queryset=Tag.objects.all())   class
Meta:model = Testexclude = ['pita_id', 'challenge',
'test_template']*

Here is my template.html :(partial code) :


{% block nav-global %}{% endblock %}
{% block content %}



*{% csrf_token %}{{
form.as_p  }}*

{% endblock %}

-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAC5ThKEFQ-Ash-A%2BX6V5jNn5LJoUCNpj2nuaTrBJ0PtL_X0x7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Fwd: Model Meta option default_related_name not setting related_query_name

2015-12-09 Thread Alejandro Do Nascimiento
Hello,

I have a doubt, In a model I'm using the Meta option * default_related_name*,
this sets the related manager but it doesn't set the *related_query_name*
as using related_name in a field would do, is this a bug or the intended
functionality?

Neither the new feature ticket 
nor the django docs

say anything about it.

Thx


-- 
AD.N

-- 
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.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJWrnkHWw2S0F153bbdUtz8ukDKypToyhSsuEUFmAjojrtfBbw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.