Django 2.2: how to use to a field "from a foreign model", in a CheckConstraint: ?

2019-11-13 Thread Olivier
Hello,

Let say I want to enforce a database constraint saying a "book's author age 
is over 18".
As you may guess, books and authors are each described with a Model 
subclass with a foreign key (in this example each book is written by a 
single author) linking both.

class Author(models.Model):
age = models.SmallIntegerField()


class Book(models.Model):
author = models.ForeignKey(Author, on_delete=models.PROTECT)

class Meta:
constraints = [
   models.CheckConstraint(check=models.Q(__gt=18), 
name='age_check'),
]


I've tried replacing  above with author_age or author__age.
In both cases, makemigrations works but migrate fails with:
django.core.exceptions.FieldError: Joined field references are not 
permitted in this query


Can I work around this ?
Any working example ?

Best regards

-- 
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/5231c14e-aa1b-4ffd-8b8b-e14d9e042c35%40googlegroups.com.


tengo un problema a la hora de hacer deploying django app to heroku

2019-11-13 Thread jose angel encinas ramos
mas que nada el poblema que tengo es técnico , el detalle es que cuando 
escribo en la terminal git push heroku master me lanza el siguiente error y 
no entiendo cual es el error.

(webapps) ➜  BuscadorTims git:(master) ✗ git push heroku master
Counting objects: 221, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (203/203), done.
Writing objects: 100% (221/221), 2.02 MiB | 1002.00 KiB/s, done.
Total 221 (delta 60), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -> App not compatible with buildpack: 
https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/python.tgz
remote:More info: 
https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote: 
remote:  ! Push failed
remote: Verifying deploy...
remote: 
remote: ! Push rejected to entregastim.
remote: 
To https://git.heroku.com/entregastim.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/entregastim.git'

-- 
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/458db1d6-0a14-498b-b938-76ecfb4a8e40%40googlegroups.com.


RE: Handling blog posts

2019-11-13 Thread Kasper Laudrup
Hi Hedrick,

On 13/11/2019 21.40, Hedrick wrote:
> Anyone with the good links on how handle news/posts on my Blog App.
> Thanks
> 
Unless we have some mind readers on this mailing list, I'm fairly certain no 
one knows what my "Blog App" is.

Maybe share some details and explain what you want to achieve and where you are 
facing problems?

Kind regards,

Kasper Laudrup

-- 
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/2019111320.Horde.0vDL52ArqyMRHoOPvefOxHa%40cloud.stacktrace.dk.


Handling blog posts

2019-11-13 Thread Hedrick
Anyone with the good links on how handle news/posts on my Blog App.
Thanks 

-- 
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/94a26cbe-37fa-4966-a99a-2281c3a4997c%40googlegroups.com.


RE:

2019-11-13 Thread Kasper Laudrup
Hi Paras,

On 13/11/2019 18.17, Paras Jain wrote:
> now i want to generate random password and send it to mail instead of 
> simple message
OK, should be simple enough. Do you have a question or are you just sharing 
your to-do list?

Btw. of course you don't want these passwords that you want to send in clear 
text to be permanent right?

Kind regards,

Kasper Laudrup

-- 
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/20191113224251.Horde.SjihH-Otiy3NF0ZbMs6DQFZ%40cloud.stacktrace.dk.


Migrating MySQL Maria database to Postgres

2019-11-13 Thread Ram
Hi,

We are running a Django development server with MySQL Maria database and we
are planning to migrate the database to postgres for the same development
server. Please let me know if 'pgLoader' would help in this case or any
other option could help?

thanks,
~Ram

-- 
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/CA%2BOi5F0B_DB5pV2WUDZdHbYwApqd%2BZjcM-ww%3DMP8Rhv%3DhdLy0Q%40mail.gmail.com.


Re: reg: Django forms and models

2019-11-13 Thread 'Amitesh Sahay' via Django users
Initially I had written the "else" statement at the wrong place. Moved it under 
the very first "if" and used then returned the HTTPresponse on the right place 
inside the function



Regards,
Amitesh S
 

On Wednesday, 13 November, 2019, 5:42:57 AM IST, o1bigtenor 
 wrote:  
 
 On Tue, Nov 12, 2019 at 12:39 PM 'Amitesh Sahay' via Django users
 wrote:
