Django-annotate(),Count()

2023-01-12 Thread Priya
Hi Everyone,

This is the output i get used this code 

https://groups.google.com/d/msgid/django-users/95dedc5d-5f24-4b57-b525-248c01953bddn%40googlegroups.com.


Re: Modeform Foreign key column not working

2021-10-26 Thread Aruna Priya Nagarajan
Hi,

I am trying to save the model form and getting error that foreign key 
column is not there. 

*Error:*
column "connection_type_id" of relation "connection_details_test" does not 
exist ( There is no column connection_type_id, why its looking for this 
column, should I change my model?)

*Models:*
*==*

class ConnectionTypes(models.Model):
 * connection_type_id *= 
*models.IntegerField(primary_key=True,default=re_sequence('connection_type_seq'))*
  connection_type_name = models.CharField(max_length=100)
  connection_type_desc = models.CharField(max_length=300)
  connection_type_category = models.CharField(max_length=100)
  last_update_date = models.DateTimeField(default=dbcurr_ts)

  class Meta: 
managed = False
db_table ='connection_types_test'
verbose_name = 'connection_types_test'
verbose_name_plural = 'connection_types_test'

  def __str__(self):
return str(self.connection_type_id)



class ConnectionDetails(models.Model):
  connection_id = 
models.IntegerField(primary_key=True,default=re_sequence('connection_seq'))
  connection_name = models.CharField(max_length=200)
  
*connection_type = models.ForeignKey(ConnectionTypes, on_delete=models.CASCADE)*
  endpoint = models.CharField(max_length=100)
  port = models.IntegerField()
  login_id = models.CharField(max_length=100)
  login_password = fields.CharPGPPublicKeyField(max_length=100)
  connection_string_1 = fields.CharPGPPublicKeyField(max_length=100)
  connection_string_2 = fields.CharPGPPublicKeyField(max_length=100)
  connection_string_3 = fields.CharPGPPublicKeyField(max_length=100)
  aws_region = models.CharField(max_length=20)
  owner_id = models.IntegerField()
  last_update_date = models.DateTimeField(default=dbcurr_ts)
  working_schema = models.CharField(max_length=100)
  service = models.CharField(max_length=100)

  def generate_enc(mystrenc):
  return 'pass'

  class Meta:
managed = False
db_table = 'connection_details_test'
verbose_name = 'connection_details_test'
verbose_name_plural = 'connection_details_test'

*Model Form :*
*==*

class ConnectionForm(forms.ModelForm):

login_password = forms.CharField(widget=forms.PasswordInput())
owner_id = forms.IntegerField(widget=forms.HiddenInput(), required=False)

class Meta:
model = ConnectionDetails
exclude = ['connection_id','last_update_date']


*View.py*
*==*
def addconnection(request):
connectionform = ConnectionForm(request.POST or None)
if connectionform.is_valid():
ownerqs = AuthUser.objects.values('id').get(username = 
request.user.username)
connectionform.cleaned_data['owner_id'] = int(ownerqs['id'])
connectionform.save()
messages.success(request, f"sucess!")
else:
messages.success(request, f"Failure!")
return render(request,'main/ssaddconnection.html',{"cform":

connectionform,"CanUseMod":UserModules.objects.filter(user_id=request.user.id).filter(module_id=1).count(),"UserIsAuth":request.user.is_authenticated})

Anyone can help me on this??

Thanks,
Aruna 
On Saturday, 23 October 2021 at 18:53:38 UTC+1 sutharl...@gmail.com wrote:

> cool! mention not :)
>
> On Thu, 21 Oct 2021 at 19:57, Aruna Priya Nagarajan <
> arunapriya...@gmail.com> wrote:
>
>>
>> yeah, it is a foreign key and I have put integer field instead of foreign 
>> key in the model. I changed it now and its working by itself without 
>> specifying ModelChoiceField. 
>>
>> Thanks for your help!! 
>>
>>
>> On Wednesday, 20 October 2021 at 16:07:04 UTC+1 sutharl...@gmail.com 
>> wrote:
>>
>>> is `ConnectionTypes` a foreign key to `ConnectionDetails`?
>>> in that case you don't need to put it as a field in form, it will be 
>>> added automatically in the form. 
>>> On Wednesday, 20 October 2021 at 18:47:44 UTC+5:30 Aruna Priya wrote:
>>>
>>>> Hi,
>>>>
>>>> I am trying to create a form from model and the model has a foreign key 
>>>> and am not able to populate the values from the column it refers to.
>>>>
>>>> My form,
>>>>
>>>> class ConnectionForm(forms.ModelForm):
>>>>
>>>>  connection_type = 
>>>> forms.ModelChoiceField(queryset=ConnectionTypes.objects.all(), 
>>>> to_field_name='connection_type_id')
>>>>
>>>> class Meta:
>>>> model = ConnectionDetails
>>>> exclude = ['connection_id','last_update_date']
>>>>
>>>>
>>>> -- 
>> You received this m

