Re: django admin css not loading in localhost

2018-02-22 Thread Costja Covtushenko
Hi,

Can you provide html code of that page here?

Regards,
Constantine C.

> On Feb 22, 2018, at 7:49 PM, anurag bhadauriya  
> wrote:
> 
> i am using django-1.11.6. whenever i open my admin panel and login to it then 
> it looks like the simple html file.  no any css files are loading .The 
> interface i am seeing is totally different than that of the tutorials using 
> which i am learning.please give me the stepwise solution
> 
> -- 
> 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/0d68a248-fa11-4924-aaed-d88adfc284b2%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1D92EB99-C051-4A94-A4FC-EB16FC5B1622%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: object_list in html

2018-02-22 Thread Costja Covtushenko
Hi Alan,

How did you receive that `object_list`?
You should filter it based on you user and ‘Running’ inside the view. And then 
just check if it has count > 0.

I hope that does have sense to you.

Regards,
Constantine C.

> On Feb 22, 2018, at 7:34 PM, Alan  wrote:
> 
> Hi there,
> 
> I am using Django 2 with Python 3.5
> 
> I have this query, simple, in mysql:
> 
> select * from submit_submission where jstatus = 'Running' and juser = 
> 'jonhdoe';
> 
> Basically, I have a table that tracks the jobs I am running.
> 
> In my html, I'd like to replace this part (in red):
> 
> {% if object_list.last.jstatus == 'Running' %}
>  Page automatically 
> refreshed every 5 seconds | {% now "jS M y H:i" %}
> {% else %}No running jobs.
> {% endif %}
> 
> ​with something equivalent to my query above where I need to know if there's 
> at least one job running for a given user.
> 
> I've been looking at 
> https://docs.djangoproject.com/en/2.0/ref/models/querysets 
>  ​but I couldn't 
> work out a solution.
> 
> ​Many thanks in advance,
> 
> Alan​
> 
> -- 
> I'll cycle across Britain in 2018 for a charity, would you consider
> supporting my cause? http://uk.virginmoneygiving.com/AlanSilva 
> 
> Many thanks!
> --
> Alan Wilter SOUSA da SILVA, DSc
> Senior Bioinformatician, UniProt
> European Bioinformatics Institute (EMBL-EBI)
> European Molecular Biology Laboratory
> Wellcome Trust Genome Campus
> Hinxton
> Cambridge CB10 1SD
> United Kingdom
> Tel: +44 (0)1223 494588
> 
> -- 
> 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/CAEznbznNwJW4omM%3DMncj8aoBcg3AW8r-yFTMMkb5ZBiB%3Dsv96Q%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/7E9B0630-E1A7-4759-B082-998273D6B330%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: unbound method save() must be called with MyModel instance as first argument

2018-01-23 Thread Costja Covtushenko
Also it looks like in your separate tread Daniel wrote:

> model_instance = model()

That is how you can create instance from model.

Regards,
C

> On Jan 23, 2018, at 9:29 PM, Costja Covtushenko <kostyak7...@gmail.com> wrote:
> 
> Hi,
> 
> I did not mention your use of `stattr()`.
> I was about class VS instance of that class.
> 
> Did you say that problem is with unbound method `save()` which should be 
> called with instance as a first argument?
> 
> Regards,
> C
> 
>> On Jan 23, 2018, at 9:18 PM, Tom Tanner <dontsendemailher...@gmail.com 
>> <mailto:dontsendemailher...@gmail.com>> wrote:
>> 
>> In my case, I'm using `setattr()` because I need to access a field via 
>> string and set it. I can't do `obj.myCol = "blah blah"` because this whole 
>> code is part of a `manage.py` command I'm setting up that asks the user to 
>> input the name of the model and column they want to add a new record for.
>> 
>> On Tuesday, January 23, 2018 at 7:59:11 PM UTC-5, Costja Covtushenko wrote:
>> Hi,
>> 
>> It looks like with get_model() you’ve gotten Model class not Model instance.
>> You can use `save()` on instance only.
>> You need to have something like:
>> 
>> class_ = get_model(…)
>> instance = class_()
>> instance.save()
>> 
>> I hope that make sense to you.
>> 
>> Regards,
>> C.
>> 
>>> On Jan 23, 2018, at 7:43 PM, Tom Tanner <dontsende...@ <>gmail.com 
>>> <http://gmail.com/>> wrote:
>>> 
>>> get_model
>> 
>> 
>> -- 
>> 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 
>> <mailto:django-users+unsubscr...@googlegroups.com>.
>> To post to this group, send email to django-users@googlegroups.com 
>> <mailto:django-users@googlegroups.com>.
>> Visit this group at https://groups.google.com/group/django-users 
>> <https://groups.google.com/group/django-users>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/f06c409b-ca0a-4350-8736-26ad0553ab67%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/f06c409b-ca0a-4350-8736-26ad0553ab67%40googlegroups.com?utm_medium=email_source=footer>.
>> For more options, visit https://groups.google.com/d/optout 
>> <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/EE9978C8-72EA-4FFF-B3DE-284097FA4880%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: unbound method save() must be called with MyModel instance as first argument

