Re: iterate over query set

2021-07-26 Thread DJANGO DEVELOPER
because you have provided the get_department with index 0. so it will only
give you the info about first department.

On Tue, Jul 27, 2021 at 3:17 AM sum abiut  wrote:

> I am trying to get the values of the userid by iterating through the
> queryset. However not all the values are displayed. I am not sure why I am
> not getting all the values when I iterate through it.
>
> users - Users.objects.filter(depid=get_department[0].depid)
> print(users) #when i test it here it pring all the values
> #however it only prints one value when i loop through it below. i want to
> be able to print all the #values
> for a in users:
>   print(a)# this only print value for the first user
>
> --
> 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/CAPCf-y65WJVjZC2PA4tz3ZubOtP5CjLtdHegiThhRnK8W5hSiw%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/CAKPY9pkp-vCz8%2BfJoGRkjfL-ohECO%2Bq1nH9mfZ3o-isYB3NUXg%40mail.gmail.com.


Re: OperationalError: foreign key mismatch

2021-07-26 Thread DJANGO DEVELOPER
can you please  change your object from this:
filename_id = models.ForeignKey(FilenameTbl,db_column='filename_id',
to_field='rowid',null=True,blank=True,on_delete=models.SET_NULL)
to :
filename_id = models.ForeignKey(FilenameTbl,db_column='filename',
to_field='rowid',null=True,blank=True,on_delete=models.SET_NULL)

On Tue, Jul 27, 2021 at 1:53 AM Wai Yeung  wrote:

> Hello,
>
> I'm getting the following error whenever I attempt to save to the table in
> a SQLite database:
>
> foreign key mismatch - "procedure_tbl" referencing "filename_tbl"
>
> In models.py, these are the tables that the error is refering to:
>
> class FilenameTbl(models.Model):
> rowid = models.AutoField(auto_created=True, primary_key=True,
> serialize=False, verbose_name='FileID', db_column='rowid')
> filename = models.TextField(blank=True, null=True)
> creation_datetime = models.TextField(blank=True, null=True)
>
> class Meta:
> managed = False
> db_table = 'filename_tbl'
> ordering = ['rowid']
>
>
> class ProcedureTbl(models.Model):
> rowid = models.AutoField(auto_created=True, primary_key=True,
> serialize=False, verbose_name='ProcedureID', db_column='rowid')
> ...
> filename_id = models.ForeignKey(FilenameTbl,db_column='filename_id',
> to_field='rowid',null=True,blank=True,on_delete=models.SET_NULL)
>
> class Meta:
> managed = False
> db_table = 'procedure_tbl'
> ordering = ['rowid']
>
> Data can be read from the tables and querysets like the following return
> the correct data:
> queryset = FilenameTbl.objects.values(
> 'rowid', 'filename',
> 'proceduretbl__rowid')
>
> Raw SQLite commands to write/update to the ProcedureTbl table function
> properly.
>
> If I removed filename_id from the ProcedureTbl, then data can be saved to
> the table.
>
> Any insight into the issue would be much appreciated.
>
> Cheers,
> Wai
>
>
>
> --
> 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/b90d237f-8c29-42ef-897a-34221704699dn%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/CAKPY9pkH2pp3bkARsviqUdmn007Hc30ckrVOPH4yTBakJqXjDw%40mail.gmail.com.


Re: Please remove me from this user group.

2021-07-26 Thread Raphael Polanco
Farewell.

On Mon, Jul 26, 2021 at 22:16 Shirley Nelson  wrote:

> Please remove me from this user group. Thank you.
>
> Regards, Shirley Nelson
>
> --
> 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%2BN15oZhNz6SYsnN1tiBoyjyn-8nM0tfQ2Ua1MWSrVJTdiWa8A%40mail.gmail.com
> 
> .
>
-- 
Sent from Gmail Mobile

-- 
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/CAJoAtSnoRK61-z8Lh1-rd2CmKhqYU%2BCo%3D%3D%3DHaaaP8%2BcuO5GokA%40mail.gmail.com.


Please remove me from this user group.

2021-07-26 Thread Shirley Nelson
Please remove me from this user group. Thank you.

Regards, Shirley Nelson

-- 
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%2BN15oZhNz6SYsnN1tiBoyjyn-8nM0tfQ2Ua1MWSrVJTdiWa8A%40mail.gmail.com.


Re: Is there a quick and easy way to copy a model instance

2021-07-26 Thread Mike Dewhirst

On 26/07/2021 7:56 pm, Markus Holtermann wrote:

Hi Mike,

Last time I checked, when you set `instance.pk = None` and then do 
`instance.save()`, Django will create a new instance.


Markus

Thanks for responding. I wasn't sufficiently explicit in my subject line 
nor explanation of the task. Sorry about that.


The child instance needs to be copied to a parent in a different app. 
That parent (AnnualSummary model) gets created once per year. The copied 
child gets (created or) updated on every save of its original (parent 
and) source instance.