Re: Modeform Foreign key column not working

2021-10-21 Thread Aruna Priya Nagarajan

yeah, it is a foreign key and I have put integer field instead of foreign 
key in the model. I changed it now and its working by itself without 
specifying ModelChoiceField. 

Thanks for your help!! 


On Wednesday, 20 October 2021 at 16:07:04 UTC+1 sutharl...@gmail.com wrote:

> is `ConnectionTypes` a foreign key to `ConnectionDetails`?
> in that case you don't need to put it as a field in form, it will be added 
> automatically in the form. 
> On Wednesday, 20 October 2021 at 18:47:44 UTC+5:30 Aruna Priya wrote:
>
>> Hi,
>>
>> I am trying to create a form from model and the model has a foreign key 
>> and am not able to populate the values from the column it refers to.
>>
>> My form,
>>
>> class ConnectionForm(forms.ModelForm):
>>
>>  connection_type = 
>> forms.ModelChoiceField(queryset=ConnectionTypes.objects.all(), 
>> to_field_name='connection_type_id')
>>
>> class Meta:
>> model = ConnectionDetails
>> exclude = ['connection_id','last_update_date']
>>
>>
>>

-- 
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/ddb8c862-57fc-4bb0-97a0-f5c235b00a1fn%40googlegroups.com.


Modelform foreign key not working

2021-10-20 Thread Aruna Priya Nagarajan
Am new to django, and I am trying to create a form using modelform. The 
form has foerign key value (connection_type below in forms.py) and its not 
displaying the values it is referring to.

For the image below, the columns,
Connection name : displayed
Connection type : text box has not appeared
Endpoint : displayed 
 
[image: Capture.JPG]  
*forms.py*
**
class ConnectionForm(forms.ModelForm):

connection_type = 
*forms.ModelChoiceField(queryset=ConnectionTypes.objects.all(), 
to_field_name='connection_type_id')*

class Meta:
model = ConnectionDetails
exclude = ['connection_id','last_update_date']

*Models.py*
*==*

class ConnectionDetails(models.Model):
  connection_id = 
models.IntegerField(primary_key=True,default=re_sequence('connection_seq'))
  connection_name = models.CharField(max_length=200)
*  connection_type = models.IntegerField() *
  endpoint = models.CharField(max_length=100)
  port = models.IntegerField()
  login_id = models.CharField(max_length=100)
  login_password = fields.CharPGPPublicKeyField(max_length=100)
  connection_string_1 = fields.CharPGPPublicKeyField(max_length=100)
  connection_string_2 = fields.CharPGPPublicKeyField(max_length=100)
  connection_string_3 = fields.CharPGPPublicKeyField(max_length=100)
  aws_region = models.CharField(max_length=20)
  owner_id = models.IntegerField()
  last_update_date = models.DateTimeField(default=dbcurr_ts)
  working_schema = models.CharField(max_length=100)
  service = models.CharField(max_length=100)

  def generate_enc(mystrenc):
  return 'pass'

  class Meta:
managed = False
db_table = 'connection_details'
verbose_name = 'connection_details'
verbose_name_plural = 'connection_details'

class ConnectionTypes(models.Model):
  
*connection_type_id = 
models.IntegerField(primary_key=True,default=re_sequence('connection_type_seq'))*
  connection_type_name = models.CharField(max_length=100)
  connection_type_desc = models.CharField(max_length=300)
  connection_type_category = models.CharField(max_length=100)
  last_update_date = models.DateTimeField(default=dbcurr_ts)
  class Meta: 
managed = False
db_table ='connection_types'
verbose_name = 'connection_types'
verbose_name_plural = 'connection_types'

Can you please let me know what is the mistake am making?

