Hi,

I try to insert some demo data in my db using this :

for fav_record in range(1, 10000): object_type = choice(range(1, 5))

        if object_type == 1: object_id = choice(range(1, 504))
        elif object_type == 2: object_id = choice(range(1, 7))
        elif object_type == 3: object_id = choice(range(1, 17))
        elif object_type == 4: object_id = choice(range(1, 61))

        demo_data.append({
            'object_id': object_id,
            'object_type': object_type,
            'user_id': choice(range(1, 504))
        })

    db.m_favourite.bulk_insert(demo_data)
    db.commit()

a code which returns what I want in the python shell (db aside)  but when 
loading in db (postgresql) throught the application (the code is in a 
module loading if db is empty) I get the following as result :

id, object_id, object_type, user_id
"35960";13;2;1
"33820";40;4;1
"37416";6;3;1
"38077";4;4;1
"30097";39;4;1
"36511";43;3;1
"34819";45;2;1
"35723";35;1;1
"39200";19;4;1
"30869";1;3;1
"33347";47;1;1
"37439";43;3;1
"30403";3;3;1
"30133";55;2;1
"38242";8;3;1
"34273";46;4;1
"34218";49;2;1
"36811";47;1;1
"31154";39;4;1
"37125";40;2;1
"33974";45;1;1
"32078";1;3;1
"36548";53;3;1
"34855";33;1;1
"38634";32;4;1
"36846";45;1;1
"33554";44;3;1
"36122";27;1;1

Where you can notice some object_type set at 2 having an object_id set to 
something > 6 ?

I really don't understand why.

Thank you

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to