The FK to its original parent is retained to keep the connection from 
the other app.


It also needs a FK to its AnnualSummary parent.

Just copying manually works but is not very robust if anything changes 
in future and someone else is maintaining things etc.


Thanks

Mike



Cheers

Markus

On Mon, Jul 26, 2021, at 9:13 AM, Mike Dewhirst wrote:

I'm archiving a particular child record every time it is saved but
connecting it to another parent.

Each year I create a new parent and the saving process keeps going but
the copied child gets connected to the new parent.

That will give me an annual snapshot of the child record.

At the moment I'm just copying it one field at a time.

Thanks for any hints

Cheers

Mike


--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.


--
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/8db31592-8835-2095-22be-5ce4e6989ed2%40dewhirst.com.au.

Attachments:
* OpenPGP_signature



--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.


--
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/9601cd40-f3c6-56c9-93a8-f09aeedc598c%40dewhirst.com.au.


OpenPGP_signature
Description: OpenPGP digital signature


Re: Added new column to model and run migrations but not applied to database table

2021-07-26 Thread guna visva
having had the unfortunate phase of dealing with it , sorting it requires 
some patience

the issue is the tables in django_migrations is not in sync with rest the 
rest of your database or migrations files. 

You have to first remove the addition in field etc and make sure the 
database tables are first in sync with your models, then 1. delete 
migrations files and 2. delete django_migrations. Then 3.makemigrations and 
4. migrate fake.  All risks are yours to take

Then finally just add your fields and makemigrations and migrate

The above might/or not work as it might give some content type errors 




On Wednesday, July 21, 2021 at 2:39:56 AM UTC+8 sebasti...@gmail.com wrote:

> Is in settings.py also in installed app? Without that migrations don't work
>
> Salima Begum  schrieb am Di., 20. Juli 2021, 
> 19:00:
>
>> Hi ,
>> Thank you for your responses.
>>  I have tried all the ways Which you people suggested I am not getting 
>> any error while running makemigrations or migrate and 
>> python manage.py migrate --fake-initial. But those migrations are not 
>> applying to the database. How can I fix this issue without deleting the 
>> database? 
>>
>> Thank you
>> ~Salima
>>  
>>
>> On Mon, Jul 19, 2021 at 7:02 PM Aman Vyas  wrote:
>>
>>> if it is saying no changes detected while running makemigrations and you 
>>> are sure that you changed models.py  then these things you can try:
>>>
>>> 1: python manage.py makemigrations appname
>>>
>>> if this will not work then do that
>>>
>>> 2: delete migrations folder from your app and delete database then run 
>>> again python manage.py makemigrations
>>>
>>>
>>>
>>>
>>> On Mon, Jul 19, 2021 at 6:07 AM Salima Begum <
>>> sali...@rohteksolutions.com> wrote:
>>>
 Hi all,

 I have added a new column to the existing model while developing. Then 
 I run makemigrations and migrate. It is not applied to the database table 
 which is created based on that model. How can I fix this issue? Please 
 help 
 me to complete this issue.

 The below issue I am facing in deployment server after adding new field 
 and deployed into server.

 ```
 psycopg2.errors.UndefinedColumn: column 
 shopping_ls_product_search.quality_prdct does not exist
 LINE 1: ... Col1 FROM "shopping_ls_product_search" WHERE ("shopping_...
 ```
 Thank you
 ~Salima

 -- 
 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/CAMSz6bnLkeN001UnxO3PdCg06Jc%3Dcr22kZXc71KL4w5CbYq_Cw%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/CAKZY6%3DAgrWzCmrBHpouSJG_Vfy7i6LQu81Q7EWBRq44Yf3053A%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/CAMSz6bmQ5KAQ2SFHCMbf8UHkg34itZPFZ1OksP-2C3t5wAwTJQ%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/f8458021-e0c0-4c30-8188-0c08932b1deen%40googlegroups.com.


iterate over query set

2021-07-26 Thread sum abiut
I am trying to get the values of the userid by iterating through the
queryset. However not all the values are displayed. I am not sure why I am
not getting all the values when I iterate through it.

users - Users.objects.filter(depid=get_department[0].depid)
print(users) #when i test it here it pring all the values
#however it only prints one value when i loop through it below. i want to
be able to print all the #values
for a in users:
  print(a)# this only print value for the first user

-- 
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/CAPCf-y65WJVjZC2PA4tz3ZubOtP5CjLtdHegiThhRnK8W5hSiw%40mail.gmail.com.


OperationalError: foreign key mismatch

2021-07-26 Thread Wai Yeung
Hello,

I'm getting the following error whenever I attempt to save to the table in 
a SQLite database:

foreign key mismatch - "procedure_tbl" referencing "filename_tbl"

In models.py, these are the tables that the error is refering to:

class FilenameTbl(models.Model):
rowid = models.AutoField(auto_created=True, primary_key=True, 
serialize=False, verbose_name='FileID', db_column='rowid')
filename = models.TextField(blank=True, null=True)
creation_datetime = models.TextField(blank=True, null=True)

class Meta:
managed = False
db_table = 'filename_tbl'
ordering = ['rowid']


class ProcedureTbl(models.Model):
rowid = models.AutoField(auto_created=True, primary_key=True, 
serialize=False, verbose_name='ProcedureID', db_column='rowid')
...
filename_id = models.ForeignKey(FilenameTbl,db_column='filename_id', 
to_field='rowid',null=True,blank=True,on_delete=models.SET_NULL)

class Meta:
managed = False
db_table = 'procedure_tbl'
ordering = ['rowid']

Data can be read from the tables and querysets like the following return 
the correct data:
queryset = FilenameTbl.objects.values(
'rowid', 'filename',
'proceduretbl__rowid')

Raw SQLite commands to write/update to the ProcedureTbl table function 
properly.

If I removed filename_id from the ProcedureTbl, then data can be saved to 
the table.

Any insight into the issue would be much appreciated.

Cheers,
Wai



-- 
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/b90d237f-8c29-42ef-897a-34221704699dn%40googlegroups.com.


What is the necessity of success_url_allowed_hosts on a LogoutView?

2021-07-26 Thread Patrice Chaula
success_url_allowed_hosts: A set 
 of hosts, in addition 
to request.get_host() 
,
 
that are safe for redirecting after logout. Defaults to an empty set 
.

What could go wrong if evilwebsite.com is included in 
success_url_allowed_hosts?

-- 
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/7f6ee52c-de74-4ca0-8e70-cd97d577cc54n%40googlegroups.com.


Re: CSS not linking with HTML

2021-07-26 Thread Baxtiyor Boboraximov
hello . you must add to sittings.py  this code.
STATIC_URL = '/static/'
STATICFILES_DIRS = (str(BASE_DIR.joinpath('static')),)

пт, 28 мая 2021 г. в 23:39, sukhy gill :

> Dear Frnds
> I am unable to  link CSS with HTML
> HTML working but CSS not working inside the .html file with the help of
> LINK in  tag
>
> I am using thefollowings:-
> Setting.py -  STATICFILES_DIRS=[os.path.join(BASE_DIR, 'static'),]
> HTML- {% load static %}
>  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/3ca2aba0-a58f-4298-b248-16c51bdf90a6n%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/CAMG7-GuaEAfH_e-WFwARBe7%2Bn4Maxx4H%2BX4uv8CK%2BtHSS8HqDA%40mail.gmail.com.


Re: AttributeError: module 'polls.views' has no attribute 'index'

2021-07-26 Thread DJANGO DEVELOPER
as you mentioned that you're using django 3.2 but your urls.py file is
following the pattern of django 1.7.
use your urls.py this way : path('your polls url here', views.index,
name='index')

On Mon, Jul 26, 2021 at 6:45 PM Zain  wrote:

> Had the same issue.
>
> Solved, make sure you run each edited python file during the tutorial.
> I guess it needs to update. All I know is this fixed the issue.
>
> On Monday, April 19, 2021 at 2:07:34 AM UTC+10 avi.me...@gmail.com wrote:
>
>> I followed the same tutorial on 17th April 2021 with Python 3.9.2 and
>> Django 3.2 and have exactly the same problems as mentioned above.
>>
>> path('', views.index, name='index'),
>>
>> AttributeError: module 'polls.views' has no attribute 'index'
>>
>> any help on how can I debug this? I am a django noob
>>
>> On Wednesday, 19 April 2017 at 16:31:59 UTC+2 lce...@gmail.com wrote:
>>
>>> Thanks for your reploy.
>>>
>>> Actually I followed the tutorial exactly.
>>>
>>> My polls/views.py has:
>>>
>>> from django.http import HttpResponse
>>>
>>>
>>> def index(request):
>>> return HttpResponse("Hello, world. You're at the polls index.")
>>>
>>> My polls/urls.py has:
>>>
>>> from django.conf.urls import url
>>>
>>> from . import views
>>>
>>> urlpatterns = [
>>> url(r'^$', views.index, name='index'),
>>> ]
>>>
>>>
>>> On Wednesday, 19 April 2017 15:43:57 UTC+2, m712 - Developer wrote:
>>>
 You didn't give us enough info, but I am thinking that you don't have
 an index() function in your polls/views.py. Start the tutorial from the
 beginning and follow it closely.
 On Apr 19, 2017 4:17 PM, Billy Lin  wrote:

 I'm following the getting started tutorial 01 and running into issues
 after creating the polls app. Can someone please help?

 I'm using Python 3.6.1 and Django 1.11.

 Here's the detailed trace:

 Performing system checks...
 Unhandled exception in thread started by >>> check_errors..wrapper at 0x04222810>
 Traceback (most recent call last):
   File
 "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\autoreload.py",
 line
 227, in wrapper
 fn(*args, **kwargs)
   File
 "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\commands\ru
 nserver.py", line 125, in inner_run
 self.check(display_num_errors=True)
   File
 "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py",
 l
 ine 359, in check
 include_deployment_checks=include_deployment_checks,
   File
 "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py",
 l
 ine 346, in _run_checks
 return checks.run_checks(**kwargs)
   File
 "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\checks\registry.py",
 l
 ine 81, in run_checks
 new_errors = check(app_configs=app_configs)
   File
 "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\checks\urls.py",
 line
 16, in check_url_config
 return check_resolver(resolver)
   File
 "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\checks\urls.py",
 line
 26, in check_resolver
 return check_method()
   File
 "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\resolvers.py",
 line 25
 4, in check
 for pattern in self.url_patterns:
   File
 "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\functional.py",
 line
 35, in __get__
 res = instance.__dict__[self.name] = self.func(instance)
   File
 "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\resolvers.py",
 line 40
 5, in url_patterns
 patterns = getattr(self.urlconf_module, "urlpatterns",
 self.urlconf_module)
   File
 "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\functional.py",
 line
 35, in __get__
 res = instance.__dict__[self.name] = self.func(instance)
   File
 "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\resolvers.py",
 line 39
 8, in urlconf_module
 return import_module(self.urlconf_name)
   File
 "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\importlib\__init__.py",
 line 126, in import_modu
 le
 return _bootstrap._gcd_import(name[level:], package, level)
   File "", line 978, in _gcd_import
   File "", line 961, in _find_and_load
   File "", line 950, in
 _find_and_load_unlocked
   File "", line 655, in _load_unlocked
   File "", line 678, 