>
> Hello Kasper,
>
> Thank you for the hint. I found my mistake and resolved it.
>
So what did you do?
(doesn't need to have all the detail just the idea please)

TIA

-- 
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/CAPpdf5_RVtwmN73i5%3Dm2LmBdboYVfHvqY3dJyuqHxYQYbRzB_Q%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/424090062.3213208.1573671943319%40mail.yahoo.com.


django + bootstrap wizard

2019-11-13 Thread dandu sreenivasulu
Hi All,

 can someone please suggest any link or tutorial for django with bootstrap 
wizards.

Thanks in advance.

Regards,
sreenivas

-- 
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/d85d08ea-5463-4010-8382-19760903599e%40googlegroups.com.


[no subject]

2019-11-13 Thread Paras Jain
now i want to generate random password and send it to mail instead of
simple message
views.py:

from django.shortcuts import render
from profilestorer.settings import EMAIL_HOST_USER
from . import forms
from django.core.mail import send_mail


# Create your views here.
def login(request):
form = forms.SignInForm()
return render(request, 'company/login.html', {'form':form})


def register(request):
form = forms.SignUpForm()
if request.method == 'POST':
form = forms.SignUpForm(request.POST)
form.save()
subject = 'welcome to profile storer'
message = 'Hope you find the mail'
recepient = str(form['Email'].value())
send_mail(subject,
message, EMAIL_HOST_USER, [recepient], fail_silently =
False)
return render(request, 'company/success.html', {'recepient':
recepient})
return render(request, 'company/register.html', {'form':form})

-- 
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/CAMtmBS-TKN%3D_iOJX%3DV-dUcCWxBj_%3Df3kXf_gQDPYt14TnDmRAQ%40mail.gmail.com.


RE: Problem withLogin in Django

2019-11-13 Thread Kasper Laudrup
Hi Saikiran,

On 13/11/2019 15.07, IT Technology bySaikiran wrote:
> 
> # Create your models here.
> class register(models.Model):
>  username=models.CharField(max_length=100)
>  password=models.CharField(max_length=100)
>  email=models.CharField(max_length=100)
>  fname=models.CharField(max_length=30)
>  lname=models.CharField(max_length=30)
>  user_regdate=models.DateTimeField()
> 
You haven't provided any details on what you want to achieve, but it looks like 
you're trying to implement your own authentication system storing passwords in 
cleartext.

That's a horrible idea and probably the reason why you cannot make it work with 
Djangos authentication model.

What exactly are you trying to achieve that cannot be done with the standard 
Django authentication model?

Maybe look into customizing the user model:

https://simpleisbetterthancomplex.com/tutorial/2016/07/22/how-to-extend-django-user-model.html

Kind regards,

Kasper Laudrup

-- 
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/20191113163523.Horde.MJ_D5Enrw3el3ybgTo0oSz6%40cloud.stacktrace.dk.


RE: Problem withLogin in Django

2019-11-13 Thread Kasper Laudrup



"IT Technology bySaikiran"  – 13. november 
2019 15:41
> Views.py:=def login(request):
> if request.method == 'POST':
> username = request.POST['username']
> password = request.POST['Password1']
> for i in register.objects.all():
> print('db Value'+i.username)
> if i.username == 'saikiran_maddipatla' and i.password == '1919':
> print('Success')
> print('Value not matched')
> print(username)
> print(password)
> user = auth.authenticate(username= username, password= password)
> print(user)
> if user is not None:
> print('Login Success')
> auth.login(request, user)
> return render(register)
> else:
> print("failed")
> return redirect('login')
> 
> 
> else:
> return render(request, 'web_app/login.html')
> 
> 
> 
> 
> Models.py:
> 
> =
> 
> 
> 
> 
> 
> 
> from django.db import models
> 
> 
> # Create your models here.
> class register(models.Model):
> username=models.CharField(max_length=100)
> password=models.CharField(max_length=100)
> email=models.CharField(max_length=100)
> fname=models.CharField(max_length=30)
> lname=models.CharField(max_length=30)
> user_regdate=models.DateTimeField()
> 
> def __str__(self):
> return self.username
> 
> 
> 
> 
> i am trying to login,User return None 
> 
> Please help me on this.
> 
> 
> 
> -- 
> 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/4191b3c9-ac79-452a-9230-d74558d1901b%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/20191113163410.Horde.NKMKIoOAxLGxmAdjaaETOEk%40cloud.stacktrace.dk.


revert back to django in virtual environment from local fork

2019-11-13 Thread Durai pandian
Hello All,

I followed the contribution guide to point out local forked django in the 
new virtual environment.

https://docs.djangoproject.com/en/2.2/intro/contributing/#intro-contributing-install-local-copy

However my all other virtual environments are pointing to the local fork 
instead of the django installed in that particular virtual enviroment.

Can someone point the right direction where i can look the configuration? 
so that my other virtual environment uses the django currently installed.

Thanks in advance,
Durai pandian.

-- 
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/f6de07d5-63ec-4911-95d9-8ccfa4f3684b%40googlegroups.com.


Re: Performing a query returns an error

2019-11-13 Thread Patrick Carra
Simon thank you for that I had been playing around with db_column but did 
not realize the exact reference I should have been making.  Thank you for 
the quick reply!

On Wednesday, November 13, 2019 at 9:46:59 AM UTC-6, Simon Charette wrote:
>
> Hello Patrick,
>
> From what I understand you are relying on unmanaged (Meta.managed=False) 
> models
> to use the ORM to query an externally managed database.
>
> The part you missed here is that the ORM maps ForeignKey fields to 
> database columns with
> a "_id" suffix by default. In your case that means it expects a "pid_id" 
> column to exist for the
> Budgettable.pid field.
>
> If you column is actually named "pid" you'll want to use the "db_column" 
> option to let the ORM
> know about it[0]. That is `db_column=pid` in your `pid = ForeignKey` 
> definition.
>
> Cheers,
> Simon
>
> [0] 
> https://docs.djangoproject.com/en/2.2/ref/models/fields/#database-representation
>
> Le mercredi 13 novembre 2019 10:28:30 UTC-5, Patrick Carra a écrit :
>>
>> Hello all I am new to django and I am trying to do a query to that will 
>> provide me with information from multiple tables I have included my 
>> models.py file below:
>> Enter code hclass Circuitinfotable(models.Model):
>> pid = models.CharField(max_length=255, blank=True, null=True)
>> circuitid = models.CharField(primary_key=True, max_length=255, 
>> blank=True, null=False)
>> bandwidth = models.CharField(max_length=255, blank=True, null=True)
>> region = models.CharField(max_length=255, blank=True, null=True)
>> 
>>
>> class Meta:
>> managed = False
>> db_table = 'circuitinfotable'
>>
>>
>> class Budgettable(models.Model):
>> id = models.IntegerField(primary_key=True)
>> circuitid = models.CharField(max_length=255, blank=True, null=True)
>> pid = models.ForeignKey('Circuitinfotable', on_delete=models.CASCADE)
>> monthnum = models.IntegerField(blank=True, null=True)
>> yearnum = models.IntegerField(blank=True, null=True)
>> budgetmrc = models.TextField(blank=True, null=True)  # This field 
>> type is a guess.
>> actualmrc = models.TextField(blank=True, null=True)  # This field 
>> type is a guess.
>> region = models.CharField(max_length=255, blank=True, null=True)
>>
>> class Meta:
>> managed = False
>> db_table = 'budgettable'
>>
>>
>> the code I was using to query this is below:
>> >>> from viewLit.models import Circuitinfotable, Budgettable
>> >>> btc = Circuitinfotable.objects.get(circuitid='ETH100GB-23349286')
>> >>> btc.budgettable_set.all()
>> Traceback (most recent call last):
>>   File 
>> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/backends/utils.py",
>>  
>> line 84, in _execute
>> return self.cursor.execute(sql, params)
>> psycopg2.errors.UndefinedColumn: column budgettable.pid_id does not exist
>> LINE 1: ...CT "budgettable"."id", "budgettable"."circuitid", "budgettab...
>>  ^
>> HINT:  Perhaps you meant to reference the column "budgettable.pid".
>>
>>
>> The above exception was the direct cause of the following exception:
>>
>> Traceback (most recent call last):
>>   File "", line 1, in 
>>   File 
>> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/models/query.py",
>>  
>> line 250, in __repr__
>> data = list(self[:REPR_OUTPUT_SIZE + 1])
>>   File 
>> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/models/query.py",
>>  
>> line 274, in __iter__
>> self._fetch_all()
>>   File 
>> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/models/query.py",
>>  
>> line 1242, in _fetch_all
>> self._result_cache = list(self._iterable_class(self))
>>   File 
>> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/models/query.py",
>>  
>> line 55, in __iter__
>> results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, 
>> chunk_size=self.chunk_size)
>>   File 
>> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/models/sql/compiler.py",
>>  
>> line 1100, in execute_sql
>> cursor.execute(sql, params)
>>   File 
>> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/backends/utils.py",
>>  
>> line 99, in execute
>> return super().execute(sql, params)
>>   File 
>> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/backends/utils.py",
>>  
>> line 67, in execute
>> return self._execute_with_wrappers(sql, params, many=False, 
>> executor=self._execute)
>>   File 
>> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/backends/utils.py",
>>  
>> line 76, in _execute_with_wrappers
>> return executor(sql, params, many, context)
>>   File 
>> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/backends/utils.py",
>>  
>> line 84, in _execute
>> return self.cursor.execute(sql, params)
>>   File 
>> 

