I believe there is a way:One thing we can do is to after we create the 
model in web2py, there is a log file call SQL log. Someone can copy that 
and after creating a project in django, open up the settings.py and paste 
that in there. 

After that, just type in:

python manage.py inspectdb > models.py

Which will generate models.py. Then someone can synch the db 

and create the app. 

Here is the link

*:https://docs.djangoproject.com/en/1.7/howto/legacy-databases/ 
<https://docs.djangoproject.com/en/1.7/howto/legacy-databases/>*


 The other direction is much simpler. Once the django model files are 
generated. Someone can do:

python scripts/extract_mysql_models.py username:password@databasename > 
db1.py

I haven't tried either or. Will be interested to see what others find out.


On Saturday, March 28, 2015 at 9:35:15 PM UTC-4, Ron Chatterjee wrote:
>
> I agree with Phyo. Syntax is lot better and readable and close to sql than 
> ORM
>
> On Saturday, March 28, 2015 at 4:28:24 PM UTC-4, Phyo Arkar wrote:
>>
>> Web2py DAL is actually a lot more powerful. i use web2py DAL anywhere 
>> even if it is not for web or non web2py project.
>>
>> On Sun, Mar 29, 2015 at 1:47 AM, Ron Chatterjee <achatte...@gmail.com> 
>> wrote:
>>
>>> That will be great. Then we can also do django development using web2py 
>>> interface. you rock massimo!
>>>
>>>
>>>
>>>
>>> On Saturday, March 28, 2015 at 12:23:55 PM UTC-4, Massimo Di Pierro 
>>> wrote:
>>>>
>>>> This is a backward compatibility problem in the latest web2py. Should 
>>>> be fixed in the nightly build (for testers)
>>>>
>>>> On Friday, 27 March 2015 15:56:05 UTC-5, Ron Chatterjee wrote:
>>>>>
>>>>> This is an old web2py blog.
>>>>>
>>>>> http://www.web2py.com/AlterEgo/default/show/189
>>>>>
>>>>> Did anyone went through the steps and was able to generate the tables? 
>>>>> I tried but it failed. It didn't work. Is it only valid for polls example 
>>>>> only or any django models can be used in web2py this way? Not sure. 
>>>>>
>>>>> I know its not a recommended and I will never deploy an application 
>>>>> using this method. But wanted to try few django projects and code them up 
>>>>> in web2py to learn more but I am and kind of feeling lazy to write the 
>>>>> table from scratch. thought copy and paste will be nice if I can get this 
>>>>> method to work. Any web2pier wants to try and see what I am doing wrong?
>>>>>
>>>>> *I get an error saying:*
>>>>>
>>>>> models/db.py" 
>>>>> <http://127.0.0.1:8000/admin/default/edit/try_django_polls/models/db.py>, 
>>>>> line 62, in <module>
>>>>>     class Poll(Model):
>>>>>   File "applications\try_django_polls\modules\django.py", line 145, in 
>>>>> __new__
>>>>>     fields=[db.Field(key,**value.serial(name,db)) for key,value in 
>>>>> attrs.items() if hasattr(value,'serial') and not 
>>>>> isinstance(value,ManyToManyField)]
>>>>>   File "...\Desktop\web2py_src\web2py\gluon\dal\base.py", line 893, in 
>>>>> __getattr__
>>>>>     return ogetattr(self, key)
>>>>>
>>>>> AttributeError: 'DAL' object has no attribute 'Field' 
>>>>>
>>>>  -- 
>>> 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+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

-- 
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