Re: CSS not linking with HTML

2021-07-26 Thread Nikalesh Patil

Try it

On Mon, 26 Jul, 2021, 7:55 PM V. J,  wrote:

> Hello, I'm making a list of potential customers, in about two months, we
> will have a business plan ready and we will issue a digital token (ICO)
> based on our product in the company.  Would you be interested in learning
> more ...?
>
> Dne čt 3. čvn 2021 10:06 uživatel sukhy gill 
> napsal:
>
>> Dear frnd
>> First of all thanks to all for spare your valueable time for
>> me.🙏🙏
>>
>>
>>  Now my Server is working and inline CSS also working but Internal and
>> External CSS not working.
>> In my last project, image css was also working but now it is not working.
>>
>> Another problem is "python manage.py collectstatic"  commd giving error.
>>
>> My Whatsapp no is - 9493878322 ( Anyone may contact me through my
>> whatsapp also if you feel so)
>>
>> Regards
>>
>>
>>
>> On Mon, May 31, 2021, 22:41 Chelsea Fan > wrote:
>>
>>> You are welcome))
>>>
>>> On Mon, 31 May 2021, 6:44 pm sukhy gill, 
>>> wrote:
>>>
 Thanku so much all of you for your valuable guidance to me 🙏🙏🙏🙂🙂

 On Mon, May 31, 2021, 21:07 Chelsea Fan >>> wrote:

> Good luck 
>
> On Mon, 31 May 2021, 6:31 pm sukhy gill, 
> wrote:
>
>> I deleted my project and will start project again from begining and
>> then will let you know the progress.
>> Regards
>>
>> On Sun, May 30, 2021, 16:48 Mehdi Ismail > wrote:
>>
>>> you want to mention (provide screenshot) of the error?
>>>
>>> On Sunday, 30 May 2021 at 09:14:22 UTC+5:30 sukhy.g...@gmail.com
>>> wrote:
>>>
 Getting error while using using command python manage.py
 collectstatic
 Regarda

 On Sat, May 29, 2021, 21:23 Mehdi Ismail >>> wrote:

> python manage.py collectstatic
>
>
> try that... and update
> On Saturday, 29 May 2021 at 20:44:48 UTC+5:30 sukhy.g...@gmail.com
> wrote:
>
>> Project Folder ➡️static ➡️css➡️style.css➡️
>>
>> On Sat, May 29, 2021, 19:16 Fabiano Leite > wrote:
>>
>>>
>>> Where is located your 'css/style.css';
>>> Em sábado, 29 de maio de 2021 às 10:04:50 UTC-3,
>>> sukhy.g...@gmail.com escreveu:
>>>
 No dear

 On Sat, May 29, 2021, 18:29 Chelsea Fan >>> wrote:

> Is it working now?
>
> On Sat, 29 May 2021, 3:40 pm lalit suthar, <
> sutharl...@gmail.com> wrote:
>
>> read this
>> https://docs.djangoproject.com/en/2.2/intro/tutorial06/ and
>> check how you are giving paths. Also after loading the page on 
>> your browser
>> go to "View Page Source" and click on the CSS file link and 
>> check if the
>> file is opening or not.
>>
>> On Saturday, 29 May 2021 at 17:57:21 UTC+5:30
>> sukhy.g...@gmail.com wrote:
>>
>>> Yes Sir,There was no mistake in code. Code problem was only
>>> in mail content actually code was correct as instruction given 
>>> by Aniket Sir
>>>
>>> Regards
>>>
>>>
>>> On Sat, May 29, 2021, 13:14 lalit suthar <
>>> sutharl...@gmail.com wrote:
>>>
 have you checked Aniket's answer?

 On Saturday, 29 May 2021 at 11:09:07 UTC+5:30
 sukhy.g...@gmail.com wrote:

> Done Sir, but not working
>
> On Sat, May 29, 2021, 10:50 Venu Gopal <
> reachme...@gmail.com wrote:
>
>> In Firefox  Goto Preferences ---> Choose Privacy and
>> Security ---> scroll down until you get cookies and site 
>> data --> clear data
>> Chrome  Goto Settings ---> Choose Privacy and
>> Security ---> select cookies and other site data --> select 
>> see all cookies
>> and site data --> Remove all
>>
>> On Sat, May 29, 2021 at 9:50 AM sukhy gill <
>> sukhy.g...@gmail.com> wrote:
>>
>>> @Venu Gopal
>>>
>>> No Sir, I don't know, how to do this.
>>>
>>> May I know Sir, how to do the same?
>>>
>>> Regards
>>>
>>> On Sat, May 29, 2021, 09:41 Venu Gopal <
>>> reachme...@gmail.com wrote:
>>>
 Hi, Have you tried deleting existing cache and cookies
 in the browser?

 On Sat, May 29, 2021 at 12:08 AM sukhy gill <

Re: use of annotate in django query

2021-07-26 Thread V. J
Hello, I'm making a list of potential customers, in about two months, we
will have a business plan ready and we will issue a digital token (ICO)
based on our product in the company.  Would you be interested in learning
more ...?

Dne so 5. čvn 2021 19:09 uživatel Lalit Suthar 
napsal:

> just replied to your mail
>
> On Sat, 5 Jun 2021 at 11:48, Eugene TUYIZERE 
> wrote:
>
>> Dear Suthar,
>>
>> Can I have your private contact?
>>
>> regards,
>>
>> On Fri, 4 Jun 2021 at 06:25, Lalit Suthar 
>> wrote:
>>
>>> my pleasure :)
>>>
>>> On Thu, 3 Jun 2021 at 20:28, Eugene TUYIZERE 
>>> wrote:
>>>
 Dear Suthar,

 Thank you very much. It works well.


 On Thu, 3 Jun 2021 at 16:48, Lalit Suthar 
 wrote:

> not sure but maybe this can work inside views replace
> chart = {
>   'chart': {'type': 'column'},
>   'title': {'text': 'Previous statistics'},
>   'xAxis': {'replist': replist},
>   'series': [arriva_days]
> }
> with
> chart = {
>   'chart': {'type': 'column'},
>   'title': {'text': 'Previous statistics'},
>   'xAxis': {'categories': replist},
>   'series': [arriva_days]
> }
>
> On Thu, 3 Jun 2021 at 18:00, Eugene TUYIZERE 
> wrote:
>
>> This what I have in summarizedchart.html:
>>
>> {% extends "layouts/base.html" %}
>> {% load static %}
>> {% block title %} Repport {% endblock %}
>>
>> 
>> {% block stylesheets %}{% endblock stylesheets %}
>>
>> {% block content %}
>>
>> 
>> 
>> 
>> 
>> 
>> Report
>>
>> 
>>
>> 
>>
>> 
>> 
>> Highcharts.chart('container', {{ chart|safe }});
>> 
>> 
>> 
>> 
>> 
>> 
>> {% endblock content %}
>> {% block custom_js %}
>>
>> {% endblock custom_js %}
>>
>> On Thu, 3 Jun 2021 at 14:22, Lalit Suthar 
>> wrote:
>>
>>> so the view is not giving error right now but maybe we are passing
>>> the data in different format then the chart is expecting.
>>> What are you using for drawing the chart? can I see the code inside
>>> "summarizedchart.html"
>>>
>>> On Thu, 3 Jun 2021 at 17:43, Eugene TUYIZERE <
>>> eugenetuyiz...@gmail.com> wrote:
>>>
 Dear Suthar,

 You saved my day. Once more, the chart is displayed but the date is
 not displayed on Xaxis. This how it is:

 [image: image.png]

 Th codes are:
 def reqChart(request):
 current_date = date.today()
 days_before = date.today()-timedelta(days=30)
 datelist = Customer_Requests.objects.values("arrival_date").
 annotate(num_req=Count("request_name")).order_by('-arrival_date')[:
 20:-1]
 replist = list()
 sumdata = list()
 for listd in datelist:
 replist.append(listd['arrival_date'])
 sumdata.append(listd['num_req'])
 arriva_days = {
 'name': 'Datess',
 'data': sumdata,
 'color': 'green'
 }
 chart = {
 'chart': {'type': 'column'},
 'title': {'text': 'Previous statistics'},
 'xAxis': {'replist': replist},
 'series': [arriva_days]
 }
 dump = json.dumps(chart,cls=DjangoJSONEncoder)
 return render(request,'summarizedchart.html',{'chart': dump})


 On Thu, 3 Jun 2021 at 13:27, lalit suthar 
 wrote:

> Hi there!
> make these couple of changes
>
> 1) from django.core.serializers.json import DjangoJSONEncoder
> 2) dump3 = json.dumps(chart3, cls=DjangoJSONEncoder)
> On Thursday, 3 June 2021 at 16:18:15 UTC+5:30 eugenet...@gmail.com
> wrote:
>
>> Dear Suthar,
>>
>> Your idea works well , but I want now to display the result on
>> chart. Below is the code I am trying to use:
>> but Am getting the error message:
>>
>> Exception Value:
>>
>> Object of type date is not JSON serializable
>>
>>
>> def reqChart(request):
>> aa = Customer_Requests.objects.values("arrival_date").annotate(
>> num_req=Count("request_name")).order_by('-arrival_date')[:20:-1]
>> print(aa)
>> datesb = list()
>> sumdata = list()
>> for dd in aa:
>> datesb.append(dd['arrival_date'])
>> sumdata.append(dd['num_req'])
>> arriva_days = {
>> 'name': 'Datess',
>> 'data': sumdata,
>> 'color': 'green'
>> }
>> chart3 = {
>> 'chart': {'type': 'column'},
>> 'title': {'text': 'Previous statistics'},
>> 'xAxis': {'datesb': datesb},
>> 'series': [arriva_days]
>> }
>> dump3 = json.dumps(chart3)
>> return render(request,'summarizedchart.html',{'chart3': dump3})
>>
>>

Re: CSS not linking with HTML

2021-07-26 Thread V. J
Hello, I'm making a list of potential customers, in about two months, we
will have a business plan ready and we will issue a digital token (ICO)
based on our product in the company.  Would you be interested in learning
more ...?

Dne čt 3. čvn 2021 10:06 uživatel sukhy gill 
napsal:

> Dear frnd
> First of all thanks to all for spare your valueable time for
> me.🙏🙏
>
>
>  Now my Server is working and inline CSS also working but Internal and
> External CSS not working.
> In my last project, image css was also working but now it is not working.
>
> Another problem is "python manage.py collectstatic"  commd giving error.
>
> My Whatsapp no is - 9493878322 ( Anyone may contact me through my whatsapp
> also if you feel so)
>
> Regards
>
>
>
> On Mon, May 31, 2021, 22:41 Chelsea Fan  wrote:
>
>> You are welcome))
>>
>> On Mon, 31 May 2021, 6:44 pm sukhy gill, 
>> wrote:
>>
>>> Thanku so much all of you for your valuable guidance to me 🙏🙏🙏🙂🙂
>>>
>>> On Mon, May 31, 2021, 21:07 Chelsea Fan >> wrote:
>>>
 Good luck 

 On Mon, 31 May 2021, 6:31 pm sukhy gill, 
 wrote:

> I deleted my project and will start project again from begining and
> then will let you know the progress.
> Regards
>
> On Sun, May 30, 2021, 16:48 Mehdi Ismail  wrote:
>
>> you want to mention (provide screenshot) of the error?
>>
>> On Sunday, 30 May 2021 at 09:14:22 UTC+5:30 sukhy.g...@gmail.com
>> wrote:
>>
>>> Getting error while using using command python manage.py
>>> collectstatic
>>> Regarda
>>>
>>> On Sat, May 29, 2021, 21:23 Mehdi Ismail >>
 python manage.py collectstatic


 try that... and update
 On Saturday, 29 May 2021 at 20:44:48 UTC+5:30 sukhy.g...@gmail.com
 wrote:

> Project Folder ➡️static ➡️css➡️style.css➡️
>
> On Sat, May 29, 2021, 19:16 Fabiano Leite  wrote:
>
>>
>> Where is located your 'css/style.css';
>> Em sábado, 29 de maio de 2021 às 10:04:50 UTC-3,
>> sukhy.g...@gmail.com escreveu:
>>
>>> No dear
>>>
>>> On Sat, May 29, 2021, 18:29 Chelsea Fan >> wrote:
>>>
 Is it working now?

 On Sat, 29 May 2021, 3:40 pm lalit suthar, <
 sutharl...@gmail.com> wrote:

> read this
> https://docs.djangoproject.com/en/2.2/intro/tutorial06/ and
> check how you are giving paths. Also after loading the page on 
> your browser
> go to "View Page Source" and click on the CSS file link and check 
> if the
> file is opening or not.
>
> On Saturday, 29 May 2021 at 17:57:21 UTC+5:30
> sukhy.g...@gmail.com wrote:
>
>> Yes Sir,There was no mistake in code. Code problem was only
>> in mail content actually code was correct as instruction given 
>> by Aniket Sir
>>
>> Regards
>>
>>
>> On Sat, May 29, 2021, 13:14 lalit suthar <
>> sutharl...@gmail.com wrote:
>>
>>> have you checked Aniket's answer?
>>>
>>> On Saturday, 29 May 2021 at 11:09:07 UTC+5:30
>>> sukhy.g...@gmail.com wrote:
>>>
 Done Sir, but not working

 On Sat, May 29, 2021, 10:50 Venu Gopal <
 reachme...@gmail.com wrote:

> In Firefox  Goto Preferences ---> Choose Privacy and
> Security ---> scroll down until you get cookies and site data 
> --> clear data
> Chrome  Goto Settings ---> Choose Privacy and Security
> ---> select cookies and other site data --> select see all 
> cookies and site
> data --> Remove all
>
> On Sat, May 29, 2021 at 9:50 AM sukhy gill <
> sukhy.g...@gmail.com> wrote:
>
>> @Venu Gopal
>>
>> No Sir, I don't know, how to do this.
>>
>> May I know Sir, how to do the same?
>>
>> Regards
>>
>> On Sat, May 29, 2021, 09:41 Venu Gopal <
>> reachme...@gmail.com wrote:
>>
>>> Hi, Have you tried deleting existing cache and cookies
>>> in the browser?
>>>
>>> On Sat, May 29, 2021 at 12:08 AM sukhy gill <
>>> sukhy.g...@gmail.com> wrote:
>>>
 Dear Frnds
 I am unable to  link CSS with HTML
 HTML working but CSS not working inside the .htm

Re: AttributeError: module 'polls.views' has no attribute 'index'

2021-07-26 Thread Zain
Had the same issue. 

Solved, make sure you run each edited python file during the tutorial. 
I guess it needs to update. All I know is this fixed the issue.

On Monday, April 19, 2021 at 2:07:34 AM UTC+10 avi.me...@gmail.com wrote:

> I followed the same tutorial on 17th April 2021 with Python 3.9.2 and 
> Django 3.2 and have exactly the same problems as mentioned above.
>
> path('', views.index, name='index'),
>
> AttributeError: module 'polls.views' has no attribute 'index'
>
> any help on how can I debug this? I am a django noob
>
> On Wednesday, 19 April 2017 at 16:31:59 UTC+2 lce...@gmail.com wrote:
>
>> Thanks for your reploy.
>>
>> Actually I followed the tutorial exactly.
>>
>> My polls/views.py has:
>>
>> from django.http import HttpResponse
>>
>>
>> def index(request):
>> return HttpResponse("Hello, world. You're at the polls index.")
>>
>> My polls/urls.py has:
>>
>> from django.conf.urls import url
>>
>> from . import views
>>
>> urlpatterns = [
>> url(r'^$', views.index, name='index'),
>> ]
>>
>>
>> On Wednesday, 19 April 2017 15:43:57 UTC+2, m712 - Developer wrote:
>>
>>> You didn't give us enough info, but I am thinking that you don't have an 
>>> index() function in your polls/views.py. Start the tutorial from the 
>>> beginning and follow it closely.
>>> On Apr 19, 2017 4:17 PM, Billy Lin  wrote:
>>>
>>> I'm following the getting started tutorial 01 and running into issues 
>>> after creating the polls app. Can someone please help?
>>>
>>> I'm using Python 3.6.1 and Django 1.11.
>>>
>>> Here's the detailed trace:
>>>
>>> Performing system checks...
>>> Unhandled exception in thread started by >> check_errors..wrapper at 0x04222810>
>>> Traceback (most recent call last):
>>>   File 
>>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\autoreload.py",
>>>  
>>> line
>>> 227, in wrapper
>>> fn(*args, **kwargs)
>>>   File 
>>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\commands\ru
>>> nserver.py", line 125, in inner_run
>>> self.check(display_num_errors=True)
>>>   File 
>>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py",
>>>  
>>> l
>>> ine 359, in check
>>> include_deployment_checks=include_deployment_checks,
>>>   File 
>>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py",
>>>  
>>> l
>>> ine 346, in _run_checks
>>> return checks.run_checks(**kwargs)
>>>   File 
>>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\checks\registry.py",
>>>  
>>> l
>>> ine 81, in run_checks
>>> new_errors = check(app_configs=app_configs)
>>>   File 
>>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\checks\urls.py",
>>>  
>>> line
>>> 16, in check_url_config
>>> return check_resolver(resolver)
>>>   File 
>>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\checks\urls.py",
>>>  
>>> line
>>> 26, in check_resolver
>>> return check_method()
>>>   File 
>>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\resolvers.py",
>>>  
>>> line 25
>>> 4, in check
>>> for pattern in self.url_patterns:
>>>   File 
>>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\functional.py",
>>>  
>>> line
>>> 35, in __get__
>>> res = instance.__dict__[self.name] = self.func(instance)
>>>   File 
>>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\resolvers.py",
>>>  
>>> line 40
>>> 5, in url_patterns
>>> patterns = getattr(self.urlconf_module, "urlpatterns", 
>>> self.urlconf_module)
>>>   File 
>>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\functional.py",
>>>  
>>> line
>>> 35, in __get__
>>> res = instance.__dict__[self.name] = self.func(instance)
>>>   File 
>>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\resolvers.py",
>>>  
>>> line 39
>>> 8, in urlconf_module
>>> return import_module(self.urlconf_name)
>>>   File 
>>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\importlib\__init__.py",
>>>  
>>> line 126, in import_modu
>>> le
>>> return _bootstrap._gcd_import(name[level:], package, level)
>>>   File "", line 978, in _gcd_import
>>>   File "", line 961, in _find_and_load
>>>   File "", line 950, in 
>>> _find_and_load_unlocked
>>>   File "", line 655, in _load_unlocked
>>>   File "", line 678, in exec_module
>>>   File "", line 205, in 
>>> _call_with_frames_removed
>>>   File "C:\Users\cephalin\Repos\django\mysite\mysite\urls.py", line 20, 
>>> in 
>>> url(r'^polls/', include('polls.urls')),
>>>   File 
>>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python3

