Tuesday, April 30, 2019

Search and display results using calendar in Django

Hi Everybody,

I need help.

I want to perform search operation using calendars. I shall select two dates i.e. max_date which shall not be more than the current date but can be less and min_date, these two shall be the days range. The result fields are: in_count, out_count, and dwell_time. The output should sum up all the results of all the days which are between the max_date and min_date. How can I do that? Please help. Is there a need to define a model for this? I am completely clueless.  

Expected result is getting the output in the same form as in result_list.html with the result of all the fields of the days starting from min_date till max_date getting displayed and the min_date and max_date should also be shown in the template. Kindly help. 

My model :

  class Result(models.Model):        in_count   = models.PositiveIntegerField()      out_count  = models.PositiveIntegerField()      date_time  = models.DateTimeField()      time       = models.TimeField()        def __str__(self):
return "{},{},{},{}".format(self.in_count, self.out_count, self.date_time, self.time) 

My views.py

class ResultListView(ListView):        def get_queryset(self, *args, **kwargs):          qs = Result.objects.all()          print(self.request.GET)          query = self.request.GET.get("q", None)          if query is not None:              qs = qs.filter(                  Q(in_count__icontains=query) | Q(out_count__icontains=query) | Q(date_time__icontains=query) | Q(time__icontains=query))          return qs        def get_context_data(self, *args, **kwargs):          context = super(ResultListView, self).get_context_data(*args, **kwargs)            return context      class ResultDetailView(DetailView):      queryset = Result.objects.all()

My result_list.html
<div class="card-header">Result on {{ object.date_time}}</div>    <div class="card-body">      <h3 class="card-title"><a  href="{% url 'result:result' %}"style="color: white; ">Result of Model</a></h3>      <p class="card-text"> In Count {{ object.in_count }}</p>        <p class="card-text">Out Count {{ object.out_count}}</p>

--
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+unsubscribe@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/CALr9hQ2LV7WnQ3QT2jUy-O%3DO%3DNLtzeFfp7dk9RJXcx8dmxdVWw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Django session

How i can configure session engine in Django through File based sessions?

--
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+unsubscribe@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/e1cf6de9-9c03-410d-8d64-c3ebc92585fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: WYSIWYG/Rich Text Editor recommendations

* Joel Mathew <joel@joel.su> [190430 17:29]:
> Currently I'm using quill. It's easy to implement, and has all basic
> features.

Cool. Thanks for that Joel.

> > I'd like to recreate the same functionality with django. I will need
> > to be able to include embedded images.

--
Tim Johnson
http://www.tj49.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+unsubscribe@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/20190501024004.GE2404%40mail.akwebsoft.com.
For more options, visit https://groups.google.com/d/optout.

Re: Issues with editing Django files?

Awesome, thank you very much!

On Sat, Apr 27, 2019 at 4:19 PM André Toscano <andre.toscano@gmail.com> wrote:
Hi Kevin, 
You shouldn't put your files inside the Program Files directory, it's protected by the system. Instead, you should create a directory (my suggestion) 'git' in your user's directory.
Inside this directory you should create the directory that will organize your code.
After that you need to create a virtualenv and installl all Python packages required in the virtual environment.
Most Python IDE (WingIDE, VS Code, PyCharm, Eclipse, etc) supports virtual environments.
On Windows you have different options to install Python (Direct, Anaconda, CygWin, etc) and create the virtual, the best would be to use a Linux or Unix based system. Consider a virtual machine on VirtualBox with a linux distribution.
Even if you are able to run as admin, you could create security issues.
Regards
André 

Ps.: Here there is a good reference on how to setup the system to develop with Django: https://tutorial.djangogirls.org/en/django_installation/





Em ter, 23 de abr de 2019 às 09:13, Outomyelement <kweinberg.baker@gmail.com> escreveu:
I'm new to Python and am working through the Crash Course for Python book using Windows 10 and the latest version of Python and Django.

I am trying to edit the models.py file, but i get a permissions denied:



I am learning on a company computer, i'm wondering if my user permissions are an issue? Given i'm not an admin for my computer, am I going to have an issue trying to save files in these folders without some admin access? I am able to run the cmd as admin?

Thank you,

Kevin

--
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+unsubscribe@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/97307eae-7819-445d-bc9d-4b350a8fbafe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/ZZOnhbSWbEQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users+unsubscribe@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/CAPrw5MG7f3umJ2ipeSYnG6r8%3DqkDBbMseWaK8dSy%3DnM9PLPbnQ%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+unsubscribe@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/CAFh_u0vPyjaySD4J6MvFyUYdd-JZ2m3UpBNLvuuOEBhQx3n0WA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: WYSIWYG/Rich Text Editor recommendations

Currently I'm using quill. It's easy to implement, and has all basic features.
Sincerely yours,

 Joel G Mathew



On Wed, 1 May 2019 at 05:47, Tim Johnson <tim@akwebsoft.com> wrote:
Using python 3.7.2 and django 2.1.5

Production is in Ubuntu 16.04 and prospective deployment is likely
to be CentOS with same python/django.

I'm a retired python developer.

I'd welcome recommendations and/or caveats regarding  a stable
WYSIWIG "plugin".

Much is available on google, but it is always edifying to hear
individual comments.

I currently publish on drupal using its ckeditor plugin. My common
method is to compose articles in LibreOffice, then copy and paste
into the editor. Works well, except that it IS drupal.

I'd like to recreate the same functionality with django. I will need
to be able to include embedded images.

TIA
--
Tim
http://www.tj49.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+unsubscribe@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/20190501001716.GD2404%40mail.akwebsoft.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+unsubscribe@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/CAA%3Diw_9GFDrj4DT%3DrZg8UMZeXLj7iG%2Bcz8moe_RNZNfNHkTE%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.