Re: Performing a query returns an error

2019-11-13 Thread Simon Charette
Hello Patrick,

>From what I understand you are relying on unmanaged (Meta.managed=False) 
models
to use the ORM to query an externally managed database.

The part you missed here is that the ORM maps ForeignKey fields to database 
columns with
a "_id" suffix by default. In your case that means it expects a "pid_id" 
column to exist for the
Budgettable.pid field.

If you column is actually named "pid" you'll want to use the "db_column" 
option to let the ORM
know about it[0]. That is `db_column=pid` in your `pid = ForeignKey` 
definition.

Cheers,
Simon

[0] 
https://docs.djangoproject.com/en/2.2/ref/models/fields/#database-representation

Le mercredi 13 novembre 2019 10:28:30 UTC-5, Patrick Carra a écrit :
>
> Hello all I am new to django and I am trying to do a query to that will 
> provide me with information from multiple tables I have included my 
> models.py file below:
> Enter code hclass Circuitinfotable(models.Model):
> pid = models.CharField(max_length=255, blank=True, null=True)
> circuitid = models.CharField(primary_key=True, max_length=255, 
> blank=True, null=False)
> bandwidth = models.CharField(max_length=255, blank=True, null=True)
> region = models.CharField(max_length=255, blank=True, null=True)
> 
>
> class Meta:
> managed = False
> db_table = 'circuitinfotable'
>
>
> class Budgettable(models.Model):
> id = models.IntegerField(primary_key=True)
> circuitid = models.CharField(max_length=255, blank=True, null=True)
> pid = models.ForeignKey('Circuitinfotable', on_delete=models.CASCADE)
> monthnum = models.IntegerField(blank=True, null=True)
> yearnum = models.IntegerField(blank=True, null=True)
> budgetmrc = models.TextField(blank=True, null=True)  # This field type 
> is a guess.
> actualmrc = models.TextField(blank=True, null=True)  # This field type 
> is a guess.
> region = models.CharField(max_length=255, blank=True, null=True)
>
> class Meta:
> managed = False
> db_table = 'budgettable'
>
>
> the code I was using to query this is below:
> >>> from viewLit.models import Circuitinfotable, Budgettable
> >>> btc = Circuitinfotable.objects.get(circuitid='ETH100GB-23349286')
> >>> btc.budgettable_set.all()
> Traceback (most recent call last):
>   File 
> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/backends/utils.py",
>  
> line 84, in _execute
> return self.cursor.execute(sql, params)
> psycopg2.errors.UndefinedColumn: column budgettable.pid_id does not exist
> LINE 1: ...CT "budgettable"."id", "budgettable"."circuitid", "budgettab...
>  ^
> HINT:  Perhaps you meant to reference the column "budgettable.pid".
>
>
> The above exception was the direct cause of the following exception:
>
> Traceback (most recent call last):
>   File "", line 1, in 
>   File 
> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/models/query.py",
>  
> line 250, in __repr__
> data = list(self[:REPR_OUTPUT_SIZE + 1])
>   File 
> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/models/query.py",
>  
> line 274, in __iter__
> self._fetch_all()
>   File 
> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/models/query.py",
>  
> line 1242, in _fetch_all
> self._result_cache = list(self._iterable_class(self))
>   File 
> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/models/query.py",
>  
> line 55, in __iter__
> results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, 
> chunk_size=self.chunk_size)
>   File 
> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/models/sql/compiler.py",
>  
> line 1100, in execute_sql
> cursor.execute(sql, params)
>   File 
> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/backends/utils.py",
>  
> line 99, in execute
> return super().execute(sql, params)
>   File 
> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/backends/utils.py",
>  
> line 67, in execute
> return self._execute_with_wrappers(sql, params, many=False, 
> executor=self._execute)
>   File 
> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/backends/utils.py",
>  
> line 76, in _execute_with_wrappers
> return executor(sql, params, many, context)
>   File 
> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/backends/utils.py",
>  
> line 84, in _execute
> return self.cursor.execute(sql, params)
>   File 
> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/utils.py",
>  
> line 89, in __exit__
> raise dj_exc_value.with_traceback(traceback) from exc_value
>   File 
> "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/backends/utils.py",
>  
> line 84, in _execute
> return self.cursor.execute(sql, params)
> django.db.utils.ProgrammingError: column budgettable.pid_id does not exist
> LINE 1: 

