Re: Error at OneToOneField in models while creating new models class

2018-09-26 Thread Srinivas Gadi
It was fixed by adding the "section.apps.Class.Config" in settings
INSTALLED_APPS

On Thu, Sep 27, 2018 at 5:05 AM luca bocchi  wrote:

> seems that your app is not in settings.INSTALLED_APPS, add 'section' there
> and retry.
>
> L
>
> Il giorno lunedì 24 settembre 2018 13:22:48 UTC+2, Srinivas Gadi ha
> scritto:
>>
>> Thank you for the response,
>> 1. Deleted the migrations folder
>> 2. Removed the SQLite3 DB itself
>> 3. My dir structure.
>>
>> 24-09-2018  16:37  .
>> 24-09-2018  16:37  ..
>> 23-09-2018  15:06  college
>> 19-09-2018  08:56   554 manage.py
>> 19-09-2018  10:59  section
>>1 File(s)554 bytes
>>4 Dir(s)  32,464,281,600 bytes free
>>
>> 4. Execute the makemigrations, but it prompting with the error.
>>
>> C:\Users\srini\djangoProjects\college>*python manage.py makemigrations
>> section*
>> App 'section' could not be found. Is it in INSTALLED_APPS?
>>
>> 5. FYI: Also registered in apps.py
>>
>> from django.apps import AppConfig
>>
>>
>> class ClassConfig(AppConfig):
>> name = 'section'
>>
>>
>> On Sun, Sep 23, 2018 at 7:26 PM Adolfo Cueto  wrote:
>>
>>> First you have to change your model name Class names starts with
>>> uppercase...
>>>
>>> My friend.. you are not making migrations... look at you have to do this:
>>>
>>>
>>> 1. Delete your migration folder
>>> 2. Delete you app table manually (DROP table)
>>> 3. python manage.py makemigrations app_name
>>> 4. migrate
>>>
>>> that's all
>>>
>>> El sábado, 22 de septiembre de 2018, 4:10:45 (UTC-5), Srinivas Gadi
>>> escribió:

 HI All,

 I am facing below error while creating a new model class.
 the error pop up only at this line "user = models.OneToOneField(User)"
 *"E1120:No value for argument 'on_delete' in constructor call"*

 from django.db import models
 from django.contrib.auth.models import User

 class userProfile(models.Model):
 user = models.OneToOneField(User)

 If I add "user = models.OneToOneField(User,*on_delete=models.CASCADE*)"
 the error got subsided but the new class "userProfile" is not
 appearing in admin page, under Users tab.

 Could some one please guide me how to fix this ?

 --
 Srinivas .G
   9966559383

>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/42ee3cf4-5347-4371-b9aa-343aa946c191%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> --
>> Srinivas .G
>>   9966559383
>>
> --
> 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/765c04b2-1ed2-4e30-92a0-2a28f60c178d%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Srinivas .G
  9966559383

-- 
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/CAPC7spj%2ByxD0J8o4ESC1xEFT%3DxcSBnTfTRZGVDuJevBTaDBaiA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error at OneToOneField in models while creating new models class

2018-09-26 Thread luca bocchi
seems that your app is not in settings.INSTALLED_APPS, add 'section' there 
and retry.

L

