Optional Limit after Query Object was Created
With method chaining, we like to act that the queries at each step are immutable, so a copy is returned whenever the query is changed. You just need to reassign:

```python
entries = entries.limit(limit)
```

But your code is gross on just about every possible level for such a short piece of code.

* Default of -1 is gross. It could just as easily be zero, if you take a look at the way you've written your conditional...
* But you don't need to use -1 or 0, just use None
* In fact, you don't even need the condition, because specifying .limit(None) is the same as not specifying any limit
* Why coerce to a list before returning? That forces the query to be evaluated and effectively limits the reuse of that function for any subsequent query-building. Just return the query object -- that way you can apply additional filters/etc if you need to later.

```python
def get_entries(limit=None):
    return Entry.select().limit(limit)
``` Hey, thanks for your reply. 

> But your code is gross on just about every possible level for such a short piece of code.

I would use the excuse, that it was pretty late as I was writing this but I guess I'm just dumb (: 

> But you don't need to use -1 or 0, just use None

I wasn't aware of this. Even if in the documentation, this value default to `None`, I didn't find a hint that if `None` if passed, the query is evaluated without a `Limit`. 

> Why coerce to a list before returning? That forces the query to be evaluated and effectively limits the reuse of that function for any subsequent query-building. Just return the query object -- that way you can apply additional filters/etc if you need to later.

You are having a point here I guess. My thought on this was to wrap all peewee specific calls into a dedicated module and returning pure python objects.

But since the object which is returned from `select()` is iterate-able, there is no need to build a python list from the result.
Consider that you have a wrapper method, which obtains a list of all `Entry` objects from a table. 

This method has an optional `limit` parameter that limits the fetched results. If the `limit` parameter is set to -1, all rows should be selected. 

When defining this wrapper function like so:
```Python
def getEntries(limit=-1):
  allEntries = Entry.select()
  
  if limit != -1 and limit >= 0:
    allEntries.limit(limit)

  return list(allEntries)
```

and calling it with `getEntries()` it works fine. However, if I set any value for the `limit` parameter (`getEntries(limit=10)`) the limit is not applied.

Also when looking at the produced query, using `print(allEntries.sql())` before the `return` statement, the `LIMIT` statement is missing. 

My question now is: How can I realize an optional limit parameter without creating a whole new query object? 