Performing a query returns an error

2019-11-13 Thread Patrick Carra
Hello all I am new to django and I am trying to do a query to that will 
provide me with information from multiple tables I have included my 
models.py file below:
Enter code hclass Circuitinfotable(models.Model):
pid = models.CharField(max_length=255, blank=True, null=True)
circuitid = models.CharField(primary_key=True, max_length=255, 
blank=True, null=False)
bandwidth = models.CharField(max_length=255, blank=True, null=True)
region = models.CharField(max_length=255, blank=True, null=True)


class Meta:
managed = False
db_table = 'circuitinfotable'


class Budgettable(models.Model):
id = models.IntegerField(primary_key=True)
circuitid = models.CharField(max_length=255, blank=True, null=True)
pid = models.ForeignKey('Circuitinfotable', on_delete=models.CASCADE)
monthnum = models.IntegerField(blank=True, null=True)
yearnum = models.IntegerField(blank=True, null=True)
budgetmrc = models.TextField(blank=True, null=True)  # This field type 
is a guess.
actualmrc = models.TextField(blank=True, null=True)  # This field type 
is a guess.
region = models.CharField(max_length=255, blank=True, null=True)

class Meta:
managed = False
db_table = 'budgettable'


the code I was using to query this is below:
>>> from viewLit.models import Circuitinfotable, Budgettable
>>> btc = Circuitinfotable.objects.get(circuitid='ETH100GB-23349286')
>>> btc.budgettable_set.all()
Traceback (most recent call last):
  File 
