[Zotonic-Dev] How can I make two indexes in one category?

2017-09-29 Thread heiheshang
now I can create one table for one category. How can I create multiple 
pivot tables? Is it not always convenient to have one table.
observe_custom_pivot returns tuple for one table.Of course I can create 
indexes for several fields in one table, but this is not always convenient.

-- 

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


Re: [Zotonic-Dev] Using Elixir to Develop

2017-09-29 Thread Marc Worrell
Can mix build rebar3 based apps?
If so then we can just provide a mix based project.

I am also thinking of using the introspection (we are using that for
notify observers) to discover if a module, filter, action or other
type of Zotonic callback module is an Elixir module.
And if so we could generate or use some glue code to call directly
into the Elixir modules from Zotonic.

- M


> On 29 Sep 2017, at 10:49, Jake Morrison  wrote:
> 
> On Fri, Sep 29, 2017 at 08:12:53AM +, Marc Worrell wrote:
>> Thinking of it… we do use a lot of records for all notifications and 
>> postbacks.
>> 
>> Are those supported in Elixir?
> 
> Records are supported, here is the Elixir syntax:
> https://hexdocs.pm/elixir/Record.html
> Maps are generally easier to deal with than records, though, in both 
> languages.
> 
> I have converted larger Erlang codebases to Elixir incrementally. The
> first step is generally to switch the project to using using mix, the
> Elixir build tool. Second is to switch to using maps for the core data
> structures, so it's easier to interoperate. Then we do a "mechanical"
> conversion from Erlang to Elixir, as the language semantics are
> essentially the same. Depending on the state of tests in the project, we
> would either use the Erlang tests to validate that things are still
> working properly, or write tests using Elixir's ExUnit and friends.
> Finally we start using the syntax improvements in Elixir to make the code 
> nicer.
> 
> For interop, doing the first two steps would make things easiest for
> Elixir folks. It adds a dependency on Elixir to build the system,
> though.
> 
>> - Marc
> 
> Jake
> 
>>> On 29 Sep 2017, at 08:54, Kai Janson  wrote:
>>> 
>>> Some of the things in the hrl file could be replaced by Elixir macros or 
>>> functions?
>>> 
>>> On Sep 29, 2017, at 02:51, Marc Worrell >> > wrote:
>>> 
 Hi Allen,
 
 Two weeks ago David de Boer and I had a look at how Elixir and 
 Erlang could be mixed.
 
 We concluded that it all should be possible to do with the master.
 But also that we didn’t know enough of Elixir to make it frictionless.
 So we need some help with this.
 
 The master is split in applications, and those will all be pushed to Hex.
 That is a good start for any Elixir setup, I guess.
 
 The main zotonic.hrl is mainly included because we like to poke around in 
 #context{} (which we shouldn’t) and to use the ?DEBUG/1 macro.
 
 There are some other macros in there, but they are not essential.
 So it is not really needed for building modules etc.
 
 We welcome help to make Zotonic work with Elixir!
 
 Arjan could probably help as well - though he is very busy right now.
 
 Cheers, Marc
 
 
> On 29 Sep 2017, at 03:17, Allen Wyma  > wrote:
> 
> Hi,
> 
> Does anyone have a guide with how to use elixir with Zotonic?
> We're a ruby house that's looking to switch to elixir, but
> sometimes we get projects that seem to work better for a CMS. When
> I saw this project, I was quite amazed and we'd like to start to
> experiment a bit with it.
> 
> Is it possible to have a guide of how to use elixir with Zotonic?
> I've tried looking a bit at the code for erlang, and it includes
> references to hrl (erlang macro/header files) which are not
> supported in elixir. This is probably my biggest question of how
> to translate over the code.
> 
> Thanks
> 
> -- 
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Zotonic developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to zotonic-developers+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 

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


Re: [Zotonic-Dev] Using Elixir to Develop

2017-09-29 Thread Jake Morrison
On Fri, Sep 29, 2017 at 08:12:53AM +, Marc Worrell wrote:
> Thinking of it… we do use a lot of records for all notifications and 
> postbacks.
> 
> Are those supported in Elixir?

