Skip to content

Commit

Permalink
Merge pull request #29 from Fenny/master
Browse files Browse the repository at this point in the history
Fix binding in django
  • Loading branch information
Fenny authored Jul 24, 2020
2 parents dd647c0 + c21a049 commit a06b81a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions django/django.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"sync"

"github.com/flosch/pongo2"
"github.com/gofiber/fiber"
"github.com/gofiber/template/utils"
)

Expand Down Expand Up @@ -180,6 +181,14 @@ func getPongoBinding(binding interface{}) pongo2.Context {
if binds, ok := binding.(map[string]interface{}); ok {
return binds
}
if binds, ok := binding.(fiber.Map); ok {
bind := make(pongo2.Context)
for key, value := range binds {
bind[key] = value
}
return bind
}

return nil
}

Expand Down

0 comments on commit a06b81a

Please sign in to comment.