"/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/backends/utils.py",
 
line 84, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.UndefinedColumn: column budgettable.pid_id does not exist
LINE 1: ...CT "budgettable"."id", "budgettable"."circuitid", "budgettab...
 ^
HINT:  Perhaps you meant to reference the column "budgettable.pid".


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "", line 1, in 
  File 
"/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/models/query.py",
 
line 250, in __repr__
data = list(self[:REPR_OUTPUT_SIZE + 1])
  File 
"/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/models/query.py",
 
line 274, in __iter__
self._fetch_all()
  File 
"/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/models/query.py",
 
line 1242, in _fetch_all
self._result_cache = list(self._iterable_class(self))
  File 
"/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/models/query.py",
 
line 55, in __iter__
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, 
chunk_size=self.chunk_size)
  File 
"/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/models/sql/compiler.py",
 
line 1100, in execute_sql
cursor.execute(sql, params)
  File 
"/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/backends/utils.py",
 
line 99, in execute
return super().execute(sql, params)
  File 
"/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/backends/utils.py",
 
line 67, in execute
return self._execute_with_wrappers(sql, params, many=False, 
executor=self._execute)
  File 
"/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/backends/utils.py",
 
line 76, in _execute_with_wrappers
return executor(sql, params, many, context)
  File 
"/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/backends/utils.py",
 
line 84, in _execute
return self.cursor.execute(sql, params)
  File 
"/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/utils.py", 
line 89, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
  File 
"/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/backends/utils.py",
 
line 84, in _execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: column budgettable.pid_id does not exist
LINE 1: ...CT "budgettable"."id", "budgettable"."circuitid", "budgettab...
 ^
HINT:  Perhaps you meant to reference the column "budgettable.pid".


The next thing that I tried was to just get an object from the Budgettable 
directly code below:

>>> btcBud=Budgettable.objects.get(pid='ETH100GB-23349286')
Traceback (most recent call last):
  File 
"/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/db/backends/utils.py",
 
line 84, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.UndefinedColumn: column budgettable.pid_id does not exist
LINE 1: ...CT "budgettable"."id", "budgettable"."circuitid", "budgettab...
 ^
HINT:  Perhaps you meant to reference the column "budgettable.pid".


The above exception was the direct cause of the following exception:

Traceback (most recent call 

Problem withLogin in Django

2019-11-13 Thread IT Technology bySaikiran
Views.py:
=

def login(request):
if request.method == 'POST':
username = request.POST['username']
password = request.POST['Password1']
for i in register.objects.all():
print('db Value'+i.username)
if i.username == 'saikiran_maddipatla' and i.password == '1919':
print('Success')
print('Value not matched')
print(username)
print(password)
user = auth.authenticate(username= username, password= password)
print(user)
if user is not None:
print('Login Success')
auth.login(request, user)
return render(register)
else:
print("failed")
return redirect('login')


else:
return render(request, 'web_app/login.html')


Models.py:

=


from django.db import models


# Create your models here.
class register(models.Model):
username=models.CharField(max_length=100)
password=models.CharField(max_length=100)
email=models.CharField(max_length=100)
fname=models.CharField(max_length=30)
lname=models.CharField(max_length=30)
user_regdate=models.DateTimeField()

def __str__(self):
return self.username


i am trying to login,User return None 

Please help me on this.

-- 
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/4191b3c9-ac79-452a-9230-d74558d1901b%40googlegroups.com.


Re: Django 2.2 CheckContraint: how to check "min_foo < max_foo" ? [SOLVED]

2019-11-13 Thread Olivier
Yes, using things like models.F('price') made it !

Thank you very much, Leonardo, for this.


Le mercredi 13 novembre 2019 13:35:37 UTC+1, LRezende a écrit :
>
> Hi,
>Didn't tested... Did you try the F expression?
>
> from django.db import models
> class Customer(models.Model):
> age = models.IntegerField()
>
> class Meta:
> constraints = [
> 
> models.CheckConstraint(check=models.Q(discounted_price__lte=models.F('price')),
>  name='age_gte_18'),
> ]
>
>
> Em ter., 12 de nov. de 2019 às 14:14, Olivier  > escreveu:
>
>> hello,
>>
>> Looking at [1], I can see examples where one can check at database level, 
>> that a model field min_foo satisfies a constraint such as "min_foo > 5".
>> How do you write a constraint involving two different fields like  
>> "min_foo < max_foo" or "discounted_price < price" ?
>>
>> PostgreSQL doc shows how to write such constraint but how to express 
>> those with Django 2.2 ?
>>
>> [1] https://docs.djangoproject.com/en/2.2/ref/models/constraints/
>>
>> Best regards
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/43d1b1aa-9261-4ebc-b54f-761959c01c31%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> --
>
> Leonardo Rezende
>

-- 
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/ce19686c-8a3b-4d29-bc81-33137560737a%40googlegroups.com.


Django Tests (--parallel) flag issues

2019-11-13 Thread Oscar Chacon
I've been working on trying to set up my tests to run in parallel, however 
I've experienced some issues along the way. I've tried setting the parallel 
flag in the options for the django tests, and while it creates the copies 
of the db, it only creates the main thread and runs all my tests 
sequentially regardless. I've tried using django-nose and using their 
multiprocess options, however setting their processes flag makes each 
process run the setUpClass and there's only one test db created which they 
all try to access. What I would like for my tests to do is run the one 
process and multithread the tests themselves, each with their own copy of 
the db. The parallel flag seems to do what I want as it's written in the 
docs minus the whole running in parallel part, but there might be a setting 
set elsewhere that interferes with it. my test class is a 
StaticLiveServerTestCase. Anyone have any ideas as to why the parallel flag 
might be performing differently than it's normal behavior? Any info on this 
is greatly appreciated and I'll try to provide more info if needed. 

-- 
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/51a45e4e-6e61-4c1b-990d-15b1caa1fabf%40googlegroups.com.


Re: Django 2.2 CheckContraint: how to check "min_foo < max_foo" ?

2019-11-13 Thread Leonardo Rezende
Hi,
   Didn't tested... Did you try the F expression?

from django.db import models
class Customer(models.Model):
age = models.IntegerField()

class Meta:
constraints = [

models.CheckConstraint(check=models.Q(discounted_price__lte=models.F('price')),
name='age_gte_18'),
]


Em ter., 12 de nov. de 2019 às 14:14, Olivier  escreveu:

> hello,
>
> Looking at [1], I can see examples where one can check at database level,
> that a model field min_foo satisfies a constraint such as "min_foo > 5".
> How do you write a constraint involving two different fields like
> "min_foo < max_foo" or "discounted_price < price" ?
>
> PostgreSQL doc shows how to write such constraint but how to express those
> with Django 2.2 ?
>
> [1] https://docs.djangoproject.com/en/2.2/ref/models/constraints/
>
> Best regards
>
> --
> 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/43d1b1aa-9261-4ebc-b54f-761959c01c31%40googlegroups.com
> 
> .
>


-- 
--

Leonardo Rezende

-- 
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/CAJ%2BpOBuysxokZfqCE%3D%2BFw23UM6TBDMdDvcoKksyABturE7Ej%2Bg%40mail.gmail.com.


Re:

2019-11-13 Thread Paras Jain
thanks u so  so so much bro i have done such a silly mistake .Really
appreciated

On Wed, Nov 13, 2019 at 5:11 PM Vivek Jha  wrote:

> Go to admin.py and import the model and then
>
>
> admin.site.register(modelname)
>
> Save and refresh it
>
> On Wed 13 Nov, 2019, 5:08 PM Nitin Kalmaste, 
> wrote:
>
>> if your migrations are successful run queries through manage.py shell
>> There is existing User model inside django.contrb.auth.User
>>
>> On Wed, Nov 13, 2019 at 3:49 PM Paras Jain 
>> wrote:
>>
>>> i have just created a model which will have login information in
>>> database but it is not showing its appearance i have also done migration
>>>
>>> models.py:
>>>
>>> from django.db import models
>>>
>>> # Create your models here.
>>> class User(models.Model):
>>> email = models.EmailField()
>>> password = models.CharField(max_length=50)
>>>
>>> def __str__(self):
>>> return '{}'.format(self.email)
>>>
>>> --
>>> 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/CAMtmBS_GUL4vj5QPRd%2BqFLDkbnjRr_m%3DRbbt4QgG3sW-QbDVyQ%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/CAKroR%2B139BnAHBORc33TCXDetsp5TvMgq6_Da4w7xCksZBmJRg%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/CAMriZeFyAPP9vN46e%2BwROv34Pc6d1a5%3DMdi038Ru_aqpLfbfEw%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/CAMtmBS9YoVPNVAeK4dWqi7E80qF6M7Ni_TVALXsA5Km5PDgGGA%40mail.gmail.com.


Re:

2019-11-13 Thread Vivek Jha
Go to admin.py and import the model and then


admin.site.register(modelname)

Save and refresh it

On Wed 13 Nov, 2019, 5:08 PM Nitin Kalmaste,  wrote:

> if your migrations are successful run queries through manage.py shell
> There is existing User model inside django.contrb.auth.User
>
> On Wed, Nov 13, 2019 at 3:49 PM Paras Jain  wrote:
>
>> i have just created a model which will have login information in database
>> but it is not showing its appearance i have also done migration
>>
>> models.py:
>>
>> from django.db import models
>>
>> # Create your models here.
>> class User(models.Model):
>> email = models.EmailField()
>> password = models.CharField(max_length=50)
>>
>> def __str__(self):
>> return '{}'.format(self.email)
>>
>> --
>> 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/CAMtmBS_GUL4vj5QPRd%2BqFLDkbnjRr_m%3DRbbt4QgG3sW-QbDVyQ%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/CAKroR%2B139BnAHBORc33TCXDetsp5TvMgq6_Da4w7xCksZBmJRg%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/CAMriZeFyAPP9vN46e%2BwROv34Pc6d1a5%3DMdi038Ru_aqpLfbfEw%40mail.gmail.com.


Re:

2019-11-13 Thread Nitin Kalmaste
if your migrations are successful run queries through manage.py shell
There is existing User model inside django.contrb.auth.User

On Wed, Nov 13, 2019 at 3:49 PM Paras Jain  wrote:

> i have just created a model which will have login information in database
> but it is not showing its appearance i have also done migration
>
> models.py:
>
> from django.db import models
>
> # Create your models here.
> class User(models.Model):
> email = models.EmailField()
> password = models.CharField(max_length=50)
>
> def __str__(self):
> return '{}'.format(self.email)
>
> --
> 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/CAMtmBS_GUL4vj5QPRd%2BqFLDkbnjRr_m%3DRbbt4QgG3sW-QbDVyQ%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/CAKroR%2B139BnAHBORc33TCXDetsp5TvMgq6_Da4w7xCksZBmJRg%40mail.gmail.com.


Re: djangorestframework vs GraphQL

2019-11-13 Thread DANIEL URBANO DE LA RUA
You have a good example on saleor eccomerce is on github

On Wed, 13 Nov 2019, 09:15 guettli,  wrote:

> I never used GraphQL, but I like it. In the past the django web framework
> had a different API than a restframework for ruby or Nodejs.
>
> With GraphQL you have a well defined API and changeing the backend part
> should be easier.
>
> But again, I never used it up to now.
>
> Am Dienstag, 12. November 2019 12:51:25 UTC+1 schrieb Integr@te System:
>>
>> Hi Freinds,
>>
>> GQL, when compare DRF, it as an option, and for whom familiar with other
>> tools without DRF or Python, and align thinking with framework/anythingelse
>> relate to JS.
>> Base on your choice or requirement.
>>
>> On Tue, Nov 12, 2019, 16:24 Nick Sarbicki  wrote:
>>
>>> GraphQL strikes me as very similar to NoSQL.
>>>
>>> Useful in niches but the older standard is better in general.
>>>
>>> I've tried both and the added complexity (designing a system to generate
>>> all required data from a single request) of GraphQL for the, seemingly
>>> minor, gain (a single request for all your data) doesn't enthuse me.
>>>
>>> It's an interesting solution to a problem I've never really had. Not to
>>> say it isn't useful in some situations, I just haven't yet encountered a
>>> situation where it is.
>>>
>>> - Nick
>>>
>>>
>>> On Tue, Nov 12, 2019 at 9:14 AM guettli  wrote:
>>>
 Hi,

 I am new to GraphQL, but I like the idea very much.

 There is already an A Django integration for Graphene:
 https://github.com/graphql-python/graphene-django


 What are the pros and cons of djangorestframework and GraphQL?

 Which one would you choose, if you could start from scratch?

 Regards,
   Thomas Güttler

 PS: I am always looking for feedback for my guidelines:
 https://github.com/guettli/programming-guidelines

 --
 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...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/f5dd3fea-28ab-4b01-9e07-0819b4bb91cb%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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAGuvt90HG0OE9kV9axHvkFx8xfa7qD41HdV3tuoupSKYjdG9ew%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/20edfecc-976a-46c7-b71e-006ea5c660ea%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/CAO_yRT1mMwY%3DFkHYraRqBNovxEaVW0BaGyW_u-4P2_uuOHQXJQ%40mail.gmail.com.