Records are supported, here is the Elixir syntax:
https://hexdocs.pm/elixir/Record.html
Maps are generally easier to deal with than records, though, in both languages.

I have converted larger Erlang codebases to Elixir incrementally. The
first step is generally to switch the project to using using mix, the
Elixir build tool. Second is to switch to using maps for the core data
structures, so it's easier to interoperate. Then we do a "mechanical"
conversion from Erlang to Elixir, as the language semantics are
essentially the same. Depending on the state of tests in the project, we
would either use the Erlang tests to validate that things are still
working properly, or write tests using Elixir's ExUnit and friends.
Finally we start using the syntax improvements in Elixir to make the code nicer.

For interop, doing the first two steps would make things easiest for
Elixir folks. It adds a dependency on Elixir to build the system,
though.

> - Marc

Jake

> > On 29 Sep 2017, at 08:54, Kai Janson  wrote:
> > 
> > Some of the things in the hrl file could be replaced by Elixir macros or 
> > functions?
> > 
> > On Sep 29, 2017, at 02:51, Marc Worrell  > > wrote:
> > 
> >> Hi Allen,
> >> 
> >> Two weeks ago David de Boer and I had a look at how Elixir and 
> >> Erlang could be mixed.
> >> 
> >> We concluded that it all should be possible to do with the master.
> >> But also that we didn’t know enough of Elixir to make it frictionless.
> >> So we need some help with this.
> >> 
> >> The master is split in applications, and those will all be pushed to Hex.
> >> That is a good start for any Elixir setup, I guess.
> >> 
> >> The main zotonic.hrl is mainly included because we like to poke around in 
> >> #context{} (which we shouldn’t) and to use the ?DEBUG/1 macro.
> >> 
> >> There are some other macros in there, but they are not essential.
> >> So it is not really needed for building modules etc.
> >> 
> >> We welcome help to make Zotonic work with Elixir!
> >> 
> >> Arjan could probably help as well - though he is very busy right now.
> >> 
> >> Cheers, Marc
> >> 
> >> 
> >>> On 29 Sep 2017, at 03:17, Allen Wyma  >>> > wrote:
> >>> 
> >>> Hi,
> >>> 
> >>> Does anyone have a guide with how to use elixir with Zotonic?
> >>> We're a ruby house that's looking to switch to elixir, but
> >>> sometimes we get projects that seem to work better for a CMS. When
> >>> I saw this project, I was quite amazed and we'd like to start to
> >>> experiment a bit with it.
> >>> 
> >>> Is it possible to have a guide of how to use elixir with Zotonic?
> >>> I've tried looking a bit at the code for erlang, and it includes
> >>> references to hrl (erlang macro/header files) which are not
> >>> supported in elixir. This is probably my biggest question of how
> >>> to translate over the code.
> >>> 
> >>> Thanks

-- 

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


Re: [Zotonic-Dev] Using Elixir to Develop

2017-09-29 Thread Marc Worrell

> On 29 Sep 2017, at 10:38, Allen Wyma  wrote:
> 
> Ganz geil! How to connect?

That is German, actually.
The team is quite present on gitter.

https://gitter.im/zotonic/zotonic 

Maas-Maarten, David and Arthur are there quite regularly.
And maybe Arjan is watching along between his busy times.

- Marc



> On Fri, Sep 29, 2017 at 4:13 PM Marc Worrell  > wrote:
>> On 29 Sep 2017, at 10:11, Allen Wyma > > wrote:
>> 
>> I’m more than willing to help out in exchange for some Dutch help? Language 
>> 4 language exchange? :)
> 
> LOL,  quite some people in the core team are quite proficient in Dutch.
> So that won’t be problematic :)
> 
> - M
> 
> -- 
> 
> --- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "Zotonic developers" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/zotonic-developers/iOOAFZ8Uq1Y/unsubscribe 
> .
> To unsubscribe from this group and all its topics, send an email to 
> zotonic-developers+unsubscr...@googlegroups.com 
> .
> For more options, visit https://groups.google.com/d/optout 
> .
> 
> -- 
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Zotonic developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to zotonic-developers+unsubscr...@googlegroups.com 
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 

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


