On Jan 18, 2008 3:27 AM, Dmitrii 'Mamut' Dimandt <[EMAIL PROTECTED]> wrote:
>
> I'm still at qite a loss :)
>
> Here's a table that I have:
>
> page
> ------
> id
> title
> url_title
> Having erlyweb_magic on and running m(page), I get this:
>
> add_related_many_to_many/3 find_related_many_range/6
> after_delete/1 find_related_many_to_many/5
> after_fetch/1 find_related_many_to_one/5
> after_save/1 find_related_one_to_many/3
> aggregate/4 find_with/1
> aggregate_related_many/6 get/2
> aggregate_related_many_to_many get_module/1
> aggregate_related_many_to_one/ get_pk_fk_fields/0
> avg/3 get_pk_fk_fields2/0
> avg/1 id/1
> avg/2 id/2
> avg_with/2 increment/1
> before_delete/1 increment/2
> before_save/1 insert/1
> count/0 is_new/1
> count/3 is_new/2
> count/2 is_related/3
> count/1 max/3
> count_with/2 max/1
> db_field/1 max/2
> db_field_names/0 max_with/2
> db_field_names_bin/0 min/3
> db_field_names_str/0 min/1
> db_fields/0 min/2
> db_num_fields/0 min_with/2
> db_pk_fields/0 module_info/0
> db_table/0 module_info/1
> decrement/1 new/0
> decrement/2 new/2
> delete/1 new_from_strings/1
> delete_all/0 new_with/1
> delete_id/1 new_with/2
> delete_where/1 relations/0
> do_delete/1 remove_related_many_to_many/3
> do_save/1 remove_related_many_to_many_all/5
> driver/0 save/1
> field_from_string/2 set/3
> field_names_for_query/0 set_fields/2
> field_names_for_query/1 set_fields/3
> field_to_iolist/2 set_fields_from_strs/2
> field_to_iolist/1 set_related_one_to_many/3
> fields/0 stddev/3
> find/2 stddev/1
> find/1 stddev/2
> find/0 stddev_with/2
> find_first/2 sum/3
> find_first/0 sum/1
> find_first/1 sum/2
> find_first_with/1 sum_with/2
> find_id/1 table/0
> find_max/3 title/2
> find_max/1 title/1
> find_max/2 to_iolist/1
> find_max_with/2 to_iolist/2
> find_range/4 transaction/1
> find_range/2 type_field/0
> find_range/3 update/1
> find_range_with/3 update/2
> find_related_many_first/4 url_title/2
> find_related_many_max/5 url_title/1
>
>
> Some of these I understand and know how to use. Like title/1, id/1,
> url_title/1
> Others I understand, but I don't know how to use: all the *_with functions,
> id/2 (and other field_name/2)
> And same I don't understand at all. Like find_related_many_first/4
>
> I also have a page_section table:
>
> page_section
> -------------
> id
> section_order
> section_text
> page_id
> How do I tell page_section that page_id is a many-to-one relationship to
> the page table?
in page_section.erl, add this function
relations() ->
[{many_to_one, [page]}].
>
> I know the enlightenment is just around the corner, but I'm not just there
> yet :)
Did you read the documentation for erlydb_base? It should explain and
give examples for everything you need.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"erlyweb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---