[no subject]

2019-11-13 Thread Paras Jain
i have just created a model which will have login information in database
but it is not showing its appearance i have also done migration

models.py:

from django.db import models

# Create your models here.
class User(models.Model):
email = models.EmailField()
password = models.CharField(max_length=50)

def __str__(self):
return '{}'.format(self.email)

-- 
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/CAMtmBS_GUL4vj5QPRd%2BqFLDkbnjRr_m%3DRbbt4QgG3sW-QbDVyQ%40mail.gmail.com.


How to get the name and extension of a filename using environ, not os

2019-11-13 Thread Richard Balwane
Hello,
I am importing environ as opposed to os and want to split the filename to
get its name and extension. Please help.

*Richard Dick Balwane*

*Mobiles:+256 755 442248, *

*+256 781 493558.*
*Twiter:   @RBalwane*
*WhatsApp:   **+256 755 442248*


*Balwane Holding Inc.*

-- 
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/CAAjYwK-3F_31Hi2%2Bt5yF_9E7sTvSTs3fBiy7XaQw%2BByHJ2mXDg%40mail.gmail.com.


Re: djangorestframework vs GraphQL

2019-11-13 Thread guettli
I never used GraphQL, but I like it. In the past the django web framework 
had a different API than a restframework for ruby or Nodejs.

