Re: Django 2.1.4: Permissions are not updated after migrations

2019-03-17 Thread Simon Charette
Hello Yevgeny,

I'd start by deleting your stale content types[0] which your permissions 
are attached
to. That should deal with deleted model case.

For the renames I suggest you drop into a shell and manually edit the 
Permission.name
of the misnamed instances.

Best,
Simon

[0] 
https://docs.djangoproject.com/en/2.1/ref/django-admin/#django-contrib-contenttypes

Le dimanche 17 mars 2019 15:52:45 UTC-4, Yevgeny Bar Lev a écrit :
>
> Thanks Simon. Is there some nonmagical solution? I mean, is it possible to 
> fix some of the permissions manually without breaking stuff?
>
> On Sun, Mar 17, 2019, 9:21 PM Simon Charette  > wrote:
>
>> Hello Yevgeny,
>>
>> I don't have magic solution to suggest to you given the current state of 
>> your
>> permission data after a few iterations but I just wanted to let you know 
>> that
>> it's a known issue[0] and a contributor is actively working on getting it 
>> fixed[1].
>>
>> Cheers,
>> Simon
>>
>> [0] https://code.djangoproject.com/ticket/29843
>> [1] https://github.com/django/django/pull/10540
>>
>> Le dimanche 17 mars 2019 13:31:16 UTC-4, Yevgeny Bar Lev a écrit :
>>>
>>> Hello,
>>> I have noticed that the available permissions list, which can be set to 
>>> users/groups in the admin doesn't match my models. This happened after a 
>>> few standard migrations, where some models were renamed, some deleted, and 
>>> new models were added. The list is basically not updated, and represents a 
>>> mixed state of the db, before and after the above migrations.
>>>
>>> manage.py inspectdb show the CORRECT state of the database. 
>>>
>>> I have tried to follow the following solution, which basically didn't do 
>>> much.
>>>
>>> from django.contrib.auth.management import create_permissionsfrom 
>>> django.apps import apps
>>>
>>> create_permissions(apps.get_app_config('my_app_name'))
>>>
>>> I will appreciate your help.
>>> Best,
>>> Yevgeny.
>>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/9c49dff1-c6b1-43e6-818d-f56ab761558d%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7f88aa1a-4d3f-4611-9611-c733b81909a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


ANN: django-yamlconf 1.1.0

2019-03-17 Thread Michael Rohan
Hi Folks,

