Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 26 15:19
    mvorisek edited #835
  • Feb 26 11:04
    mvorisek synchronize #835
  • Feb 26 11:04

    mvorisek on better_add_title_name

    rem insane replace (compare)

  • Feb 26 11:03
    mvorisek synchronize #835
  • Feb 26 11:03

    mvorisek on better_add_title_name

    ii (compare)

  • Feb 26 11:01
    mvorisek review_requested #835
  • Feb 26 11:01
    mvorisek review_requested #835
  • Feb 26 11:01
    mvorisek opened #835
  • Feb 26 11:00

    mvorisek on better_add_title_name

    fix title field name guess (compare)

  • Feb 26 10:42

    mvorisek on better_add_title_name

    fix title field collision (compare)

  • Feb 26 00:40

    mvorisek on fix_our_field_default

    Fix our_field default (compare)

  • Feb 25 22:56
    DarkSide666 closed #834
  • Feb 25 22:56

    DarkSide666 on develop

    Add additional Join test with f… (compare)

  • Feb 25 22:56

    DarkSide666 on actual-name

    (compare)

  • Feb 25 22:43
    DarkSide666 review_requested #834
  • Feb 25 22:32
    DarkSide666 ready_for_review #834
  • Feb 25 21:45
    DarkSide666 synchronize #834
  • Feb 25 21:45

    DarkSide666 on actual-name

    exclude test for postgre (compare)

  • Feb 25 21:38
    DarkSide666 converted_to_draft #834
  • Feb 25 21:38
    DarkSide666 opened #834
Imants Horsts
@DarkSide666
this will add WHERE condition not HAVING condition
Imants Horsts
@DarkSide666
ok fixed: atk4/atk4@5f4601c
only it is using where instead of having, but I guess it's ok for now
Imants Horsts
@DarkSide666
ok, found one bug win AD with enum. it only looks for enum array values, but should look in keys too.
enum can be defined as
->enum([
    'legal' => 'Juridiska persona', // non-numeric key, should use key as value
    'individual', // numeric key, should use value as value
])
Imants Horsts
@DarkSide666
reported here: atk4/data#167 and will fix this in a moment
Refined documentation ofr Audit Extension.
uh this type of enum might be problematic.
i've never used enums like that
imagine enum [1,2]
vs enum ['foo', 'bar'] or even
how do you figure out which is key and which is value.
Imants Horsts
@DarkSide666
ir key is numeric, then value should be used, if key is not numeric, then key is value
see: PR atk4/data#168
only problematic left here is if you actually want numeric values in enum
i don't see other way how to work around this issue. One thing is value (numeric or words) and each of them need to have name which we actually will show in forms
maybe we should always always use enum array keys as possible values, but then simple enum(['foo','bar'])will actually save 0 or 1 in db not foo or bar. That's not intuitive, but possible solution
Romans Malinovskis
@romaninsh
isset($enum[0]) - could this work?
which is why i don't want enum() to contain key-value, as it makes certain cases impossible.
and the worst one is
->enum(['N', 'Y']) vs enum([0, 1])
what you're looking at is "valueList"
that can be stored in ui/valueList
because "Juridiska Persona" will not be used by AD
it's only presentation decorator
Imants Horsts
@DarkSide666
well ... maybe
then I'll haveto define it like this in my model?
->enum(['legal', 'individual'])
->valueList([
    'legal' => 'Juridiska persona',
    'individual' => 'Fiziska persona',
])
or
->enum(['legal', 'individual'])
->ui[
    'valueList' => [
        'legal' => 'Juridiska persona',
        'individual' => 'Fiziska persona',
    ],
])
Romans Malinovskis
@romaninsh
well, yeah kinda.
$v = ['legal' => 'Juridiska persona',
        'individual' => 'Fiziska persona'];
->enum(array_keys($v))->ui(['valueList' => $v]);
Imants Horsts
@DarkSide666
ok
ok, another small PR for you: atk4/data#169
there was problem with fields if they have trailing spaces. tests failed then and we didn't notice that ;)
looks ok.
Imants Horsts
@DarkSide666
atk4/data#169 ready for merge
DarkSide666 @DarkSide666 going offline till later
Romans Malinovskis
@romaninsh
cool.
Imants Horsts
@DarkSide666
small PR ready for merge: atk4/data#170 fixes #166 and add test casefor that
Imants Horsts
@DarkSide666
In Toolkit Field class we have method getExpr() whichnicely returns model field name with all table aliases. Do we have something like that in AD?
It could be useful to have for example in this situation:
  // join address
  $j = $this->join('address');
  $a1 = $j->hasOne('city_id', ['City', 'mandatory' => 'true'])->withTitle();
  $a2 = $j->addField('street');
  $a3 = $j->addField('house');
  $a4 = $j->addField('flat');

  // $this->addExpression('full_address')
  //     ->set('concat_ws('.$a2->getExpr().','.$a3->getExpr().','.$a4->getExpr().','.$a1->getExpr().')');
see commented addExpression - how can I do this in AD to have correct table aliases in field names?
Romans Malinovskis
@romaninsh
I'll be closing down this room in favor of http://gitter.im/atk4/atk4 soon.
invited all participants from here to a new room.
(or rather old one)
Gabriel Balint
@za-dof
Hello, I have a question, I have a model "Game" with a reference ( $this->hasOne('winner_id', "Player"); ) but when I put a simple crud in place, it displays the ID, instead of the name
Romans Malinovskis
@romaninsh
Hey Gabriel. We hang out in atk4/atk4 room. This is atk4/data. I’ll reply you there.
Sylvain Robez-Masson
@syrm
Can we alias primary key like field (field use actual parameter) ?
my primary key is cit_id i want use the name id