masoniteframework / craft Goto Github PK
View Code? Open in Web Editor NEWCraft command line tool
Craft command line tool
Have an option on Craft model to generate mutators and accessor.
The command would create mutators and accessors for all columns of the table. For example
from orator.orm import Model, accessor
class User(Model):
@accessor
def first_name(self):
first_name = self.get_raw_attribute('first_name')
return first_name[0].upper() + first_name[1:]
@first_name.mutator
def set_first_name(self, value):
self.set_raw_attribute('first_name', value.lower())
writing documentation for creating new commands
Write documentation on adding commands to craft
Write documentation on how to add migration directories to craft
Using masonite-cli 2.0.7 and trying to create a command;
➜ craft command InstallCommand
[CommandNotFound]
Command "command" is not defined.
This command is not defined in the list of available commands (help, install, list, ew, package). So I think these commands (command, provider) need to be created as mentioned in the documentation.
Here adding the service provider should be done inside config/application.py
. So what's the purpose of config/providers.py
.
Adding ApiProvider,
to providers causes craft to crash.
Trying to add entry
to craft. Below is the error.
WARNING: 'module' object is not callable
Traceback (most recent call last):
File "/usr/local/bin/craft", line 7, in <module>
from masonite_cli.application import application
File "/usr/local/lib/python3.7/site-packages/masonite_cli/application.py", line 39, in <module>
from wsgi import container
File "/Users/oseintow/Sites/masonite/wsgi.py", line 41, in <module>
located_provider = provider()
TypeError: 'module' object is not callable
HI,
I have masonite-cli installed on my user account folder
holic ~ ls .local/bin/
aws faker pyrsa-decrypt pytest rst2latex.py rst2pseudoxml.py rstpep2html.py
aws_bash_completer jp.py pyrsa-decrypt-bigfile py.test rst2latex.pyc rst2pseudoxml.pyc rstpep2html.pyc
aws.cmd jp.pyc pyrsa-encrypt rst2html4.py rst2man.py rst2s5.py tabulate
aws_completer orator pyrsa-encrypt-bigfile rst2html4.pyc rst2man.pyc rst2s5.pyc tldextract
aws_zsh_completer.sh pip pyrsa-keygen rst2html5.py rst2odt_prepstyles.py rst2xetex.py virtualenv
chardetect pip3 pyrsa-priv2pub rst2html5.pyc rst2odt_prepstyles.pyc rst2xetex.pyc waitress-serve
craft pip3.6 pyrsa-sign rst2html.py rst2odt.py rst2xml.py watchmedo
dotenv pygmentize pyrsa-verify rst2html.pyc rst2odt.pyc rst2xml.pyc wheel
So when i run craft is from that location:
holic ~/dev/holic-labs/masonite which craft
/home/holic/.local/bin/craft
When i run craft new
command i got a warning message:
holic ~/dev/holic-labs/masonite craft new demo
WARNING:
Crafting Application ...
Application Created Successfully!
Now just cd into your project and run
$ craft install
to install the project dependencies.
Create Something Amazing!
Have installed Python 3.6.6.
Don't know why is appearing that Warning, but until now is everything is running fine.
Have i anyway to know why is giving me a warning?
We have to run craft Package command outside of masonite project. In this usage, we are not able to run core commands. To be able to make a package story stronger It will be nice to have the functionality to run core commands after creating a project.
I can't create a new project with craft command.
$ craft new myproject
[ProjectLimitReached]
You have reached your hourly limit of creating new projects. Try again in 1 hour.
I want to use my access token on github.
so please make a option or load environment variables.
I''ve added a way for Craft to auto add the virtual environment the user is currently in temporarily to the sys.path. This allows the command line tool to pick up on packages that are not on the system and only inside the virtual environment. It currently looks in:
/full/path/to/venv/lib/{directory that starts with python}/site-packages
I need to verify this path is the same on windows. I assume it is already the same as linux.
Just trying to follow package creation wiki. I create InstallCommand and when run craft
I have this error 😕.
WARNING: 'module' object is not callable
Traceback (most recent call last): File "/Users/nioperas06/.local/share/virtualenvs/masonite-package-J5jd90TB/bin/craft", line 7, in <module> from masonite_cli.application import application File "/Users/nioperas06/.local/share/virtualenvs/masonite-package-J5jd90TB/lib/python3.6/site-packages/masonite_cli/application.py", line 39, in <module>
from wsgi import container
File "/Users/nioperas06/workspace/tutorials/masonite-package/tuto/wsgi.py", line 42, in <module>
located_provider.load_app(container).register()
File "/Users/nioperas06/workspace/tutorials/masonite-package/tuto/app/providers/InstallProvider.py", line 10, in register
self.app.bind('InstallCommand', InstallCommand())
TypeError: 'module' object is not callable
""" A InstallCommand Command """
from cleo import Command
class InstallCommand(Command):
def handle(self):
pass
''' A InstallProvider Service Provider '''
from masonite.provider import ServiceProvider
from app.commands import InstallCommand
class InstallProvider(ServiceProvider):
wsgi = False
def register(self):
self.app.bind('InstallCommand', InstallCommand())
def boot(self):
pass
...
from app.providers.InstallProvider import InstallProvider
...
PROVIDERS = [
...
InstallProvider,
]
😕
if the install command is ran and is not inside a virtual environment, it should auto create one under the venv
folder namespace and then run the installation.
The other Masonite repositories have license files but this one is missing one.
I'm trying to clear my database when my UnitTests
runs...
So, i've added:
def tearDown(self):
subprocess.call('craft migrate:refresh --quiet --no-ansi', shell=True)
But when i run the tests, i still got all querys on my shell. It be a little confusing. We should be able to hide those messages without disable all DB_LOG in .env
file
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.