Il giorno lunedì 24 settembre 2018 13:22:48 UTC+2, Srinivas Gadi ha scritto:
>
> Thank you for the response,
> 1. Deleted the migrations folder
> 2. Removed the SQLite3 DB itself
> 3. My dir structure.
>
> 24-09-2018  16:37  .
> 24-09-2018  16:37  ..
> 23-09-2018  15:06  college
> 19-09-2018  08:56   554 manage.py
> 19-09-2018  10:59  section
>1 File(s)554 bytes
>4 Dir(s)  32,464,281,600 bytes free
>
> 4. Execute the makemigrations, but it prompting with the error. 
>
> C:\Users\srini\djangoProjects\college>*python manage.py makemigrations 
> section*
> App 'section' could not be found. Is it in INSTALLED_APPS?
>
> 5. FYI: Also registered in apps.py
>
> from django.apps import AppConfig
>
>
> class ClassConfig(AppConfig):
> name = 'section'
>
>
> On Sun, Sep 23, 2018 at 7:26 PM Adolfo Cueto  > wrote:
>
>> First you have to change your model name Class names starts with 
>> uppercase...
>>
>> My friend.. you are not making migrations... look at you have to do this:
>>
>>
>> 1. Delete your migration folder
>> 2. Delete you app table manually (DROP table)
>> 3. python manage.py makemigrations app_name
>> 4. migrate
>>
>> that's all
>>
>> El sábado, 22 de septiembre de 2018, 4:10:45 (UTC-5), Srinivas Gadi 
>> escribió:
>>>
>>> HI All,
>>>
>>> I am facing below error while creating a new model class.
>>> the error pop up only at this line "user = models.OneToOneField(User)"
>>> *"E1120:No value for argument 'on_delete' in constructor call"*
>>>
>>> from django.db import models
>>> from django.contrib.auth.models import User
>>>
>>> class userProfile(models.Model):
>>> user = models.OneToOneField(User)
>>>
>>> If I add "user = models.OneToOneField(User,*on_delete=models.CASCADE*)" 
>>> the error got subsided but the new class "userProfile" is not appearing 
>>> in admin page, under Users tab.
>>>
>>> Could some one please guide me how to fix this ?
>>>
>>> -- 
>>> Srinivas .G
>>>   9966559383
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/42ee3cf4-5347-4371-b9aa-343aa946c191%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> Srinivas .G
>   9966559383
>

-- 
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/765c04b2-1ed2-4e30-92a0-2a28f60c178d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error at OneToOneField in models while creating new models class

2018-09-24 Thread Srinivas Gadi
Thank you for the response,
1. Deleted the migrations folder
2. Removed the SQLite3 DB itself
3. My dir structure.

24-09-2018  16:37  .
24-09-2018  16:37  ..
23-09-2018  15:06  college
19-09-2018  08:56   554 manage.py
19-09-2018  10:59  section
   1 File(s)554 bytes
   4 Dir(s)  32,464,281,600 bytes free

4. Execute the makemigrations, but it prompting with the error.

C:\Users\srini\djangoProjects\college>*python manage.py makemigrations
section*
App 'section' could not be found. Is it in INSTALLED_APPS?

5. FYI: Also registered in apps.py

from django.apps import AppConfig


class ClassConfig(AppConfig):
name = 'section'


On Sun, Sep 23, 2018 at 7:26 PM Adolfo Cueto  wrote:

> First you have to change your model name Class names starts with
> uppercase...
>
> My friend.. you are not making migrations... look at you have to do this:
>
>
> 1. Delete your migration folder
> 2. Delete you app table manually (DROP table)
> 3. python manage.py makemigrations app_name
> 4. migrate
>
> that's all
>
> El sábado, 22 de septiembre de 2018, 4:10:45 (UTC-5), Srinivas Gadi
> escribió:
>>
>> HI All,
>>
>> I am facing below error while creating a new model class.
>> the error pop up only at this line "user = models.OneToOneField(User)"
>> *"E1120:No value for argument 'on_delete' in constructor call"*
>>
>> from django.db import models
>> from django.contrib.auth.models import User
>>
>> class userProfile(models.Model):
>> user = models.OneToOneField(User)
>>
>> If I add "user = models.OneToOneField(User,*on_delete=models.CASCADE*)"
>> the error got subsided but the new class "userProfile" is not appearing
>> in admin page, under Users tab.
>>
>> Could some one please guide me how to fix this ?
>>
>> --
>> Srinivas .G
>>   9966559383
>>
> --
> 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/42ee3cf4-5347-4371-b9aa-343aa946c191%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Srinivas .G
  9966559383

-- 
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/CAPC7sphyTZ0vaGUjR_mSgfG_hC%2Bfxa4hXrG2D7hf9XN6xN9UhQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error at OneToOneField in models while creating new models class

2018-09-23 Thread Adolfo Cueto
First you have to change your model name Class names starts with 
uppercase...

My friend.. you are not making migrations... look at you have to do this:


1. Delete your migration folder
2. Delete you app table manually (DROP table)
3. python manage.py makemigrations app_name
4. migrate

that's all

El sábado, 22 de septiembre de 2018, 4:10:45 (UTC-5), Srinivas Gadi 
escribió:
>
> HI All,
>
> I am facing below error while creating a new model class.
> the error pop up only at this line "user = models.OneToOneField(User)"
> *"E1120:No value for argument 'on_delete' in constructor call"*
>
> from django.db import models
> from django.contrib.auth.models import User
>
> class userProfile(models.Model):
> user = models.OneToOneField(User)
>
> If I add "user = models.OneToOneField(User,*on_delete=models.CASCADE*)" 
> the error got subsided but the new class "userProfile" is not appearing 
> in admin page, under Users tab.
>
> Could some one please guide me how to fix this ?
>
> -- 
> Srinivas .G
>   9966559383
>

-- 
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/42ee3cf4-5347-4371-b9aa-343aa946c191%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error at OneToOneField in models while creating new models class

2018-09-22 Thread Srinivas Gadi
Yes, provided the migrations out put in the second mail

On Sat, 22 Sep 2018, 17:11 Matthew Pava,  wrote:

> Did you try running your migrations?
>
> Get Outlook for Android 
>
>
>
>
> On Sat, Sep 22, 2018 at 5:07 AM -0500, "Srinivas Gadi" <
> srini@gmail.com> wrote:
>
> Adding more and complete details:
>> I am facing below error while creating a new model class.
>> the error pops up only at this line "user = models.OneToOneField(User)"
>> *"E1120:No value for argument 'on_delete' in constructor call"*
>>
>> section/models.py
>>
>> from django.db import modelsfrom django.contrib.auth.models import User
>> class userProfile(models.Model):
>> user = models.OneToOneField(User)
>>
>> admin.py
>>
>> from django.contrib import adminfrom section.models import userProfile
>>
>> admin.site.register(userProfile)
>>
>> If I add below entry with "on_delete=models.CASCADE"
>>
>> user = models.OneToOneField(User,on_delete=models.CASCADE)
>>
>> the error got subsided but the new class "userProfile" is not appearing
>> in admin page, under Users tab.
>>
>> Also, run migrations:
>>
>> C:\Users\srini\djangoProjects\college>python manage.py makemigrationsNo 
>> changes detected
>>
>> C:\Users\srini\djangoProjects\college>python manage.py migrateOperations to 
>> perform:Apply all migrations: admin, auth, contenttypes, sessionsRunning 
>> migrations:No migrations to apply.
>>
>> Could someone please guide me how to fix this?
>>
>> On Sat, Sep 22, 2018 at 2:40 PM Srinivas Gadi 
>> wrote:
>>
>>> HI All,
>>>
>>> I am facing below error while creating a new model class.
>>> the error pop up only at this line "user = models.OneToOneField(User)"
>>> *"E1120:No value for argument 'on_delete' in constructor call"*
>>>
>>> from django.db import models
>>> from django.contrib.auth.models import User
>>>
>>> class userProfile(models.Model):
>>> user = models.OneToOneField(User)
>>>
>>> If I add "user = models.OneToOneField(User,*on_delete=models.CASCADE*)"
>>> the error got subsided but the new class "userProfile" is not appearing
>>> in admin page, under Users tab.
>>>
>>> Could some one please guide me how to fix this ?
>>>
>>> --
>>> Srinivas .G
>>>   9966559383
>>>
>>
>>
>> --
>> Srinivas .G
>>   9966559383
>>
>> --
>> 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/CAPC7spgQAR0e28KtZG4Ljt%3Dk4Su39qipvZJaRy4%3DCJbD6CTMCA%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/D9BEB906A6B607A4.5302fd9d-847e-4878-88de-82caf2f9c69b%40mail.outlook.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/CAPC7spiyJ5_kCtVfwpui2TALrQw-fpM7O40QucTryeX5qst7Og%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error at OneToOneField in models while creating new models class

2018-09-22 Thread Matthew Pava
Did you try running your migrations?

Get Outlook for Android




