Is django guardian repostness with millions of records in every table

2021-06-12 Thread wael muhammed
Could I force problem if I have more than 500 table with million of record 
in each table
 .with Django guardian

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0a864f8b-95b9-4ed6-be32-cf400dd079f7n%40googlegroups.com.


Re: Make permissions according branch id

2021-06-12 Thread wael muhammed
Did any one understands what I mean
?
في السبت، 12 يونيو 2021 في تمام الساعة 3:43:09 م UTC+3، كتب ‪wael 
muhammed‬‏ رسالة نصها:

>
> I want to make permissions according branch id
>  for more details 
> 
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/57c67bbc-bc9d-412e-8001-2e9eecf13e38n%40googlegroups.com.


Re: User matching query does not exist.

2021-06-12 Thread sachinbg sachin
It means that the data which you are looking for is not exists in that data
base, check properly wether the searching data is exists or not,

Thank you
Sachin b.g

On Sun, 13 Jun, 2021, 6:53 AM Nikeet NA,  wrote:

> There is no user with id 1.
> Wrap this statement inside try catch block :
>user = User.objects.get(id=uid)
>and catch the DoesNotExist exception as except User.DoesNotExist:
>
> On Saturday, 12 June 2021 at 18:13:09 UTC+5:30 shilpa...@gmail.com wrote:
>
>> Environment:
>>
>>
>> Request Method: GET
>> Request URL: http://127.0.0.1:8000/addToCart/1
>>
>> Django Version: 3.2.3
>> Python Version: 3.9.1
>> Installed Applications:
>> ['django.contrib.admin',
>>  'django.contrib.auth',
>>  'django.contrib.contenttypes',
>>  'django.contrib.sessions',
>>  'django.contrib.messages',
>>  'django.contrib.staticfiles',
>>  'MusicalApp.apps.MusicalappConfig',
>>  'CartApp.apps.CartappConfig']
>> Installed Middleware:
>> ['django.middleware.security.SecurityMiddleware',
>>  'django.contrib.sessions.middleware.SessionMiddleware',
>>  'django.middleware.common.CommonMiddleware',
>>  'django.middleware.csrf.CsrfViewMiddleware',
>>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>>  'django.contrib.messages.middleware.MessageMiddleware',
>>  'django.middleware.clickjacking.XFrameOptionsMiddleware']
>>
>>
>>
>> Traceback (most recent call last):
>>   File
>> "D:\DjangoDemos\venv\lib\site-packages\django\core\handlers\exception.py",
>> line 47, in inner
>> response = get_response(request)
>>   File
>> "D:\DjangoDemos\venv\lib\site-packages\django\core\handlers\base.py", line
>> 181, in _get_response
>> response = wrapped_callback(request, *callback_args,
>> **callback_kwargs)
>>   File "D:\DjangoDemos\CartApp\views.py", line 15, in addToCart
>> user = User.objects.get(id=uid)
>>   File
>> "D:\DjangoDemos\venv\lib\site-packages\django\db\models\manager.py", line
>> 85, in manager_method
>> return getattr(self.get_queryset(), name)(*args, **kwargs)
>>   File "D:\DjangoDemos\venv\lib\site-packages\django\db\models\query.py",
>> line 435, in get
>> raise self.model.DoesNotExist(
>>
>> Exception Type: DoesNotExist at /addToCart/1
>> Exception Value: User matching query does not exist.
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/1b7cff79-a0eb-4559-ab17-1d9d0f701343n%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOs61rz3X4KBT9MJdFOoion0N4UvH0V_YM%3DhQA3DY%2BZzce8o3w%40mail.gmail.com.


Re: User matching query does not exist.

2021-06-12 Thread Nikeet NA
There is no user with id 1.
Wrap this statement inside try catch block :
   user = User.objects.get(id=uid)
   and catch the DoesNotExist exception as except User.DoesNotExist:

On Saturday, 12 June 2021 at 18:13:09 UTC+5:30 shilpa...@gmail.com wrote:

> Environment:
>
>
> Request Method: GET
> Request URL: http://127.0.0.1:8000/addToCart/1
>
> Django Version: 3.2.3
> Python Version: 3.9.1
> Installed Applications:
> ['django.contrib.admin',
>  'django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.messages',
>  'django.contrib.staticfiles',
>  'MusicalApp.apps.MusicalappConfig',
>  'CartApp.apps.CartappConfig']
> Installed Middleware:
> ['django.middleware.security.SecurityMiddleware',
>  'django.contrib.sessions.middleware.SessionMiddleware',
>  'django.middleware.common.CommonMiddleware',
>  'django.middleware.csrf.CsrfViewMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.contrib.messages.middleware.MessageMiddleware',
>  'django.middleware.clickjacking.XFrameOptionsMiddleware']
>
>
>
> Traceback (most recent call last):
>   File 
> "D:\DjangoDemos\venv\lib\site-packages\django\core\handlers\exception.py", 
> line 47, in inner
> response = get_response(request)
>   File 
> "D:\DjangoDemos\venv\lib\site-packages\django\core\handlers\base.py", line 
> 181, in _get_response
> response = wrapped_callback(request, *callback_args, **callback_kwargs)
>   File "D:\DjangoDemos\CartApp\views.py", line 15, in addToCart
> user = User.objects.get(id=uid)
>   File 
> "D:\DjangoDemos\venv\lib\site-packages\django\db\models\manager.py", line 
> 85, in manager_method
> return getattr(self.get_queryset(), name)(*args, **kwargs)
>   File "D:\DjangoDemos\venv\lib\site-packages\django\db\models\query.py", 
> line 435, in get
> raise self.model.DoesNotExist(
>
> Exception Type: DoesNotExist at /addToCart/1
> Exception Value: User matching query does not exist.
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1b7cff79-a0eb-4559-ab17-1d9d0f701343n%40googlegroups.com.


Re: Allow field validation in ajax.

2021-06-12 Thread Nikeet NA
You are not submitting your form which Inturn is not validating. For 
validations to run you need to submit a form.

Give the submit button attribute type="submit", then add an event listener 
for form submit in your javascript.
$("#ReportForm").on('submit', function(event) {
   // here event is submit type event object
   event.preventDefault() // this is added to prevent default execution 
of form submit event which will stop the page reload. 
   // here event.target is your form so you can use that to get data as 
let data = new FormData(event.target) 
})

On Saturday, 12 June 2021 at 22:09:26 UTC+5:30 eugenet...@gmail.com wrote:

> Friends,
>
> The ajax codes below successfully save the records in the database without 
> page loading. But what I want is to validate the fields first before 
> saving. The codes do not validate the empty field. How can I include that 
> validation ? please help
>
> 
> $(".submit_btn").click(function(){
> var form=new FormData($("#ReportForm")[0]);
> //AJAX CODE
> var xhr=new XMLHttpRequest();
> xhr.onreadystatechange=function(){
> if(xhr.status==200){
> console.log(xhr.responseText);
> }
> }
> xhr.open("POST","{% url 'report_create' %}",true);
> $("#progressbar").show();
>
> //UPDATING PROGRESS BAR
> xhr.upload.addEventListener("progress",function(ev){
> if(ev.lengthComputable){
> var percentage=(ev.loaded/ev.total*100|0);
> $("#progressbar").css({"width":""+percentage+"%"}).text("Uploading .."+
> percentage+"%");
> console.log(percentage);
> if(percentage>=100){
> location.reload()
>
> }
> }
> });
>
> xhr.send(form);
> })
> 
>
> Regards,
> *Eugene*
>
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d4c70f2f-2b3f-4d64-a94a-ee31b9ecdd03n%40googlegroups.com.


Re: Ez

2021-06-12 Thread Gabriel Araya Garcia
Gbel:
I don't understand nothing about you attempt to tell us. If you could
write in english or spanish it would be great
Gabriel Araya Garcia
GMI - Desarrollo de Sistemas Informáticos




El sáb, 12 jun 2021 a las 14:50, GBELE CEDRIC EMMANUEL (<
cedric.gb...@uvci.edu.ci>) escribió:

> Se lo hé i  w lo +la,& pas 2€xz9#:,w
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CABTw%3DMXMa__AB9Kws8d6imx2tjR6jqP%3DcOph3puQ3khrpt1y6g%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKVvSDBSQAAa8oK7Zpr5LMfKFjTucEwqJ1VVJe9O42iYo5e7mQ%40mail.gmail.com.


Ez

2021-06-12 Thread GBELE CEDRIC EMMANUEL
Se lo hé i  w lo +la,& pas 2€xz9#:,w

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABTw%3DMXMa__AB9Kws8d6imx2tjR6jqP%3DcOph3puQ3khrpt1y6g%40mail.gmail.com.


Allow field validation in ajax.

2021-06-12 Thread Eugene TUYIZERE
Friends,

The ajax codes below successfully save the records in the database without
page loading. But what I want is to validate the fields first before
saving. The codes do not validate the empty field. How can I include that
validation ? please help


$(".submit_btn").click(function(){
var form=new FormData($("#ReportForm")[0]);
//AJAX CODE
var xhr=new XMLHttpRequest();
xhr.onreadystatechange=function(){
if(xhr.status==200){
console.log(xhr.responseText);
}
}
xhr.open("POST","{% url 'report_create' %}",true);
$("#progressbar").show();

//UPDATING PROGRESS BAR
xhr.upload.addEventListener("progress",function(ev){
if(ev.lengthComputable){
var percentage=(ev.loaded/ev.total*100|0);
$("#progressbar").css({"width":""+percentage+"%"}).text("Uploading .."+
percentage+"%");
console.log(percentage);
if(percentage>=100){
location.reload()

}
}
});

xhr.send(form);
})


Regards,
*Eugene*

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABxpZHtHocb924Ka2hmvb1a3OveouwYKS-K2m_38gtsqY-4vkQ%40mail.gmail.com.


Re: getattr(): attribute name must be string

2021-06-12 Thread David Crandell
It was a field type mismatch. I should have used DecimalField() instead of 
FloatField()

On Saturday, June 12, 2021 at 12:08:56 AM UTC-5 David Crandell wrote:

> Hello,
>
> I am trying to migrate changes to my models. When I do, I get a traceback 
> error to my Employee model which says 
>
> Traceback (most recent call last):
>   File "manage.py", line 22, in 
> main()
>   File "manage.py", line 18, in main
> execute_from_command_line(sys.argv)
>   File 
> "C:\Users\guita\Documents\oh_new\venv\lib\site-packages\django\core\management\__init__.py",
>  
> line 419, in execute_from_command_line
> utility.execute()
>   File 
> "C:\Users\guita\Documents\oh_new\venv\lib\site-packages\django\core\management\__init__.py",
>  
> line 395, in execute
> django.setup()
>   File 
> "C:\Users\guita\Documents\oh_new\venv\lib\site-packages\django\__init__.py", 
> line 24, in setup
> apps.populate(settings.INSTALLED_APPS)
>   File 
> "C:\Users\guita\Documents\oh_new\venv\lib\site-packages\django\apps\registry.py",
>  
> line 114, in populate
> app_config.import_models()
>   File 
> "C:\Users\guita\Documents\oh_new\venv\lib\site-packages\django\apps\config.py",
>  
> line 301, in import_models
> self.models_module = import_module(models_module_name)
>   File "C:\Program Files (x86)\Microsoft Visual 
> Studio\Shared\Python37_64\lib\importlib\__init__.py", line 127, in 
> import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 1006, in _gcd_import
>   File "", line 983, in _find_and_load
>   File "", line 967, in 
> _find_and_load_unlocked
>   File "", line 677, in _load_unlocked
>   File "", line 728, in exec_module
>   File "", line 219, in 
> _call_with_frames_removed
>   File "C:\Users\guita\Documents\ohmg_new\ohmg\models.py", line 5, in 
> 
> from customers.models import CustomerLogos, Customers
>   File "C:\Users\guita\Documents\ohmg_new\customers\models.py", line 5, in 
> 
> from employees.models import Employee
>   File "C:\Users\guita\Documents\ohmg_new\employees\models.py", line 6, in 
> 
> class Employee(models.Model):
>   File 
> "C:\Users\guita\Documents\oh_new\venv\lib\site-packages\django\db\models\base.py",
>  
> line 161, in __new__
> new_class.add_to_class(obj_name, obj)
>   File 
> "C:\Users\guita\Documents\oh_new\venv\lib\site-packages\django\db\models\base.py",
>  
> line 326, in add_to_class
> value.contribute_to_class(cls, name)
>   File 
> "C:\Users\guita\Documents\oh_new\venv\lib\site-packages\django\db\models\fields\__init__.py",
>  
> line 788, in contribute_to_class
> if not getattr(cls, self.attname, None):
> TypeError: getattr(): attribute name must be string
>
> 
>
> This is the model it's fussing about.
>
> class Employee(models.Model):
> first_name = models.CharField(max_length=50)
> last_name = models.CharField(max_length=50)
> email = models.EmailField()
> password = models.CharField(max_length=50)
> addr1 = models.CharField(max_length=50)
> addr2 = models.CharField(max_length=50)
> city = models.CharField(max_length=75)
> state = models.CharField(max_length=75)
> zip = models.CharField(max_length=10)
> position = models.CharField(max_length=50)
> date_hired = models.DateTimeField(default=timezone.now)
> date_updated = models.DateTimeField(auto_now=True)
> date_terminated = models.DateTimeField(default=None)
> is_active = models.BooleanField(default='1')
> status = models.SmallIntegerField(default=0)
> emp_is_salary = models.BooleanField(default='0')
> emp_pto_rate = models.FloatField(2, 6)
> emp_user_level = models.SmallIntegerField(default=1)
> emerg_contact1 = models.CharField(max_length=100)
> emerg_contact1_phone = models.CharField(max_length=20)
> emerg_contact1_address = models.CharField(max_length=200)
> emerg_contact1_city_st = models.CharField(max_length=200)
> emerg_contact2 = models.CharField(max_length=100)
> emerg_contact2_phone = models.CharField(max_length=20)
> emerg_contact2_address = models.CharField(max_length=200)
> emerg_contact2_city_st = models.CharField(max_length=200)
> emp_note = models.TextField()
> emp_hourly_rate = models.FloatField(2, 2)
> emp_net_pto = models.FloatField(2, 8)
> emp_pto_prev = models.FloatField(2, 8)
>
> def __str__(self):
> return self.first_name
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7db76f08-9a55-40f6-b795-7f5e26b06b09n%40googlegroups.com.


Make permissions according branch id

2021-06-12 Thread wael muhammed

I want to make permissions according branch id
 for more details 


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4f7ca371-4a5c-4ee9-88f7-53fd72a15e4an%40googlegroups.com.


User matching query does not exist.

2021-06-12 Thread Shilpa Agrawal
Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/addToCart/1

Django Version: 3.2.3
Python Version: 3.9.1
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'MusicalApp.apps.MusicalappConfig',
 'CartApp.apps.CartappConfig']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']



Traceback (most recent call last):
  File 
"D:\DjangoDemos\venv\lib\site-packages\django\core\handlers\exception.py", 
line 47, in inner
response = get_response(request)
  File 
"D:\DjangoDemos\venv\lib\site-packages\django\core\handlers\base.py", line 
181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "D:\DjangoDemos\CartApp\views.py", line 15, in addToCart
user = User.objects.get(id=uid)
  File "D:\DjangoDemos\venv\lib\site-packages\django\db\models\manager.py", 
line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "D:\DjangoDemos\venv\lib\site-packages\django\db\models\query.py", 
line 435, in get
raise self.model.DoesNotExist(

Exception Type: DoesNotExist at /addToCart/1
Exception Value: User matching query does not exist.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/879bff80-9f96-445c-a46f-7ca28f0c62f4n%40googlegroups.com.


Re: IndexError at /

2021-06-12 Thread Nikeet NA
Your list is empty check for it then return count as 0 if the list is not
empty  then return qs[0].items.count()

On Sat, 12 Jun 2021 at 02:55, Jacob Greene 
wrote:

> The backtrace is pretty clear..
>
> Here's the import part:
>  File "C:\Users\GEMINI INNOVATIONS\Documents\WEB DEV TUTOR FULL
> STACK\django_project_boilerplate-master\ECOMMERCE\core\templatetags\cart_template_tags.py",
> line 13, in cart_item_count return qs[0].items.count()
>
> "qs" is probably an empty list and you are trying access the 1st item via
> qs[0]
>
> I'd consider posting future questions not in all caps. Really weird post
> dude.
>
>
> On Fri, Jun 11, 2021 at 2:14 PM Tayo Akinnayajo 
> wrote:
>
>> PLS IM WORKING ON THIS CAN ANYONE HELP FIX THE ERROR
>>
>> Environment: Request Method: GET Request URL: http://127.0.0.1:8000/ Django
>> Version: 3.1.4 Python Version: 3.9.0 Installed Applications: 
>> ['django.contrib.admin',
>> 'django.contrib.auth', 'django.contrib.contenttypes', 
>> 'django.contrib.sessions',
>> 'django.contrib.messages', 'django.contrib.staticfiles', 
>> 'django.contrib.sites',
>> 'allauth', 'allauth.account', 'allauth.socialaccount', 'core', 
>> 'crispy_forms',
>> 'django_countries'] Installed Middleware: 
>> ['django.middleware.security.SecurityMiddleware',
>> 'django.contrib.sessions.middleware.SessionMiddleware', 
>> 'django.middleware.common.CommonMiddleware',
>> 'django.middleware.csrf.CsrfViewMiddleware', 
>> 'django.contrib.auth.middleware.AuthenticationMiddleware',
>> 'django.contrib.messages.middleware.MessageMiddleware', 
>> 'django.middleware.clickjacking.XFrameOptionsMiddleware']
>> Template error: In template C:\Users\GEMINI INNOVATIONS\Documents\WEB
>> DEV TUTOR FULL
>> STACK\django_project_boilerplate-master\ECOMMERCE\templates\navbar.html,
>> error at line 41 list index out of range 31 :  32 :
>> > target="_blank">Checkout 33 :  --> 34 :  35 : 36 :  37 :  38 : {% if
>> request.user.is_authenticated %} 39 :  40 : > href="{% url 'core:order-summary' %}" class="nav-link waves-effect"> 41
>> :  42 :  43
>> :  Cart  44 :
>>  45 :  46 :  47 :  48 : > class="clearfix d-none d-sm-inline-block"> Logout  49 :  50 :
>>  51 : {% else %} Traceback (most recent call last): File
>> "C:\Users\GEMINI
>> INNOVATIONS\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\handlers\exception.py",
>> line 47, in inner response = get_response(request) File "C:\Users\GEMINI
>> INNOVATIONS\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\handlers\base.py",
>> line 202, in _get_response response = response.render() File
>> "C:\Users\GEMINI
>> INNOVATIONS\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\response.py",
>> line 105, in render self.content = self.rendered_content File
>> "C:\Users\GEMINI
>> INNOVATIONS\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\response.py",
>> line 83, in rendered_content return template.render(context,
>> self._request) File "C:\Users\GEMINI
>> INNOVATIONS\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\backends\django.py",
>> line 61, in render return self.template.render(context) File
>> "C:\Users\GEMINI
>> INNOVATIONS\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\base.py",
>> line 170, in render return self._render(context) File "C:\Users\GEMINI
>> INNOVATIONS\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\base.py",
>> line 162, in _render return self.nodelist.render(context) File
>> "C:\Users\GEMINI
>> INNOVATIONS\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\base.py",
>> line 938, in render bit = node.render_annotated(context) File
>> "C:\Users\GEMINI
>> INNOVATIONS\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\base.py",
>> line 905, in render_annotated return self.render(context) File
>> "C:\Users\GEMINI
>> INNOVATIONS\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\loader_tags.py",
>> line 150, in render return compiled_parent._render(context) File
>> "C:\Users\GEMINI
>> INNOVATIONS\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\base.py",
>> line 162, in _render return self.nodelist.render(context) File
>> "C:\Users\GEMINI
>> INNOVATIONS\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\base.py",
>> line 938, in render bit = node.render_annotated(context) File
>> "C:\Users\GEMINI
>> INNOVATIONS\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\base.py",
>> line 905, in render_annotated return self.render(context) File
>> "C:\Users\GEMINI
>> INNOVATIONS\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\loader_tags.py",
>> line 192, in render return template.render(context) File
>> "C:\Users\GEMINI
>> INNOVATIONS\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\base.py",
>> line 172, in render return self._render(context) File 

I am using django with DRF and dj_rest_auth

2021-06-12 Thread Manas Paul

I have made my custom user model. The dj_rest_auth returning the response 
after successfull login 
{ "access_token": 
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjIzdXJfaWQiOjZ9.4yjIBxXhe5grxCe18huamgj1qP44A-zOkUHxZ61wXao"
, "refresh_token": 
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTYyMzU2OTMzNiwianRpIjoiODFlYzdkNjVjZjQzNDI4NjlhYjYzODI4MWUxNDQ4MjUiLCJ1c2VyX2lkIjo2fQ.1p3_Vw8OYoa64B93wHiEEiyKH3oT8M-3FGrivZmvWaA"
, 
"user": { "pk": 6, "email": "userem...@gmail.com" } }

I want the user object to have all the fields that I have defined. I could 
not get the way how I can achieve that. 

Here is the repo
https://github.com/imanaspaul/server-cg/

another problem I am getting I can register the user but when I am trying 
to login it says I can't login with the credentials [ "Unable to log in 
with provided credentials."]

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fc55fb68-9745-4f32-9be3-1c27c038123fn%40googlegroups.com.


Feature request for django permissions

2021-06-12 Thread wael muhammed

I have a projects with multi branches . I want to make permissions 
according to branch record.
I couldn't add customize django permissions model to make foreign key  from 
branch model.
Look here 

 
for more details

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/41fd6fb3-920a-4ba7-8c2e-d2216793b83dn%40googlegroups.com.


Re: django cron Job Functionality

2021-06-12 Thread Ayser shuhaib
I’m sorry for that.
This is the video I meant to send you

https://youtu.be/1vrQIdMF4LY


On Sat, 12 Jun 2021 at 09:14, Eugene TUYIZERE 
wrote:

> Dear Ayser,
>
> You may be sent the wrong video. The video you sent is unrelated. Please
> give me the correct one.
>
> regards,
>
> On Sat, 12 Jun 2021 at 08:56, Ayser shuhaib 
> wrote:
>
>> Watch this video on how to schedule a task or function in your Django
>> project, I’m sure it will have the answer to your question:
>>
>> https://youtu.be/t0xHlgWQvAk
>>
>>
>> On Sat, 12 Jun 2021 at 08:54, Ayser shuhaib 
>> wrote:
>>
>>> https://youtu.be/t0xHlgWQvAk
>>>
>>>
>>> On Sat, 12 Jun 2021 at 08:53, Ayser shuhaib 
>>> wrote:
>>>
 Watch this video on how to schedule a task or function in your Django
 project, I’m sure it will have the answer to your question:




 On Sat, 12 Jun 2021 at 08:41, Eugene TUYIZERE 
 wrote:

> Thank you for recommendations,
>
> Because I never use this Celery-beat, if possible you can give some
> sample for example for someone who used it before
>
> thanks
>
> On Sat, 12 Jun 2021 at 06:36, Nikeet NA 
> wrote:
>
>> You should use celery for running cron jobs.
>>
>> On Friday, 11 June 2021 at 19:49:41 UTC+5:30 kells...@gmail.com
>> wrote:
>>
>>>
>>> What I would do in such case, is to write a function somewhere that
>>> checks if a user applied for a leave, then check if the leave time is
>>> within a day, then do whatever you want, like setting is_active to 
>>> False.
>>> Then set the cron job to run this function every day, every hour, or
>>> however you'd like.
>>> On Fri, Jun 11, 2021 at 15:10 Chetan Ganji 
>>> wrote:
>>>
 This will help you

 https://pypi.org/project/django-celery-beat/


 On Fri, Jun 11, 2021, 5:34 PM Eugene TUYIZERE 
 wrote:

> Dear Team,
>
> In my application, I want a user to set for example a leave plan
> in the system and the system notify the user by email for example one 
> day
> before the start leave date. At the same time the system disables the 
> user
> in the system. Here I have a field *is_active *and I want the
> system to set it to False from the leave date to the end date. And 
> also to
> set Ongoing status on the leave plan user list. I heard somewhere that
> Django Cron Job can do this but I never use it and I do not know how 
> to use
> it in the application.
> If someone has used  it for some time please I need help.
>
> Thank you
>
> --
> *Eugene*
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CABxpZHt2hqPgNU%2BvyDb8Eua%2B6_OMM8H6xsMzTgJ-73-0erfmKw%40mail.gmail.com
> 
> .
>
 --
 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 view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CAMKMUjvErhZDkdA1ZYPOxHq4yuEWk%3DKUsbrgSyX3LOm7FBhFyw%40mail.gmail.com
 
 .

>>> --
>>> KeLLs
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/bf837066-b07b-47fb-a404-098b64516ec0n%40googlegroups.com
>> 
>> .
>>
>
>
> --
> *TUYIZERE Eugene*
>
>
>
> *Msc Degree in Mathematical Science*
>
> *African Institute for Mathematical Sciences (AIMS Cameroon)Crystal
> Garden-Lime, Cameroon*
>
> Bsc in Computer Science
>
> *UR-Nyagatare Campus*
>
> Email: eugene.tuyiz...@aims-cameroon.org
>

Re: django cron Job Functionality

2021-06-12 Thread Eugene TUYIZERE
Dear Ayser,

You may be sent the wrong video. The video you sent is unrelated. Please
give me the correct one.

regards,

On Sat, 12 Jun 2021 at 08:56, Ayser shuhaib 
wrote:

> Watch this video on how to schedule a task or function in your Django
> project, I’m sure it will have the answer to your question:
>
> https://youtu.be/t0xHlgWQvAk
>
>
> On Sat, 12 Jun 2021 at 08:54, Ayser shuhaib 
> wrote:
>
>> https://youtu.be/t0xHlgWQvAk
>>
>>
>> On Sat, 12 Jun 2021 at 08:53, Ayser shuhaib 
>> wrote:
>>
>>> Watch this video on how to schedule a task or function in your Django
>>> project, I’m sure it will have the answer to your question:
>>>
>>>
>>>
>>>
>>> On Sat, 12 Jun 2021 at 08:41, Eugene TUYIZERE 
>>> wrote:
>>>
 Thank you for recommendations,

 Because I never use this Celery-beat, if possible you can give some
 sample for example for someone who used it before

 thanks

 On Sat, 12 Jun 2021 at 06:36, Nikeet NA 
 wrote:

> You should use celery for running cron jobs.
>
> On Friday, 11 June 2021 at 19:49:41 UTC+5:30 kells...@gmail.com wrote:
>
>>
>> What I would do in such case, is to write a function somewhere that
>> checks if a user applied for a leave, then check if the leave time is
>> within a day, then do whatever you want, like setting is_active to False.
>> Then set the cron job to run this function every day, every hour, or
>> however you'd like.
>> On Fri, Jun 11, 2021 at 15:10 Chetan Ganji 
>> wrote:
>>
>>> This will help you
>>>
>>> https://pypi.org/project/django-celery-beat/
>>>
>>>
>>> On Fri, Jun 11, 2021, 5:34 PM Eugene TUYIZERE 
>>> wrote:
>>>
 Dear Team,

 In my application, I want a user to set for example a leave plan in
 the system and the system notify the user by email for example one day
 before the start leave date. At the same time the system disables the 
 user
 in the system. Here I have a field *is_active *and I want the
 system to set it to False from the leave date to the end date. And 
 also to
 set Ongoing status on the leave plan user list. I heard somewhere that
 Django Cron Job can do this but I never use it and I do not know how 
 to use
 it in the application.
 If someone has used  it for some time please I need help.

 Thank you

 --
 *Eugene*

 --
 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 view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CABxpZHt2hqPgNU%2BvyDb8Eua%2B6_OMM8H6xsMzTgJ-73-0erfmKw%40mail.gmail.com
 
 .

>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAMKMUjvErhZDkdA1ZYPOxHq4yuEWk%3DKUsbrgSyX3LOm7FBhFyw%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> KeLLs
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/bf837066-b07b-47fb-a404-098b64516ec0n%40googlegroups.com
> 
> .
>


 --
 *TUYIZERE Eugene*



 *Msc Degree in Mathematical Science*

 *African Institute for Mathematical Sciences (AIMS Cameroon)Crystal
 Garden-Lime, Cameroon*

 Bsc in Computer Science

 *UR-Nyagatare Campus*

 Email: eugene.tuyiz...@aims-cameroon.org
eugenetuyiz...@gmail.com

 Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38

 --
 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 

Re: django cron Job Functionality

2021-06-12 Thread Lalit Suthar
https://medium.com/@yedjoe/celery-4-periodic-task-in-django-9f6b5a8c21c7
http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html
http://docs.celeryproject.org/en/latest/userguide/index.html#guide
https://www.agiliq.com/blog/2015/07/getting-started-with-celery-and-redis/

On Sat, 12 Jun 2021 at 12:26, Ayser shuhaib 
wrote:

> Watch this video on how to schedule a task or function in your Django
> project, I’m sure it will have the answer to your question:
>
> https://youtu.be/t0xHlgWQvAk
>
>
> On Sat, 12 Jun 2021 at 08:54, Ayser shuhaib 
> wrote:
>
>> https://youtu.be/t0xHlgWQvAk
>>
>>
>> On Sat, 12 Jun 2021 at 08:53, Ayser shuhaib 
>> wrote:
>>
>>> Watch this video on how to schedule a task or function in your Django
>>> project, I’m sure it will have the answer to your question:
>>>
>>>
>>>
>>>
>>> On Sat, 12 Jun 2021 at 08:41, Eugene TUYIZERE 
>>> wrote:
>>>
 Thank you for recommendations,

 Because I never use this Celery-beat, if possible you can give some
 sample for example for someone who used it before

 thanks

 On Sat, 12 Jun 2021 at 06:36, Nikeet NA 
 wrote:

> You should use celery for running cron jobs.
>
> On Friday, 11 June 2021 at 19:49:41 UTC+5:30 kells...@gmail.com wrote:
>
>>
>> What I would do in such case, is to write a function somewhere that
>> checks if a user applied for a leave, then check if the leave time is
>> within a day, then do whatever you want, like setting is_active to False.
>> Then set the cron job to run this function every day, every hour, or
>> however you'd like.
>> On Fri, Jun 11, 2021 at 15:10 Chetan Ganji 
>> wrote:
>>
>>> This will help you
>>>
>>> https://pypi.org/project/django-celery-beat/
>>>
>>>
>>> On Fri, Jun 11, 2021, 5:34 PM Eugene TUYIZERE 
>>> wrote:
>>>
 Dear Team,

 In my application, I want a user to set for example a leave plan in
 the system and the system notify the user by email for example one day
 before the start leave date. At the same time the system disables the 
 user
 in the system. Here I have a field *is_active *and I want the
 system to set it to False from the leave date to the end date. And 
 also to
 set Ongoing status on the leave plan user list. I heard somewhere that
 Django Cron Job can do this but I never use it and I do not know how 
 to use
 it in the application.
 If someone has used  it for some time please I need help.

 Thank you

 --
 *Eugene*

 --
 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 view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CABxpZHt2hqPgNU%2BvyDb8Eua%2B6_OMM8H6xsMzTgJ-73-0erfmKw%40mail.gmail.com
 
 .

>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAMKMUjvErhZDkdA1ZYPOxHq4yuEWk%3DKUsbrgSyX3LOm7FBhFyw%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> KeLLs
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/bf837066-b07b-47fb-a404-098b64516ec0n%40googlegroups.com
> 
> .
>


 --
 *TUYIZERE Eugene*



 *Msc Degree in Mathematical Science*

 *African Institute for Mathematical Sciences (AIMS Cameroon)Crystal
 Garden-Lime, Cameroon*

 Bsc in Computer Science

 *UR-Nyagatare Campus*

 Email: eugene.tuyiz...@aims-cameroon.org
eugenetuyiz...@gmail.com

 Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38

 --
 You received this message because you are 

Re: django cron Job Functionality

2021-06-12 Thread Ayser shuhaib
Watch this video on how to schedule a task or function in your Django
project, I’m sure it will have the answer to your question:

https://youtu.be/t0xHlgWQvAk


On Sat, 12 Jun 2021 at 08:54, Ayser shuhaib 
wrote:

> https://youtu.be/t0xHlgWQvAk
>
>
> On Sat, 12 Jun 2021 at 08:53, Ayser shuhaib 
> wrote:
>
>> Watch this video on how to schedule a task or function in your Django
>> project, I’m sure it will have the answer to your question:
>>
>>
>>
>>
>> On Sat, 12 Jun 2021 at 08:41, Eugene TUYIZERE 
>> wrote:
>>
>>> Thank you for recommendations,
>>>
>>> Because I never use this Celery-beat, if possible you can give some
>>> sample for example for someone who used it before
>>>
>>> thanks
>>>
>>> On Sat, 12 Jun 2021 at 06:36, Nikeet NA  wrote:
>>>
 You should use celery for running cron jobs.

 On Friday, 11 June 2021 at 19:49:41 UTC+5:30 kells...@gmail.com wrote:

>
> What I would do in such case, is to write a function somewhere that
> checks if a user applied for a leave, then check if the leave time is
> within a day, then do whatever you want, like setting is_active to False.
> Then set the cron job to run this function every day, every hour, or
> however you'd like.
> On Fri, Jun 11, 2021 at 15:10 Chetan Ganji 
> wrote:
>
>> This will help you
>>
>> https://pypi.org/project/django-celery-beat/
>>
>>
>> On Fri, Jun 11, 2021, 5:34 PM Eugene TUYIZERE 
>> wrote:
>>
>>> Dear Team,
>>>
>>> In my application, I want a user to set for example a leave plan in
>>> the system and the system notify the user by email for example one day
>>> before the start leave date. At the same time the system disables the 
>>> user
>>> in the system. Here I have a field *is_active *and I want the
>>> system to set it to False from the leave date to the end date. And also 
>>> to
>>> set Ongoing status on the leave plan user list. I heard somewhere that
>>> Django Cron Job can do this but I never use it and I do not know how to 
>>> use
>>> it in the application.
>>> If someone has used  it for some time please I need help.
>>>
>>> Thank you
>>>
>>> --
>>> *Eugene*
>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CABxpZHt2hqPgNU%2BvyDb8Eua%2B6_OMM8H6xsMzTgJ-73-0erfmKw%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAMKMUjvErhZDkdA1ZYPOxHq4yuEWk%3DKUsbrgSyX3LOm7FBhFyw%40mail.gmail.com
>> 
>> .
>>
> --
> KeLLs
>
 --
 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 view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/bf837066-b07b-47fb-a404-098b64516ec0n%40googlegroups.com
 
 .

>>>
>>>
>>> --
>>> *TUYIZERE Eugene*
>>>
>>>
>>>
>>> *Msc Degree in Mathematical Science*
>>>
>>> *African Institute for Mathematical Sciences (AIMS Cameroon)Crystal
>>> Garden-Lime, Cameroon*
>>>
>>> Bsc in Computer Science
>>>
>>> *UR-Nyagatare Campus*
>>>
>>> Email: eugene.tuyiz...@aims-cameroon.org
>>>eugenetuyiz...@gmail.com
>>>
>>> Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38
>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CABxpZHtA5wbnggeqJCPbO_LRseiXMj8KymkwDiuaY_QX2VNKuw%40mail.gmail.com
>>> 

Re: django cron Job Functionality

2021-06-12 Thread Ayser shuhaib
https://youtu.be/t0xHlgWQvAk


On Sat, 12 Jun 2021 at 08:53, Ayser shuhaib 
wrote:

> Watch this video on how to schedule a task or function in your Django
> project, I’m sure it will have the answer to your question:
>
>
>
>
> On Sat, 12 Jun 2021 at 08:41, Eugene TUYIZERE 
> wrote:
>
>> Thank you for recommendations,
>>
>> Because I never use this Celery-beat, if possible you can give some
>> sample for example for someone who used it before
>>
>> thanks
>>
>> On Sat, 12 Jun 2021 at 06:36, Nikeet NA  wrote:
>>
>>> You should use celery for running cron jobs.
>>>
>>> On Friday, 11 June 2021 at 19:49:41 UTC+5:30 kells...@gmail.com wrote:
>>>

 What I would do in such case, is to write a function somewhere that
 checks if a user applied for a leave, then check if the leave time is
 within a day, then do whatever you want, like setting is_active to False.
 Then set the cron job to run this function every day, every hour, or
 however you'd like.
 On Fri, Jun 11, 2021 at 15:10 Chetan Ganji  wrote:

> This will help you
>
> https://pypi.org/project/django-celery-beat/
>
>
> On Fri, Jun 11, 2021, 5:34 PM Eugene TUYIZERE 
> wrote:
>
>> Dear Team,
>>
>> In my application, I want a user to set for example a leave plan in
>> the system and the system notify the user by email for example one day
>> before the start leave date. At the same time the system disables the 
>> user
>> in the system. Here I have a field *is_active *and I want the system
>> to set it to False from the leave date to the end date. And also to set
>> Ongoing status on the leave plan user list. I heard somewhere that Django
>> Cron Job can do this but I never use it and I do not know how to use it 
>> in
>> the application.
>> If someone has used  it for some time please I need help.
>>
>> Thank you
>>
>> --
>> *Eugene*
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CABxpZHt2hqPgNU%2BvyDb8Eua%2B6_OMM8H6xsMzTgJ-73-0erfmKw%40mail.gmail.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMKMUjvErhZDkdA1ZYPOxHq4yuEWk%3DKUsbrgSyX3LOm7FBhFyw%40mail.gmail.com
> 
> .
>
 --
 KeLLs

>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/bf837066-b07b-47fb-a404-098b64516ec0n%40googlegroups.com
>>> 
>>> .
>>>
>>
>>
>> --
>> *TUYIZERE Eugene*
>>
>>
>>
>> *Msc Degree in Mathematical Science*
>>
>> *African Institute for Mathematical Sciences (AIMS Cameroon)Crystal
>> Garden-Lime, Cameroon*
>>
>> Bsc in Computer Science
>>
>> *UR-Nyagatare Campus*
>>
>> Email: eugene.tuyiz...@aims-cameroon.org
>>eugenetuyiz...@gmail.com
>>
>> Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CABxpZHtA5wbnggeqJCPbO_LRseiXMj8KymkwDiuaY_QX2VNKuw%40mail.gmail.com
>> 
>> .
>>
>

-- 
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 view this discussion on the web visit 

Re: django cron Job Functionality

2021-06-12 Thread Ayser shuhaib
Watch this video on how to schedule a task or function in your Django
project, I’m sure it will have the answer to your question:




On Sat, 12 Jun 2021 at 08:41, Eugene TUYIZERE 
wrote:

> Thank you for recommendations,
>
> Because I never use this Celery-beat, if possible you can give some sample
> for example for someone who used it before
>
> thanks
>
> On Sat, 12 Jun 2021 at 06:36, Nikeet NA  wrote:
>
>> You should use celery for running cron jobs.
>>
>> On Friday, 11 June 2021 at 19:49:41 UTC+5:30 kells...@gmail.com wrote:
>>
>>>
>>> What I would do in such case, is to write a function somewhere that
>>> checks if a user applied for a leave, then check if the leave time is
>>> within a day, then do whatever you want, like setting is_active to False.
>>> Then set the cron job to run this function every day, every hour, or
>>> however you'd like.
>>> On Fri, Jun 11, 2021 at 15:10 Chetan Ganji  wrote:
>>>
 This will help you

 https://pypi.org/project/django-celery-beat/


 On Fri, Jun 11, 2021, 5:34 PM Eugene TUYIZERE 
 wrote:

> Dear Team,
>
> In my application, I want a user to set for example a leave plan in
> the system and the system notify the user by email for example one day
> before the start leave date. At the same time the system disables the user
> in the system. Here I have a field *is_active *and I want the system
> to set it to False from the leave date to the end date. And also to set
> Ongoing status on the leave plan user list. I heard somewhere that Django
> Cron Job can do this but I never use it and I do not know how to use it in
> the application.
> If someone has used  it for some time please I need help.
>
> Thank you
>
> --
> *Eugene*
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CABxpZHt2hqPgNU%2BvyDb8Eua%2B6_OMM8H6xsMzTgJ-73-0erfmKw%40mail.gmail.com
> 
> .
>
 --
 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 view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CAMKMUjvErhZDkdA1ZYPOxHq4yuEWk%3DKUsbrgSyX3LOm7FBhFyw%40mail.gmail.com
 
 .

>>> --
>>> KeLLs
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/bf837066-b07b-47fb-a404-098b64516ec0n%40googlegroups.com
>> 
>> .
>>
>
>
> --
> *TUYIZERE Eugene*
>
>
>
> *Msc Degree in Mathematical Science*
>
> *African Institute for Mathematical Sciences (AIMS Cameroon)Crystal
> Garden-Lime, Cameroon*
>
> Bsc in Computer Science
>
> *UR-Nyagatare Campus*
>
> Email: eugene.tuyiz...@aims-cameroon.org
>eugenetuyiz...@gmail.com
>
> Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CABxpZHtA5wbnggeqJCPbO_LRseiXMj8KymkwDiuaY_QX2VNKuw%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAE0AZG%2B%2Bz-QcJn8N5NqMFWDrGX3OAwZHcKE6hUSkKYNmFj7-qA%40mail.gmail.com.


Re: django cron Job Functionality

2021-06-12 Thread Eugene TUYIZERE
Thank you for recommendations,

Because I never use this Celery-beat, if possible you can give some sample
for example for someone who used it before

thanks

On Sat, 12 Jun 2021 at 06:36, Nikeet NA  wrote:

> You should use celery for running cron jobs.
>
> On Friday, 11 June 2021 at 19:49:41 UTC+5:30 kells...@gmail.com wrote:
>
>>
>> What I would do in such case, is to write a function somewhere that
>> checks if a user applied for a leave, then check if the leave time is
>> within a day, then do whatever you want, like setting is_active to False.
>> Then set the cron job to run this function every day, every hour, or
>> however you'd like.
>> On Fri, Jun 11, 2021 at 15:10 Chetan Ganji  wrote:
>>
>>> This will help you
>>>
>>> https://pypi.org/project/django-celery-beat/
>>>
>>>
>>> On Fri, Jun 11, 2021, 5:34 PM Eugene TUYIZERE 
>>> wrote:
>>>
 Dear Team,

 In my application, I want a user to set for example a leave plan in the
 system and the system notify the user by email for example one day before
 the start leave date. At the same time the system disables the user in the
 system. Here I have a field *is_active *and I want the system to set
 it to False from the leave date to the end date. And also to set Ongoing
 status on the leave plan user list. I heard somewhere that Django Cron Job
 can do this but I never use it and I do not know how to use it in the
 application.
 If someone has used  it for some time please I need help.

 Thank you

 --
 *Eugene*

 --
 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 view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CABxpZHt2hqPgNU%2BvyDb8Eua%2B6_OMM8H6xsMzTgJ-73-0erfmKw%40mail.gmail.com
 
 .

>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAMKMUjvErhZDkdA1ZYPOxHq4yuEWk%3DKUsbrgSyX3LOm7FBhFyw%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> KeLLs
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/bf837066-b07b-47fb-a404-098b64516ec0n%40googlegroups.com
> 
> .
>


-- 
*TUYIZERE Eugene*



*Msc Degree in Mathematical Science*

*African Institute for Mathematical Sciences (AIMS Cameroon)Crystal
Garden-Lime, Cameroon*

Bsc in Computer Science

*UR-Nyagatare Campus*

Email: eugene.tuyiz...@aims-cameroon.org
   eugenetuyiz...@gmail.com

Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABxpZHtA5wbnggeqJCPbO_LRseiXMj8KymkwDiuaY_QX2VNKuw%40mail.gmail.com.