With GraphQL you have a well defined API and changeing the backend part 
should be easier.

But again, I never used it up to now.

Am Dienstag, 12. November 2019 12:51:25 UTC+1 schrieb Integr@te System:
>
> Hi Freinds,
>
> GQL, when compare DRF, it as an option, and for whom familiar with other 
> tools without DRF or Python, and align thinking with framework/anythingelse 
> relate to JS.
> Base on your choice or requirement.
>
> On Tue, Nov 12, 2019, 16:24 Nick Sarbicki  > wrote:
>
>> GraphQL strikes me as very similar to NoSQL.
>>
>> Useful in niches but the older standard is better in general.
>>
>> I've tried both and the added complexity (designing a system to generate 
>> all required data from a single request) of GraphQL for the, seemingly 
>> minor, gain (a single request for all your data) doesn't enthuse me.
>>
>> It's an interesting solution to a problem I've never really had. Not to 
>> say it isn't useful in some situations, I just haven't yet encountered a 
>> situation where it is.
>>
>> - Nick
>>
>>
>> On Tue, Nov 12, 2019 at 9:14 AM guettli > 
>> wrote:
>>
>>> Hi,
>>>
>>> I am new to GraphQL, but I like the idea very much.
>>>
>>> There is already an A Django integration for Graphene: 
>>> https://github.com/graphql-python/graphene-django
>>>
>>>
>>> What are the pros and cons of djangorestframework and GraphQL?
>>>
>>> Which one would you choose, if you could start from scratch?
>>>
>>> Regards,
>>>   Thomas Güttler
>>>
>>> PS: I am always looking for feedback for my guidelines: 
>>> https://github.com/guettli/programming-guidelines
>>>
>>> -- 
>>> 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...@googlegroups.com .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/f5dd3fea-28ab-4b01-9e07-0819b4bb91cb%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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAGuvt90HG0OE9kV9axHvkFx8xfa7qD41HdV3tuoupSKYjdG9ew%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/20edfecc-976a-46c7-b71e-006ea5c660ea%40googlegroups.com.