2018-01-23 Thread Costja Covtushenko
Hi,

I did not mention your use of `stattr()`.
I was about class VS instance of that class.

Did you say that problem is with unbound method `save()` which should be called 
with instance as a first argument?

Regards,
C

> On Jan 23, 2018, at 9:18 PM, Tom Tanner <dontsendemailher...@gmail.com> wrote:
> 
> In my case, I'm using `setattr()` because I need to access a field via string 
> and set it. I can't do `obj.myCol = "blah blah"` because this whole code is 
> part of a `manage.py` command I'm setting up that asks the user to input the 
> name of the model and column they want to add a new record for.
> 
> On Tuesday, January 23, 2018 at 7:59:11 PM UTC-5, Costja Covtushenko wrote:
> Hi,
> 
> It looks like with get_model() you’ve gotten Model class not Model instance.
> You can use `save()` on instance only.
> You need to have something like:
> 
> class_ = get_model(…)
> instance = class_()
> instance.save()
> 
> I hope that make sense to you.
> 
> Regards,
> C.
> 
>> On Jan 23, 2018, at 7:43 PM, Tom Tanner <dontsende...@ <>gmail.com 
>> <http://gmail.com/>> wrote:
>> 
>> get_model
> 
> 
> -- 
> 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 
> <mailto:django-users+unsubscr...@googlegroups.com>.
> To post to this group, send email to django-users@googlegroups.com 
> <mailto:django-users@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-users 
> <https://groups.google.com/group/django-users>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/f06c409b-ca0a-4350-8736-26ad0553ab67%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/f06c409b-ca0a-4350-8736-26ad0553ab67%40googlegroups.com?utm_medium=email_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <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/1C3AFAC1-BD93-44DB-AB61-898CCC582731%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: unbound method save() must be called with MyModel instance as first argument

2018-01-23 Thread Costja Covtushenko
Hi,

It looks like with get_model() you’ve gotten Model class not Model instance.
You can use `save()` on instance only.
You need to have something like:

class_ = get_model(…)
instance = class_()
instance.save()

I hope that make sense to you.

Regards,
C.

> On Jan 23, 2018, at 7:43 PM, Tom Tanner  wrote:
> 
> get_model

-- 
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/97F60EEB-4048-4FD1-9535-C05F1C32ABB6%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Strange the global variable behavior

2018-01-23 Thread Costja Covtushenko
Hi,

Sorry for asking but how exactly you decided that those `global` variables was 
not updated?

Regards,
C

