[Rogue] .andOpt with near

7 wyświetleń
Przejdź do pierwszej nieodczytanej wiadomości

Riccardo Sirigu

nieprzeczytany,
13 kwi 2017, 08:19:0413.04.2017
do Lift
Hi everyone,

I'm  trying to build the following query

override def page: Seq[Elem] = Elem.whereOpt(...)
   
.andOpt(cityFilter.is)(_.geoAddress near(???, ???, Degrees(0.2)))
   
.fetch()

where cityFilter is 

object cityFilter extends RequestVar[Option[LatLong]](None)

I would like to access to the lat and long fields that are inside the cityFilter but I can't because the compiler spills out type errors

Is there a way to do it?

Thank you in advance

Torsten Uhlmann

nieprzeczytany,
13 kwi 2017, 08:47:0913.04.2017
do Lift
Something along these lines might work:

.andOpt(cityFilter.is)((x,latLong) => x.geoAddress near(latLong.lat, latLong.long, Degrees(0.2)))

Let me know if that works,
Torsten.

Riccardo Sirigu

nieprzeczytany,
13 kwi 2017, 08:49:1513.04.2017
do Lift
Awesome, thank you Torsten

Torsten Uhlmann

nieprzeczytany,
13 kwi 2017, 09:16:3313.04.2017
do lif...@googlegroups.com
Glad I could help!

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
AGYNAMIX(R). Passionate Software.
Inh. Torsten Uhlmann | Buchenweg 5 | 09380 Thalheim
Phone:     +49 3721 273445
Fax:         +49 3721 273446
Mobile:     +49 151 12412427
Web:        http://www.agynamix.de
Odpowiedz wszystkim
Odpowiedz autorowi
Przekaż
Nowe wiadomości: 0