Re: [Zotonic-Dev] Using Elixir to Develop

2017-09-29 Thread Allen Wyma
Ganz geil! How to connect?
On Fri, Sep 29, 2017 at 4:13 PM Marc Worrell  wrote:

> On 29 Sep 2017, at 10:11, Allen Wyma  wrote:
>
> I’m more than willing to help out in exchange for some Dutch help?
> Language 4 language exchange? :)
>
>
> LOL,  quite some people in the core team are quite proficient in Dutch.
> So that won’t be problematic :)
>
> - M
>
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Zotonic developers" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/zotonic-developers/iOOAFZ8Uq1Y/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> zotonic-developers+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

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


Re: [Zotonic-Dev] Using Elixir to Develop

2017-09-29 Thread Marc Worrell

> On 29 Sep 2017, at 10:11, Allen Wyma  wrote:
> 
> I’m more than willing to help out in exchange for some Dutch help? Language 4 
> language exchange? :)

LOL,  quite some people in the core team are quite proficient in Dutch.
So that won’t be problematic :)

- M

-- 

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


Re: [Zotonic-Dev] Using Elixir to Develop

2017-09-29 Thread Marc Worrell
Thinking of it… we do use a lot of records for all notifications and postbacks.

Are those supported in Elixir?

- Marc

> On 29 Sep 2017, at 08:54, Kai Janson  wrote:
> 
> Some of the things in the hrl file could be replaced by Elixir macros or 
> functions?
> 
> Sent from my non-google-device
> 
> On Sep 29, 2017, at 02:51, Marc Worrell  > wrote:
> 
>> Hi Allen,
>> 
>> Two weeks ago David de Boer and I had a look at how Elixir and 
>> Erlang could be mixed.
>> 
>> We concluded that it all should be possible to do with the master.
>> But also that we didn’t know enough of Elixir to make it frictionless.
>> So we need some help with this.
>> 
>> The master is split in applications, and those will all be pushed to Hex.
>> That is a good start for any Elixir setup, I guess.
>> 
>> The main zotonic.hrl is mainly included because we like to poke around in 
>> #context{} (which we shouldn’t) and to use the ?DEBUG/1 macro.
>> 
>> There are some other macros in there, but they are not essential.
>> So it is not really needed for building modules etc.
>> 
>> We welcome help to make Zotonic work with Elixir!
>> 
>> Arjan could probably help as well - though he is very busy right now.
>> 
>> Cheers, Marc
>> 
>> 
>>> On 29 Sep 2017, at 03:17, Allen Wyma >> > wrote:
>>> 
>>> Hi,
>>> 
>>> Does anyone have a guide with how to use elixir with Zotonic? We're a ruby 
>>> house that's looking to switch to elixir, but sometimes we get projects 
>>> that seem to work better for a CMS. When I saw this project, I was quite 
>>> amazed and we'd like to start to experiment a bit with it.
>>> 
>>> Is it possible to have a guide of how to use elixir with Zotonic? I've 
>>> tried looking a bit at the code for erlang, and it includes references to 
>>> hrl (erlang macro/header files) which are not supported in elixir. This is 
>>> probably my biggest question of how to translate over the code.
>>> 
>>> Thanks
>>> 
>>> -- 
>>> 
>>> --- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "Zotonic developers" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to zotonic-developers+unsubscr...@googlegroups.com 
>>> .
>>> For more options, visit https://groups.google.com/d/optout 
>>> .
>> 
>> 
>> -- 
>> 
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Zotonic developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to zotonic-developers+unsubscr...@googlegroups.com 
>> .
>> For more options, visit https://groups.google.com/d/optout 
>> .
> 
> 
> -- 
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Zotonic developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to zotonic-developers+unsubscr...@googlegroups.com 
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 

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


