table_alias
Can you give me a set of models and a query that reproduces this error?

Hi , I know I asked for this and it is working but trying to get sql server working with peewee (pyodbc) in this part of code in peewee

```
def _max_alias(self, alias_map):
    max_alias = 0
    if alias_map:
        for alias in alias_map.values():
            alias_number = int(alias.lstrip('t'))
            if alias_number > max_alias:
                max_alias = alias_number
    return max_alias + 1
```

alias_number = int(alias.lstrip('t')) this part of code "assume" that alias for table is
like 't1'... etc, but if I defined table_alias this is were you get exception

so I kind of fix it (for what I understand :) ) with this

   def _max_alias(self, alias_map):
        max_alias = 0

```
    if alias_map :
        # for alias in alias_map.values():
        # fix
        for key,alias in alias_map.iteritems():
            if len(key._meta.table_alias) < 1:
                alias_number = int(alias.lstrip('t'))
                if alias_number > max_alias:
                    max_alias = alias_number
    return max_alias + 1
```

I hope this helps