Re: Is there a quick and easy way to copy a model instance

2021-07-26 Thread Mike Dewhirst
--(Unsigned mail from my phone)
 Original message From: Markus Holtermann 
 Date: 26/7/21  20:04  (GMT+10:00) To: Django Users 
 Subject: Re: Is there a quick and easy way to 
copy a model instance Hi Mike,Last time I checked, when you set `instance.pk = 
None` and then do `instance.save()`, Django will create a new 
instance.CheersMarkusOn Mon, Jul 26, 2021, at 9:13 AM, Mike Dewhirst wrote:> 
I'm archiving a particular child record every time it is saved but > connecting 
it to another parent.> > Each year I create a new parent and the saving process 
keeps going but > the copied child gets connected to the new parent.> > That 
will give me an annual snapshot of the child record.> > At the moment I'm just 
copying it one field at a time.> > Thanks for any hints> > Cheers> > Mike> > > 
-- > Signed email is an absolute defence against phishing. This email has> been 
signed with my private key. If you import my public key you can> automatically 
decrypt my signature and be sure it came from me. Just> ask and I'll send it to 
you. Your email software can handle signing.> > > -- > 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/8db31592-8835-2095-22be-5ce4e6989ed2%40dewhirst.com.au.>
 > Attachments:> * OpenPGP_signature-- 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/e624b395-5b19-4c11-9f1a-aa952da220fc%40www.fastmail.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/60fe92de.1c69fb81.4460a.9174SMTPIN_ADDED_MISSING%40gmr-mx.google.com.


Re: Is there a quick and easy way to copy a model instance

2021-07-26 Thread Markus Holtermann
Hi Mike,

Last time I checked, when you set `instance.pk = None` and then do 
`instance.save()`, Django will create a new instance.

Cheers

Markus

On Mon, Jul 26, 2021, at 9:13 AM, Mike Dewhirst wrote:
> I'm archiving a particular child record every time it is saved but 
> connecting it to another parent.
> 
> Each year I create a new parent and the saving process keeps going but 
> the copied child gets connected to the new parent.
> 
> That will give me an annual snapshot of the child record.
> 
> At the moment I'm just copying it one field at a time.
> 
> Thanks for any hints
> 
> Cheers
> 
> Mike
> 
> 
> -- 
> Signed email is an absolute defence against phishing. This email has
> been signed with my private key. If you import my public key you can
> automatically decrypt my signature and be sure it came from me. Just
> ask and I'll send it to you. Your email software can handle signing.
> 
> 
> -- 
> 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/8db31592-8835-2095-22be-5ce4e6989ed2%40dewhirst.com.au.
> 
> Attachments:
> * OpenPGP_signature

-- 
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/e624b395-5b19-4c11-9f1a-aa952da220fc%40www.fastmail.com.


Is there a quick and easy way to copy a model instance

2021-07-26 Thread Mike Dewhirst
I'm archiving a particular child record every time it is saved but 
connecting it to another parent.


Each year I create a new parent and the saving process keeps going but 
the copied child gets connected to the new parent.


That will give me an annual snapshot of the child record.

At the moment I'm just copying it one field at a time.

Thanks for any hints

Cheers

Mike


--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.


--
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/8db31592-8835-2095-22be-5ce4e6989ed2%40dewhirst.com.au.


OpenPGP_signature
Description: OpenPGP digital signature