Thanks,
Aruna 

-- 
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/a96c90cf-c8bc-48ab-b812-2a3e1c9f9e9fn%40googlegroups.com.


Modeform Foreign key column not working

2021-10-20 Thread Aruna Priya
Hi,

I am trying to create a form from model and the model has a foreign key and 
am not able to populate the values from the column it refers to.

My form,

class ConnectionForm(forms.ModelForm):
 connection_type = 
forms.ModelChoiceField(queryset=ConnectionTypes.objects.all(), 
to_field_name='connection_type_id')

class Meta:
model = ConnectionDetails
exclude = ['connection_id','last_update_date']


-- 
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/f5145780-1a87-451a-a0a3-8f100527499an%40googlegroups.com.


How to add new data column using python script

2021-08-07 Thread Harsha Priya G
Hi Devs,
How to add an additional new column named lat and long and put its data to
it using python tool and clean up the data as the data are overflowing to
next row for particular sno.

-- 
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/CAE6O3o%3Dv28ixutOv%3D36piJfpCbKkLLhApViwo2TOSYvmL%3DRmuA%40mail.gmail.com.


details_madurai.csv
Description: MS-Excel spreadsheet


Re: Django support

2020-07-13 Thread lakshmi priya
Can we connect on cal for discussion


On Mon, 13 Jul 2020 at 5:45 PM, RaviKiran Kk  wrote:

>
>
> On Mon, Jul 13, 2020 at 5:40 PM lakshmi priya <
> priyaviswanadh2...@gmail.com> wrote:
>
>> I’m in need of a tutor who is more than 4 years experienced in Django and
>> who can help me with real time projects with Django framework
>>
>> --
>> 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/999add91-13c5-41c6-9ff6-443f954f15a2o%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/CAPEfQMQ6MkL_KtFQ%2BF5CMj4-NS78f%2BMZ1Gq5H3x7-Gkcv5KW5g%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAPEfQMQ6MkL_KtFQ%2BF5CMj4-NS78f%2BMZ1Gq5H3x7-Gkcv5KW5g%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAGVhxvRDToAKoHnxWZ-1cG%2B-VrEEazO_ExHZ6%2BPuasbq%2BDRXhA%40mail.gmail.com.


Django support

2020-07-13 Thread lakshmi priya
I’m in need of a tutor who is more than 4 years experienced in Django and who 
can help me with real time projects with Django framework 

-- 
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/999add91-13c5-41c6-9ff6-443f954f15a2o%40googlegroups.com.


Re: Tutorials Needed

2019-03-01 Thread priya . dutta
Hi Madhav Rajmohan, 

Try --- Tutorials for Advance python and django by durga prasad. I learnt 
it from there.



On Friday, March 1, 2019 at 12:24:06 AM UTC+5:30, Madhav Rajmohan wrote:
>
> Friends,
> I am Madhav Rajmohan currently pursuing  my Studies in 
> Computer Science, I Need some good beginners* Tutorial for Django.*And at 
> the same time some tutorials* for advanced python*
>
>

-- 
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/0ad64b77-91c6-425c-a2c6-a518ef1d35ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: App not Defined - Getting Started

2018-06-04 Thread Priya
Hi Jamie,

I think you should put single quotes inside include() which expects a path
for your apps(polls) urls.py. So try-

path('polls/',include('polls.urls'))

Hope this helps.

On Tue, 5 Jun 2018, 2:59 a.m. Jaime Escobar,  wrote:

> Hi,
> I am a completely beginner in django and also python programming. I am
> trying to follow the online documentation tutorial in which a poll website
> is created, but just running the server after created the polls it throws
> the error "name 'polls' is not defined".
>
> Can you help me?
>
>
> Unhandled exception in thread started by  check_errors..wrapper at 0x7feeeb74ab70>
> Traceback (most recent call last):
>   File
> "/home/jaime/.local/lib/python3.6/site-packages/django/utils/autoreload.py",
> line 225, in wrapper
> fn(*args, **kwargs)
>   File
> "/home/jaime/.local/lib/python3.6/site-packages/django/core/management/commands/runserver.py",
> line 120, in inner_run
> self.check(display_num_errors=True)
>   File
> "/home/jaime/.local/lib/python3.6/site-packages/django/core/management/base.py",
> line 364, in check
> include_deployment_checks=include_deployment_checks,
>   File
> "/home/jaime/.local/lib/python3.6/site-packages/django/core/management/base.py",
> line 351, in _run_checks
> return checks.run_checks(**kwargs)
>   File
> "/home/jaime/.local/lib/python3.6/site-packages/django/core/checks/registry.py",
> line 73, in run_checks
> new_errors = check(app_configs=app_configs)
>   File
> "/home/jaime/.local/lib/python3.6/site-packages/django/core/checks/urls.py",
> line 40, in check_url_namespaces_unique
> all_namespaces = _load_all_namespaces(resolver)
>   File
> "/home/jaime/.local/lib/python3.6/site-packages/django/core/checks/urls.py",
> line 57, in _load_all_namespaces
> url_patterns = getattr(resolver, 'url_patterns', [])
>   File
> "/home/jaime/.local/lib/python3.6/site-packages/django/utils/functional.py",
> line 36, in __get__
> res = instance.__dict__[self.name] = self.func(instance)
>   File
> "/home/jaime/.local/lib/python3.6/site-packages/django/urls/resolvers.py",
> line 540, in url_patterns
> patterns = getattr(self.urlconf_module, "urlpatterns",
> self.urlconf_module)
>   File
> "/home/jaime/.local/lib/python3.6/site-packages/django/utils/functional.py",
> line 36, in __get__
> res = instance.__dict__[self.name] = self.func(instance)
>   File
> "/home/jaime/.local/lib/python3.6/site-packages/django/urls/resolvers.py",
> line 533, in urlconf_module
> return import_module(self.urlconf_name)
>   File "/usr/lib/python3.6/importlib/__init__.py", line 126, in
> import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 994, in _gcd_import
>   File "", line 971, in _find_and_load
>   File "", line 955, in
> _find_and_load_unlocked
>   File "", line 665, in _load_unlocked
>   File "", line 678, in exec_module
>   File "", line 219, in
> _call_with_frames_removed
>   File "/home/jaime/Projects/Django/mysite/mysite/urls.py", line 20, in
> 
> path('polls/',include(polls.urls)),
> NameError: name 'polls' is not defined
>
> --
> 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/df3c68c4-aa2a-498d-a1ed-840a31acf7a2%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/CAPBHpYD2bvojRHMpJKpyG7PMcvNDzyOr%3Dd3dFtQ729K_NnPUiA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


template_dir , template_loader missing in settings.py

2015-02-25 Thread Priya Panthi
hello all, I am beginner in django..As template_dir , template_loader are 
missing in settings.py, I am facing lots of problems..Please kindly suggest 
how I should include these. It would be a great help. I have spent hours 
sorting it out but in vain..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/dbff6410-b0f8-4c49-acac-b73de0ca9475%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django charts

2010-11-19 Thread Priya
Hi,
I am a new user to django ,can anybody please help me resolve this
issue.I am trying to construct a Gant chart based on the certain
constraints.Now i am unable to make a line of approach for this.I have
defined a class for chart and defined function for it in views.Now how
do i pass my values to the gant chart .
So the idea is..i have n number of task who have deadlines.So i want
to show thiese tasks thru a gant chart and then want to show a pie
chart giving the perfomance eg. 4% work done til so and so date.
Can anybody help me with the coding of all these.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



EARN $250-$500 DAILY

2008-05-30 Thread priya

EARN $250-$500 DAILY
 SIMPLE ONLINE SURVEY
 WORK AT JUST 2 HOURS ONLY
 I EARN DAILY AROUND $350
 CREATE FREE ACCOUNT START YOUR EARNINGS
***
 http://www.AWSurveys.com/HomeMain.cfm?RefID=souravudaya

 http://www.AWSurveys.com/HomeMain.cfm?RefID=souravudaya

 http://www.AWSurveys.com/HomeMain.cfm?RefID=souravudaya
***
 EARN MONEY FROM SERVEYS
  http://www.AWSurveys.com/HomeMain.cfm?RefID=souravudaya
EARN DAILY $500

  http://www.AWSurveys.com/HomeMain.cfm?RefID=souravudaya
EASY MONEY MAKING WORK FROM HOME

  http://www.AWSurveys.com/HomeMain.cfm?RefID=souravudaya

  http://www.AWSurveys.com/HomeMain.cfm?RefID=souravudaya
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---