On Sat, Sep 22, 2018 at 5:07 AM -0500, "Srinivas Gadi" 
mailto:srini@gmail.com>> wrote:

Adding more and complete details:
I am facing below error while creating a new model class.
the error pops up only at this line "user = models.OneToOneField(User)"
"E1120:No value for argument 'on_delete' in constructor call"


section/models.py

from django.db import models
from django.contrib.auth.models import User

class userProfile(models.Model):
user = models.OneToOneField(User)

admin.py

from django.contrib import admin
from section.models import userProfile

admin.site.register(userProfile)

If I add below entry with "on_delete=models.CASCADE"

user = models.OneToOneField(User,on_delete=models.CASCADE)

the error got subsided but the new class "userProfile" is not appearing in 
admin page, under Users tab.

Also, run migrations:

C:\Users\srini\djangoProjects\college>python manage.py makemigrations
No changes detected

C:\Users\srini\djangoProjects\college>python manage.py migrate
Operations to perform:
Apply all migrations: admin, auth, contenttypes, sessions
Running migrations:
No migrations to apply.

Could someone please guide me how to fix this?

On Sat, Sep 22, 2018 at 2:40 PM Srinivas Gadi 
mailto:srini@gmail.com>> wrote:
HI All,

I am facing below error while creating a new model class.
the error pop up only at this line "user = models.OneToOneField(User)"
"E1120:No value for argument 'on_delete' in constructor call"

from django.db import models
from django.contrib.auth.models import User

class userProfile(models.Model):
user = models.OneToOneField(User)

If I add "user = models.OneToOneField(User,on_delete=models.CASCADE)" the error 
got subsided but the new class "userProfile" is not appearing in admin page, 
under Users tab.

Could some one please guide me how to fix this ?

--
Srinivas .G
  9966559383


--
Srinivas .G
  9966559383

--
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/CAPC7spgQAR0e28KtZG4Ljt%3Dk4Su39qipvZJaRy4%3DCJbD6CTMCA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/D9BEB906A6B607A4.5302fd9d-847e-4878-88de-82caf2f9c69b%40mail.outlook.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error at OneToOneField in models while creating new models class

2018-09-22 Thread Srinivas Gadi
Adding more and complete details:
I am facing below error while creating a new model class.
the error pops up only at this line "user = models.OneToOneField(User)"
*"E1120:No value for argument 'on_delete' in constructor call"*

section/models.py

from django.db import modelsfrom django.contrib.auth.models import User
class userProfile(models.Model):
user = models.OneToOneField(User)

admin.py

from django.contrib import adminfrom section.models import userProfile

admin.site.register(userProfile)

If I add below entry with "on_delete=models.CASCADE"

user = models.OneToOneField(User,on_delete=models.CASCADE)

the error got subsided but the new class "userProfile" is not appearing in
admin page, under Users tab.

Also, run migrations:

C:\Users\srini\djangoProjects\college>python manage.py
makemigrationsNo changes detected

C:\Users\srini\djangoProjects\college>python manage.py
migrateOperations to perform:Apply all migrations: admin, auth,
contenttypes, sessionsRunning migrations:No migrations to apply.

Could someone please guide me how to fix this?

On Sat, Sep 22, 2018 at 2:40 PM Srinivas Gadi  wrote:

> HI All,
>
> I am facing below error while creating a new model class.
> the error pop up only at this line "user = models.OneToOneField(User)"
> *"E1120:No value for argument 'on_delete' in constructor call"*
>
> from django.db import models
> from django.contrib.auth.models import User
>
> class userProfile(models.Model):
> user = models.OneToOneField(User)
>
> If I add "user = models.OneToOneField(User,*on_delete=models.CASCADE*)"
> the error got subsided but the new class "userProfile" is not appearing
> in admin page, under Users tab.
>
> Could some one please guide me how to fix this ?
>
> --
> Srinivas .G
>   9966559383
>


-- 
Srinivas .G
  9966559383

-- 
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/CAPC7spgQAR0e28KtZG4Ljt%3Dk4Su39qipvZJaRy4%3DCJbD6CTMCA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.