> On Jan 23, 2018, at 6:47 AM, Максим Королёв  wrote:
> 
> Hi there.
> Could someone explain what happens. I had a little project on Python 2.7 and 
> decided to move it on 3.6. Everything has gone by perfectly. The project 
> works well as before but there is one exception noticed by me: the global 
> statement works not always. The code below doesn't update the global variable 
> zip_file_name and I can't grasp why. Any suggestions.
> 
> zip_file_name = os.path.join(MEDIA_ROOT, 'wb`s.zip')
> file_list = []
> 
> 
> @permission_required("wb_search.change_wbsearch", login_url='access_denied')
> @csrf_exempt
> def input_data_form(request):
> global zip_file_name, file_list
> if request.method == 'POST':
> form = WbSearchForm(request.POST)
> if form.is_valid():
> text = request.POST['wbs_nums']
> picked = form.cleaned_data.get('category')
> try:
> wb_nums = process_input(text, LENGTH_OF_STR_TO_PROCESS)
> zip_file_name, file_list = get_wb_pdf_as_zip(wb_nums, picked)
> m = SearchHistory(user=str(request.user), 
> curr_date=datetime.now(), list_desired_docs=', '.join([str(rec[0]) for rec in 
> file_list]))
> m.save()
> return HttpResponseRedirect('/wb_search/search_finished/')
> except NoDataToSearch:
> return 
> HttpResponseRedirect('/wb_search/wb_search_incorrect_data/')
> else:
> return 
> HttpResponseRedirect('/wb_search/wb_search_incorrect_data/')
> else:
> form = WbSearchForm()
> # context = context.update(csrf(request))
> return render_to_response('wb_search_input_data_form.html',
>   {'form': form, 'title': 'Номера для поиска',
>'header': 'Поиск PDF файлов вэйбилов',
>'text': 'Вставте в это поле номера вэйбилов 
> PDF файлы которых необходимо найти.',
>'textarea_title': 'Вставте в это поле номера 
> вэйбилов PDF файлы которых необходимо '
>  'найти.',
>'submit_title': 'Начать поиск',
>'element_id': 'find_button', 'element_method': 
> 'click',
>'spinner_message': 'Ожидайте окончания 
> поиска...', },
>   RequestContext(request))
> 
> -- 
> 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/e833541c-0b75-486c-a06e-5aa8ccb5d446%40googlegroups.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3DB54166-0F6B-4F44-9DB1-05BFE47D578F%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: modelform DateField rendering as text

2018-01-22 Thread Costja Covtushenko
Hi,

Do you mean that it should be rendered like:
?

If so check that documentation page 
.
It is said that DateInput renders as type=’text’.

If you are curios why it is done in that way, please ask at: 
django-develop...@googlegroups.com 

Regards,
Constantine C.

> On Jan 22, 2018, at 10:33 AM, Ruchit Bhatt  
> wrote:
> 
> forms.ModelForm

-- 
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/00B46B8B-BC43-4A03-85ED-1E756AEA13B0%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: 'WSGIRequest' object is not callable error generate

2018-01-19 Thread Costja Covtushenko
Hi,

As suggested Etienne you misspelled `render` method.
Please find more information on that 
 
documentation page.

Regards,
Constantine C.

> On Jan 19, 2018, at 2:47 PM, Etienne Robillard  wrote:
> 
> 
> 
> Le 2018-01-19 à 13:53, Amit Kadivar a écrit :
>> 
>> 
>> return request(request,'signup.html',{'form':form})
> 
> That line looks incorrect to me. You need to use render_response or a similar 
> function... I don't remember the exact function name, however.
> 
> Cheers,
> 
> Etienne 
> 
>> -- 
>> 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/9a822b59-f3cb-4024-955a-11c8e9ca8a9e%40googlegroups.com
>>  
>> .
>> For more options, visit https://groups.google.com/d/optout 
>> .
> 
> -- 
> Etienne Robillard
> tkad...@yandex.com 
> https://www.isotopesoftware.ca/ 
> 
> -- 
> 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/070df736-c935-4b3c-2fd4-20e05c4c6631%40yandex.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/A8FDED7A-E009-4EBF-B0CD-388563D7EF12%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need to create an edit box connected to one table field

2018-01-19 Thread Costja Covtushenko
Hi Eileen,

Can you please elaborate a little bit?
Do you use Form? Can you provide its code?

Also sorry but it is not clear what are you trying to achieve with those value?
Is it for searching data in DB?

Regards,
Constantine C.

> On Jan 19, 2018, at 5:08 PM, eil...@themaii.org wrote:
> 
> handicapped

-- 
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/3E238B5D-ED05-42EC-B451-98133471DB3E%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: store media files on amazon Elastic File System

2017-12-25 Thread Costja Covtushenko
Hello,

I believe that you do need to read this 

 documentation page.
It has description how to use Amazon S3 bucket. But approach should be the same.

Regards,
Constantine C.

> On Dec 20, 2017, at 9:43 AM, gavaska...@datayaan.com wrote:
> 
> Elastic File System

-- 
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/BD9460E2-C211-4EE2-B368-6CE69DB5E93C%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django foms problems .. please help me

2017-12-24 Thread Costja Covtushenko
Hi Vijay,

Can you be more specific?
What invalid section do you get?
And what is the data you are using in choice field?


Regards,
Constantine C.

> On Dec 23, 2017, at 2:39 PM, vijaysundeep  wrote:
> 
> Hi Everyone,
> 
> I am trying to pass current user  as request.user.
> 
> It handles properly in forms and i am getting choice filed with the help of 
> it.
> 
> But, when i tried to read the data throough post method. it is going to form 
> invalid section..
> 
> Please help me ASAP.
> 
> views.py
> def instancecreate(request):
> if request.method=='POST':
> print('POST FORM @')
> form=InstanceCreationForm(request.user,request.POST)
> 
> if form.is_valid():
> images = request.POST['name']
> print('you handled post data')
> print(images)
> return HttpResponse(images)
> else:
> print('NOT a Valid Form !')
> form=InstanceCreationForm(request.user)
> return render(request, 'url/User/cinstance.html', {'form': form})
> 
> 
> else:
> 
> form=InstanceCreationForm(request.user)
> return render(request, 'url/User/cinstance.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 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/138500c0-6721-4ba8-ad32-2a51816ef25d%40googlegroups.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/AF66F2B2-31C9-4905-A4B4-20B629E3A1E9%40gmail.com.
For more options, visit https://groups.google.com/d/optout.