top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to add limit in Django filter command in python?

0 votes
440 views

I'm new to Django. Is there any tell how to add a limit filter in Django?

posted Jan 31, 2019 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+2 votes

I am trying to learn Django. My initial exercise seems fine. I want to create an API with REST on Django for an interactive Python code. REST framework on Django I am understanding more or less.

I am looking for a simple example to start with. I am using Python 2.7+ on MS-Windows 7 Professional.

If any one may kindly suggest.

+4 votes

I have been trying to set up a python, django, mysql, virtualenvwrapper and git development project and am really confused. All of the documentation seems to ignore the apt-get installation methods used by Debian Linux and its derivatives. Does pip install the same as apt-get; I don't think so. If I use virtualenvwrapper, how does this fit with the normal debian (wheezy) installation. I also need git which just confuses the situation even more. Must I give up the automatic updating system that Debian provides when setting up the development environment?

The documentation centers on Windows, Mac and generic Linux distributions and ignores the automation of the Debian installation. All of the documentation I have found concentrates on the installation of individual packages or on the use of python-django and is very sketchy on the overall virtualenv(wrapper), git, python-django file structure and installation order.

0 votes

I am having trouble matching Python data types with those of MySQL. MySQL has about 7 basic data types including Blobs, Binaries, etc. It also has a rich selection of geometry types. In addition, types like INT have 7 or 8 different options like Primary Key, zero fill, auto inc, etc. I can't seem to find anything in python to match these. I am trying to build a model.py for an existing database that was created with MySQL Workbench.

I do not wish to use anything other than MySQL because of the complexity of my storage needs (searchable text, PDF, Audio, Video and Photos). The text searches will often be word phrase searches through thousands of documents. I need the speed and the data type flexibility.

How do I build or modify a model.py to do this. I really don't want to write a model.py manually. That would really be a major pain. Workbench to the database an import to Django and edit is my choice. Unfortunately, the model.py produced has lost most of the functionality of the original database and I can't seem to figure out how to fix it.

+1 vote

Hi,

Please, I'm working on a dashboard project and so far I am facing challenges when it comes to writing functions for my views.

The difficulty here is, how do I write functions for different parts on a template.

For instance, I want to write a function that takes a user to his profile. How do I do that?

So far this is what I came up with:

@login_required
def show_profile:
  if request.method ==GET:
   return(render, '/profile.html/')
  else:
   return (render, '/login.html/')
+1 vote

Anyone can explain how to delete or alter existing table in database?

...