Re: [Zotonic-Dev] Using Elixir to Develop

2017-09-29 Thread Allen Wyma
I’m more than willing to help out in exchange for some Dutch help? Language
4 language exchange? :)
On Fri, Sep 29, 2017 at 4:10 PM Kai Janson  wrote:

> Some of the things in the hrl file could be replaced by Elixir macros or
> functions?
>
> Sent from my non-google-device
>
> On Sep 29, 2017, at 02:51, Marc Worrell  wrote:
>
> Hi Allen,
>
> Two weeks ago David de Boer and I had a look at how Elixir and
> Erlang could be mixed.
>
> We concluded that it all should be possible to do with the master.
> But also that we didn’t know enough of Elixir to make it frictionless.
> So we need some help with this.
>
> The master is split in applications, and those will all be pushed to Hex.
> That is a good start for any Elixir setup, I guess.
>
> The main zotonic.hrl is mainly included because we like to poke around in
> #context{} (which we shouldn’t) and to use the ?DEBUG/1 macro.
>
> There are some other macros in there, but they are not essential.
> So it is not really needed for building modules etc.
>
> We welcome help to make Zotonic work with Elixir!
>
> Arjan could probably help as well - though he is very busy right now.
>
> Cheers, Marc
>
>
> On 29 Sep 2017, at 03:17, Allen Wyma  wrote:
>
> Hi,
>
> Does anyone have a guide with how to use elixir with Zotonic? We're a ruby
> house that's looking to switch to elixir, but sometimes we get projects
> that seem to work better for a CMS. When I saw this project, I was quite
> amazed and we'd like to start to experiment a bit with it.
>
> Is it possible to have a guide of how to use elixir with Zotonic? I've
> tried looking a bit at the code for erlang, and it includes references to
> hrl (erlang macro/header files) which are not supported in elixir. This is
> probably my biggest question of how to translate over the code.
>
> Thanks
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Zotonic developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to zotonic-developers+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Zotonic developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to zotonic-developers+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Zotonic developers" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/zotonic-developers/iOOAFZ8Uq1Y/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> zotonic-developers+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

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


Re: [Zotonic-Dev] Using Elixir to Develop

2017-09-29 Thread Kai Janson
Some of the things in the hrl file could be replaced by Elixir macros or 
functions?

Sent from my non-google-device

> On Sep 29, 2017, at 02:51, Marc Worrell  wrote:
> 
> Hi Allen,
> 
> Two weeks ago David de Boer and I had a look at how Elixir and 
> Erlang could be mixed.
> 
> We concluded that it all should be possible to do with the master.
> But also that we didn’t know enough of Elixir to make it frictionless.
> So we need some help with this.
> 
> The master is split in applications, and those will all be pushed to Hex.
> That is a good start for any Elixir setup, I guess.
> 
> The main zotonic.hrl is mainly included because we like to poke around in 
> #context{} (which we shouldn’t) and to use the ?DEBUG/1 macro.
> 
> There are some other macros in there, but they are not essential.
> So it is not really needed for building modules etc.
> 
> We welcome help to make Zotonic work with Elixir!
> 
> Arjan could probably help as well - though he is very busy right now.
> 
> Cheers, Marc
> 
> 
>> On 29 Sep 2017, at 03:17, Allen Wyma  wrote:
>> 
>> Hi,
>> 
>> Does anyone have a guide with how to use elixir with Zotonic? We're a ruby 
>> house that's looking to switch to elixir, but sometimes we get projects that 
>> seem to work better for a CMS. When I saw this project, I was quite amazed 
>> and we'd like to start to experiment a bit with it.
>> 
>> Is it possible to have a guide of how to use elixir with Zotonic? I've tried 
>> looking a bit at the code for erlang, and it includes references to hrl 
>> (erlang macro/header files) which are not supported in elixir. This is 
>> probably my biggest question of how to translate over the code.
>> 
>> Thanks
>> 
>> -- 
>> 
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Zotonic developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to zotonic-developers+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Zotonic developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to zotonic-developers+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 

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