Have release v1.1.0 for django-yamlconf, a module supporting Django
settings via YAML files (searching up the directory hierarchy, e.g., in a
K8s environment, adding a "final" set of settings via "/APPLICATION.yaml",
see the documentation a https://django-yamlconf.readthedocs.io/en/latest/
for more detailed info.  The primary driver was the update to PyYAML load
function to require a Loader kwarg.

Take care,
Michael.

-- 
Michael Rohan
mro...@acm.org

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOCsNFjwxeBPMtfRFczc%3Dn%2B5Nku5nShDbFLX-Ukz2y8LxbXxFw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django's best way to upload data into a postgresql database

2019-03-17 Thread Ryan Nowakowski
Send like a pretty standard optimization scenario. I'd recommend:

1. Find the bottleneck. Here if your suspect it's pandas dataframe vs lists, 
run a timing analysis using each.
2. Remove the bottleneck

On March 17, 2019 6:52:23 PM CDT, "Guillermo Yáñez Feliú" 
 wrote:
> 
>
>Hello,
>
>
>I’m working in a project that consists in converting a local postgresql
>
>database (that uses sqlalchemy as the ORM) into a web application, in
>which 
>I upload excel sheets, read them, do some small cleaning and then
>upload 
>selected data into a postgresql database using Django’s ORM. The idea
>is to 
>have the data in a server instead of in every user’s machine. 
>
>Everything is ok but data loading is taking too long since, I think, I
>am 
>using panda’s dataframes to easily structure, read and save the data.
>In 
>the local version of the library, I used lists and was way faster.
>
>
>I don’t if it’s related to Sqlalchemy, Django, lists or dataframes. Any
>
>suggestions on how to read spreadsheets data and upload it into a 
>postgresql database using Django?
>
>
>Thanks a lot.
>
>-- 
>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 https://groups.google.com/group/django-users.
>To view this discussion on the web visit
>https://groups.google.com/d/msgid/django-users/c43db26f-45fd-4769-b8ce-7f34cc7ca594%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/24A8A9A5-E317-4E35-99F0-5DBFD3CE49B5%40fattuba.com.
For more options, visit https://groups.google.com/d/optout.


Enable Cron task, interval task not work Celery Beat

2019-03-17 Thread thanh . nguyenba0611


My Django Web has interval task type and cron task type. When i disable 
cron task type, interval task type work. But when i enable cron task type, 
cron task type work and interval task not work.

I run celery beat and celery worker with supervisor. And i'm sure service 
beat running

Version

celery==4.2.1
django-celery-beat==1.3.0

My settings

INSTALLED_APPS += [
'django_celery_beat',
'reports',
]

LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'Asia/Ho_Chi_Minh'
USE_TZ = True


CELERY_BROKER_URL = [
'pyamqp://:x...@xx.xx.xx.10:5672/dev_vhost',
'pyamqp://:x...@xx.xx.xx.11:5672/dev_vhost',
'pyamqp://:x...@xx.xx.xx.12:5672/dev_vhost',

]

CELERY_RESULT_BACKEND = 'rpc://'
CELERY_ENABLE_UTC = True
CELERY_TIMEZONE = 'Asia/Ho_Chi_Minh'
CELERY_BROKER_HEARTBEAT = 0

CELERY_ACCEPT_CONTENT = ['application/json']
CELERY_RESULT_SERIALIZER = 'json'
CELERY_TASK_SERIALIZER = 'json'

Log celery beat (when enable cron task type)

[2019-03-17 17:02:48,562: INFO/MainProcess] Writing entries...
[2019-03-17 17:05:49,343: INFO/MainProcess] Writing entries...
[2019-03-17 17:08:49,931: INFO/MainProcess] Writing entries...
[2019-03-17 17:11:50,555: INFO/MainProcess] Writing entries...
[2019-03-17 17:14:51,154: INFO/MainProcess] Writing entries...
[2019-03-17 17:17:51,766: INFO/MainProcess] Writing entries...
[2019-03-17 17:20:52,366: INFO/MainProcess] Writing entries...
[2019-03-17 17:23:52,960: INFO/MainProcess] Writing entries...
[2019-03-17 17:26:53,554: INFO/MainProcess] Writing entries...
[2019-03-17 17:29:54,142: INFO/MainProcess] Writing entries...
[2019-03-17 17:32:54,724: INFO/MainProcess] Writing entries...
[2019-03-17 17:35:55,317: INFO/MainProcess] Writing entries...
[2019-03-17 17:38:55,932: INFO/MainProcess] Writing entries...
[2019-03-17 17:41:56,539: INFO/MainProcess] Writing entries...
[2019-03-17 17:44:57,147: INFO/MainProcess] Writing entries...
[2019-03-17 17:47:57,733: INFO/MainProcess] Writing entries...
[2019-03-17 17:50:58,349: INFO/MainProcess] Writing entries...
[2019-03-17 17:53:58,954: INFO/MainProcess] Writing entries...
[2019-03-17 17:56:59,546: INFO/MainProcess] Writing entries...
[2019-03-17 18:00:00,144: INFO/MainProcess] Writing entries...
[2019-03-17 18:03:00,728: INFO/MainProcess] Writing entries...
[2019-03-17 18:06:01,331: INFO/MainProcess] Writing entries...
[2019-03-17 18:09:01,938: INFO/MainProcess] Writing entries...
[2019-03-17 18:12:02,527: INFO/MainProcess] Writing entries...
[2019-03-17 18:15:03,118: INFO/MainProcess] Writing entries...
[2019-03-17 18:18:03,707: INFO/MainProcess] Writing entries...
[2019-03-17 18:21:04,287: INFO/MainProcess] Writing entries...
[2019-03-17 18:24:04,872: INFO/MainProcess] Writing entries...
[2019-03-17 18:27:05,464: INFO/MainProcess] Writing entries...
[2019-03-17 18:30:06,069: INFO/MainProcess] Writing entries...
[2019-03-17 18:33:06,670: INFO/MainProcess] Writing entries...
[2019-03-17 18:36:07,249: INFO/MainProcess] Writing entries...
[2019-03-17 18:39:07,837: INFO/MainProcess] Writing entries...
[2019-03-17 18:42:08,425: INFO/MainProcess] Writing entries...
[2019-03-17 18:45:09,004: INFO/MainProcess] Writing entries...
[2019-03-17 18:48:09,614: INFO/MainProcess] Writing entries...
[2019-03-17 18:51:10,214: INFO/MainProcess] Writing entries...
[2019-03-17 18:54:10,815: INFO/MainProcess] Writing entries...
[2019-03-17 18:57:11,412: INFO/MainProcess] Writing entries...
[2019-03-17 19:00:12,025: INFO/MainProcess] Writing entries...

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e5820555-37d9-46aa-a609-3fe9a98a2a31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django's best way to upload data into a postgresql database

2019-03-17 Thread Guillermo Yáñez Feliú
 

Hello,


I’m working in a project that consists in converting a local postgresql 
database (that uses sqlalchemy as the ORM) into a web application, in which 
I upload excel sheets, read them, do some small cleaning and then upload 
selected data into a postgresql database using Django’s ORM. The idea is to 
have the data in a server instead of in every user’s machine. 

Everything is ok but data loading is taking too long since, I think, I am 
using panda’s dataframes to easily structure, read and save the data. In 
the local version of the library, I used lists and was way faster.


I don’t if it’s related to Sqlalchemy, Django, lists or dataframes. Any 
suggestions on how to read spreadsheets data and upload it into a 
postgresql database using Django?


Thanks a lot.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c43db26f-45fd-4769-b8ce-7f34cc7ca594%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 2.1.4: Permissions are not updated after migrations

2019-03-17 Thread Yevgeny Bar Lev
Thanks Simon. Is there some nonmagical solution? I mean, is it possible to
fix some of the permissions manually without breaking stuff?

On Sun, Mar 17, 2019, 9:21 PM Simon Charette  wrote:

> Hello Yevgeny,
>
> I don't have magic solution to suggest to you given the current state of
> your
> permission data after a few iterations but I just wanted to let you know
> that
> it's a known issue[0] and a contributor is actively working on getting it
> fixed[1].
>
> Cheers,
> Simon
>
> [0] https://code.djangoproject.com/ticket/29843
> [1] https://github.com/django/django/pull/10540
>
> Le dimanche 17 mars 2019 13:31:16 UTC-4, Yevgeny Bar Lev a écrit :
>>
>> Hello,
>> I have noticed that the available permissions list, which can be set to
>> users/groups in the admin doesn't match my models. This happened after a
>> few standard migrations, where some models were renamed, some deleted, and
>> new models were added. The list is basically not updated, and represents a
>> mixed state of the db, before and after the above migrations.
>>
>> manage.py inspectdb show the CORRECT state of the database.
>>
>> I have tried to follow the following solution, which basically didn't do
>> much.
>>
>> from django.contrib.auth.management import create_permissionsfrom 
>> django.apps import apps
>>
>> create_permissions(apps.get_app_config('my_app_name'))
>>
>> I will appreciate your help.
>> Best,
>> Yevgeny.
>>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9c49dff1-c6b1-43e6-818d-f56ab761558d%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEBarV0ePqn3DJi3Q3euBStTq7X7nUWLtdLXmrMHeneoRyjrVw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Is MongoAtlas supported with django?

2019-03-17 Thread Periklis Gkolias
Hi,

I am trying to connect my Django app to MongoDB atlas, using djongo
. Here is my status:

I have set up a cluster successfully in Atlas. I am then getting the
connection string details from the relevant console. With that knowledge, I
am amending my DATABASES dict in settings.py

Here is the connection string:

*mongodb+srv://:@-/test?retryWrites=true*

Here is my dict.

DATABASES = {
'default': {
'ENGINE': 'djongo',
'USER': 'my_username',
'PASSWORD': 'password',
'NAME': 'test',
'HOST': '-',
'PORT': 27017

}
}


Do you find anything smelly? Has anyone done a similar setup? I would
appreciate any documentation or hints on that matter

Thanks,
Periklis

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


Re: Django 2.1.4: Permissions are not updated after migrations

2019-03-17 Thread Simon Charette
Hello Yevgeny,

I don't have magic solution to suggest to you given the current state of 
your
permission data after a few iterations but I just wanted to let you know 
that
it's a known issue[0] and a contributor is actively working on getting it 
fixed[1].

Cheers,
Simon

[0] https://code.djangoproject.com/ticket/29843
[1] https://github.com/django/django/pull/10540

Le dimanche 17 mars 2019 13:31:16 UTC-4, Yevgeny Bar Lev a écrit :
>
> Hello,
> I have noticed that the available permissions list, which can be set to 
> users/groups in the admin doesn't match my models. This happened after a 
> few standard migrations, where some models were renamed, some deleted, and 
> new models were added. The list is basically not updated, and represents a 
> mixed state of the db, before and after the above migrations.
>
> manage.py inspectdb show the CORRECT state of the database. 
>
> I have tried to follow the following solution, which basically didn't do 
> much.
>
> from django.contrib.auth.management import create_permissionsfrom django.apps 
> import apps
>
> create_permissions(apps.get_app_config('my_app_name'))
>
> I will appreciate your help.
> Best,
> Yevgeny.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9c49dff1-c6b1-43e6-818d-f56ab761558d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django 2.1.4: Permissions are not updated after migrations

2019-03-17 Thread Yevgeny Bar Lev
Hello,
I have noticed that the available permissions list, which can be set to 
users/groups in the admin doesn't match my models. This happened after a 
few standard migrations, where some models were renamed, some deleted, and 
new models were added. The list is basically not updated, and represents a 
mixed state of the db, before and after the above migrations.

manage.py inspectdb show the CORRECT state of the database. 

I have tried to follow the following solution, which basically didn't do 
much.

from django.contrib.auth.management import create_permissionsfrom django.apps 
import apps

create_permissions(apps.get_app_config('my_app_name'))

I will appreciate your help.
Best,
Yevgeny.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/50ab1a8f-40f8-4a9f-b2da-6b0f0f6f8849%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: get_absolute_url in djano 2.1.7

2019-03-17 Thread Ankit Anurag
The one major use is that this function helps you avoid situations where 
you have to hardcode a URL in your templates. Instead, you use something 
like {{.get_absolute_url}} and even if you change the path in 
some way at some later point of time, it won't matter. It's basically a 
really good practice to use this function to define your URL.
Check out this link from Stack : 
*https://stackoverflow.com/questions/43179875/when-to-use-django-get-absolute-url-method*

On Sunday, 17 March 2019 20:07:27 UTC+5:30, arpan godiyal wrote:
>
> Can someone help me with how to use get_absolute_url method in django 
> 2.1.7.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7c18e8ad-cb6a-49b6-8ab8-c2a3fcb5184a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: filter two columns django

2019-03-17 Thread omar ahmed
thank you Shashank very much
it works

On Sunday, March 17, 2019 at 4:02:46 PM UTC+2, Shashank Singh wrote:
>
> OR
> from django.db.models import Q
> news_list = 
> LeagueNews.objects.filter(Q(publication_date__lte=timezone.now)|Q(league_name='english')).order_by('-publication_date')[:10]
>
> AND
> news_list = LeagueNews.objects.filter(publication_date__lte=timezone.now, 
> league_name='english').order_by('-publication_date')[:10]
>
> On Sun, 17 Mar, 2019, 7:25 PM omar ahmed,  > wrote:
>
>> hi guys
>> this is my view
>> def premierleague(request):
>> news_list = 
>> LeagueNews.objects.filter((publication_date__lte=timezone.now)|(league_name='english')).order_by('-publication_date')[:10]
>> return render(request, 'core/premierleague.html', {'news_list':news_list})
>> i want to filter my objects by two columns
>> publication_date and league_name
>> but it doesn't work
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/58a97b33-b41e-4f87-a003-e9f82bcb9790%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/71303dd0-60d8-4da9-832b-000cca2ae85a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Execute view logic without page change | Add item to list

2019-03-17 Thread Aris Almpanis
Hello all,

Django newbie here so sorry for any mistargeted questions!

I am building an app for handling user orders and I would like to track
each user's add item request, pretty much like an 'add product to cart'
functionality.

At the moment I have a detail view where there is the option of adding the
item to the order via a button. Initially I tried connecting the button to
an AJAX get request to some url (like items/whatever/add) with the hope to
execute a view that stores the user's choice in the session data. However,
my main problem is that django responds to this request with a response
"forcing" the browser to open up a new tab and display the response - I do
not wish any change in the current page the user is wathcing.

In more general terms is there a way to call remote api in order to do
something without changing browsers current display?

Thank you 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD5ymB7gp963Y_9veX%3D9wmmdPnc-jSc-mgry5yykK4Ki4NG5cA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


get_absolute_url in djano 2.1.7

2019-03-17 Thread arpan godiyal
Can someone help me with how to use get_absolute_url method in django 2.1.7.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0b12611a-e5a8-4235-8c61-6267ea18a2ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: filter two columns django

2019-03-17 Thread Shashank Singh
OR
from django.db.models import Q
news_list =
LeagueNews.objects.filter(Q(publication_date__lte=timezone.now)|Q(league_name='english')).order_by('-publication_date')[:10]

AND
news_list = LeagueNews.objects.filter(publication_date__lte=timezone.now,
league_name='english').order_by('-publication_date')[:10]

On Sun, 17 Mar, 2019, 7:25 PM omar ahmed,  wrote:

> hi guys
> this is my view
> def premierleague(request):
> news_list =
> LeagueNews.objects.filter((publication_date__lte=timezone.now)|(league_name='english')).order_by('-publication_date')[:10]
> return render(request, 'core/premierleague.html', {'news_list':news_list})
> i want to filter my objects by two columns
> publication_date and league_name
> but it doesn't work
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/58a97b33-b41e-4f87-a003-e9f82bcb9790%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD-d1sbsWA5q_M2SQdTfVpePHm3vkyXdvdko2imNZfrtwFg_vA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


filter two columns django

2019-03-17 Thread omar ahmed
hi guys
this is my view
def premierleague(request):
news_list = 
LeagueNews.objects.filter((publication_date__lte=timezone.now)|(league_name='english')).order_by('-publication_date')[:10]
return render(request, 'core/premierleague.html', {'news_list':news_list})
i want to filter my objects by two columns
publication_date and league_name
but it doesn't work

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/58a97b33-b41e-4f87-a003-e9f82bcb9790%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: What I am doing wrong

2019-03-17 Thread gauravsrivastava2k17
Please put screenshot of your  traceback as it is easier to understand 
issue with that

On Friday, March 15, 2019 at 5:37:31 PM UTC+5:30, Harish Chaudhary wrote:
>
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fea461ad-f427-4dd3-a23b-235c6f321693%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: For what il8n is used?

2019-03-17 Thread gauravsrivastava2k17
Ohh now I got it. Thanks for replying

On Sunday, March 17, 2019 at 5:30:11 PM UTC+5:30, Aldian Fazrihady wrote:
>
> So we can use template tags related to internationalization,  such as 
> 'trans' and 'get_current_language'
>
>
> On Sun, 17 Mar 2019, 18:54 , > 
> wrote:
>
>> I used to many time {% load il8n %}. For what purpose it is used?
>>
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/8e599881-27ab-4841-b5fe-7714dfa5a2b5%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bc60c29a-6c6c-4ed3-bd32-6940482259fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to become a contributor in an organisation

2019-03-17 Thread gauravsrivastava2k17
Hi , I am new to GSOC and so I want to know that how I can be a contributor?

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c3171d27-5724-4039-a093-6479b8f56277%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: For what il8n is used?

2019-03-17 Thread Aldian Fazrihady
So we can use template tags related to internationalization,  such as
'trans' and 'get_current_language'


On Sun, 17 Mar 2019, 18:54 ,  wrote:

> I used to many time {% load il8n %}. For what purpose it is used?
>
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8e599881-27ab-4841-b5fe-7714dfa5a2b5%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAN7EoAb3Q15aSf9RnS3iv5a0xqTjkUL3Eac4r%3Dq_CUE822n8aA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


For what il8n is used?

2019-03-17 Thread gauravsrivastava2k17
I used to many time {% load il8n %}. For what purpose it is used?


-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8e599881-27ab-4841-b5fe-7714dfa5a2b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: SWAQ-HUB

2019-03-17 Thread Harish Chaudhary
 Fresher are allowed in this group??

On Sun, 17 Mar, 2019, 4:32 PM ,  wrote:

> We're only looking for Developers, Data Scientist and AI specialties.
> If you're not in this field, please don't join us.
> Also you should note the only supported programming language is Python or
> R.
>
> https://chat.whatsapp.com/KJ2GyBoOmAu0XvQa6S9RTt
>
> Any member that join without at least contributing within 5 days will be
> removed.
> It is strictly for experienced tech.
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/cbad4e91-bb1f-46fb-98c0-e5e7010c86a9%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALxqzK44JiR3V5BjRp2Yif3D8MSP3%3D0HDhjKGyKi1T80PXN47Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


SWA-HUB

2019-03-17 Thread officialjoemayami
We're only looking for Developers, Data Scientist and AI specialties.
If you're not in this field, please don't join us. 
Also you should note the only supported programming language is Python or R.
 
https://chat.whatsapp.com/KJ2GyBoOmAu0XvQa6S9RTt

Any member that join without at least contributing within 5 days will be 
removed.
It is strictly for experienced tech.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/00871692-884a-4dff-84a7-bfe87f391191%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


SWAQ-HUB

2019-03-17 Thread officialjoemayami
We're only looking for Developers, Data Scientist and AI specialties.
If you're not in this field, please don't join us. 
Also you should note the only supported programming language is Python or R.
 
https://chat.whatsapp.com/KJ2GyBoOmAu0XvQa6S9RTt

Any member that join without at least contributing within 5 days will be 
removed.
It is strictly for experienced tech.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cbad4e91-bb1f-46fb-98c0-e5e7010c86a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.